org.postgresql.jdbc4
Class Jdbc4Connection

java.lang.Object
  extended by org.postgresql.jdbc2.AbstractJdbc2Connection
      extended by org.postgresql.jdbc3.AbstractJdbc3Connection
          extended by org.postgresql.jdbc3g.AbstractJdbc3gConnection
              extended by org.postgresql.jdbc4.Jdbc4Connection
All Implemented Interfaces:
Connection, Wrapper, BaseConnection, PGConnection

public class Jdbc4Connection
extends AbstractJdbc3gConnection
implements Connection

This class implements the java.sql.Connection interface for JDBC4. However most of the implementation is really done in org.postgresql.jdbc4.AbstractJdbc4Connection or one of it's parents


Field Summary
 
Fields inherited from class org.postgresql.jdbc2.AbstractJdbc2Connection
autoCommit, bindStringAsVarchar, firstWarning, metadata, prepareThreshold, readOnly, typemap
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
Jdbc4Connection(String host, int port, String user, String database, Properties info, String url)
           
 
Method Summary
 void abort(Executor executor)
           
 Array createArrayOf(String typeName, Object[] elements)
           
 Blob createBlob()
           
 Clob createClob()
           
 NClob createNClob()
           
<T> T
createQueryObject(Class<T> ifc)
           
 SQLXML createSQLXML()
           
 Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 Struct createStruct(String typeName, Object[] attributes)
           
 Properties getClientInfo()
           
 String getClientInfo(String name)
           
 DatabaseMetaData getMetaData()
           
 int getNetworkTimeout()
           
 Logger getParentLogger()
           
 String getSchema()
           
 boolean isValid(int timeout)
           
 boolean isWrapperFor(Class<?> iface)
           
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.
 void setClientInfo(Properties properties)
           
 void setClientInfo(String name, String value)
           
 void setNetworkTimeout(Executor executor, int milliseconds)
           
 void setSchema(String schema)
           
 void setTypeMap(Map<String,Class<?>> map)
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class org.postgresql.jdbc3.AbstractJdbc3Connection
createStatement, getHoldability, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setHoldability, setSavepoint, setSavepoint
 
Methods inherited from class org.postgresql.jdbc2.AbstractJdbc2Connection
addDataType, addDataType, addWarning, cancelQuery, checkClosed, clearWarnings, close, commit, createStatement, createTypeInfo, enableDriverManagerLogging, encodeString, escapeString, execSQLQuery, execSQLQuery, execSQLUpdate, finalize, getAutoCommit, getCatalog, getCopyAPI, getCursorName, getDBVersionNumber, getEncoding, getFastpathAPI, getIsolationLevelName, getLargeObjectAPI, getLogger, getNotifications, getObject, getPrepareThreshold, getProtocolVersion, getQueryExecutor, getServerMajorVersion, getServerMinorVersion, getStandardConformingStrings, getStringVarcharFlag, getTimestampUtils, getTransactionIsolation, getTransactionState, getTypeInfo, getTypeMap, getURL, getUserName, getWarnings, haveMinimumCompatibleVersion, haveMinimumServerVersion, isClosed, isReadOnly, nativeSQL, prepareCall, prepareStatement, rollback, setAutoCommit, setCatalog, setCursorName, setPrepareThreshold, setReadOnly, setTransactionIsolation, setTypeMapImpl
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Connection
clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

Jdbc4Connection

public Jdbc4Connection(String host,
                       int port,
                       String user,
                       String database,
                       Properties info,
                       String url)
                throws SQLException
Throws:
SQLException
Method Detail

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency,
                                 int resultSetHoldability)
                          throws SQLException
Description copied from class: AbstractJdbc3Connection
Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is the same as the createStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden.

Specified by:
createStatement in interface Connection
Specified by:
createStatement in class AbstractJdbc3Connection
Parameters:
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new Statement object that will generate ResultSet objects with the given type, concurrency, and holdability
Throws:
SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
See Also:
ResultSet

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws SQLException
Description copied from class: AbstractJdbc3Connection
Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.

This method is the same as the prepareStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden.

Specified by:
prepareStatement in interface Connection
Specified by:
prepareStatement in class AbstractJdbc3Connection
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parameters
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
Throws:
SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
See Also:
ResultSet

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
                              throws SQLException
Description copied from class: AbstractJdbc3Connection
Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareCall method above, but it allows the default result set type, result set concurrency type and holdability to be overridden.

Specified by:
prepareCall in interface Connection
Specified by:
prepareCall in class AbstractJdbc3Connection
Parameters:
sql - a String object that is the SQL statement to be sent to the database; may contain on or more ? parameters
resultSetType - one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency - one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
resultSetHoldability - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
Throws:
SQLException - if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
See Also:
ResultSet

getMetaData

public DatabaseMetaData getMetaData()
                             throws SQLException
Specified by:
getMetaData in interface Connection
Specified by:
getMetaData in class AbstractJdbc2Connection
Throws:
SQLException

setTypeMap

public void setTypeMap(Map<String,Class<?>> map)
                throws SQLException
Specified by:
setTypeMap in interface Connection
Throws:
SQLException

createClob

public Clob createClob()
                throws SQLException
Throws:
SQLException

createBlob

public Blob createBlob()
                throws SQLException
Throws:
SQLException

createNClob

public NClob createNClob()
                  throws SQLException
Throws:
SQLException

createSQLXML

public SQLXML createSQLXML()
                    throws SQLException
Throws:
SQLException

createStruct

public Struct createStruct(String typeName,
                           Object[] attributes)
                    throws SQLException
Throws:
SQLException

createArrayOf

public Array createArrayOf(String typeName,
                           Object[] elements)
                    throws SQLException
Throws:
SQLException

isValid

public boolean isValid(int timeout)
                throws SQLException
Throws:
SQLException

setClientInfo

public void setClientInfo(String name,
                          String value)
                   throws SQLClientInfoException
Throws:
SQLClientInfoException

setClientInfo

public void setClientInfo(Properties properties)
                   throws SQLClientInfoException
Throws:
SQLClientInfoException

getClientInfo

public String getClientInfo(String name)
                     throws SQLException
Throws:
SQLException

getClientInfo

public Properties getClientInfo()
                         throws SQLException
Throws:
SQLException

createQueryObject

public <T> T createQueryObject(Class<T> ifc)
                    throws SQLException
Throws:
SQLException

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Throws:
SQLException

getParentLogger

public Logger getParentLogger()
                       throws SQLFeatureNotSupportedException
Throws:
SQLFeatureNotSupportedException

setSchema

public void setSchema(String schema)
               throws SQLException
Throws:
SQLException

getSchema

public String getSchema()
                 throws SQLException
Throws:
SQLException

abort

public void abort(Executor executor)
           throws SQLException
Throws:
SQLException

setNetworkTimeout

public void setNetworkTimeout(Executor executor,
                              int milliseconds)
                       throws SQLException
Throws:
SQLException

getNetworkTimeout

public int getNetworkTimeout()
                      throws SQLException
Throws:
SQLException


Copyright © 2013. All Rights Reserved.