Top Fields Constructors Methods
org.apache.derby.client.net

public Class NetConnection

extends ClientConnection
Class Inheritance
Imports
java.io.InputStream, .OutputStream, java.net.SocketTimeoutException, java.nio.ByteBuffer, .CharBuffer, java.sql.Array, .NClob, .PreparedStatement, .ResultSet, .SQLClientInfoException, .SQLException, .SQLXML, .Struct, java.util.Arrays, .List, .Properties, javax.transaction.xa.Xid, org.apache.derby.client.am.ClientCallableStatement, .ClientDatabaseMetaData, .DisconnectException, .EncryptionManager, .ClientPreparedStatement, .SqlException, .ClientMessageId, .ClientStatement, .Agent, .ClientConnection, .FailedProperties40, .LogWriter, .SQLExceptionFactory, .Section, .SectionManager, org.apache.derby.shared.common.reference.MessageId, .Attribute, .SQLState, org.apache.derby.shared.common.i18n.MessageUtil, org.apache.derby.client.ClientAutoloadedDriver, .ClientPooledConnection, .BasicClientDataSource, .ClientDataSourceInterface, org.apache.derby.shared.common.sanity.SanityManager

Field Summary

Modifier and TypeField and Description
private final boolean
private boolean
pack-priv byte[]
protected int
private transient char[]
private String
private List<Xid>
private PreparedStatement
isValidStmt

Prepared statement that is used each time isValid() is called on this connection.

private static final MessageUtil
protected NetAgent
private final ClientPooledConnection
private ByteBuffer
private transient byte[]
private int
private transient byte[]
protected int
protected int
protected int
private transient byte[]
protected int
protected int
private int
pack-priv int
private transient byte[]
pack-priv String
pack-priv String
protected int
protected int
protected int
protected NetXAResource
Inherited from org.apache.derby.client.am.ClientConnection:
agent_autoCommit_commBufferSize_databaseMetaData_databaseName_dataSource_encryptionManager_inUnitOfWork_isXAConnection_open_portNumber_productID_resetConnectionAtFirstSql_serverNameIP_user_XA_T0_NOT_ASSOCIATEDXA_T1_ASSOCIATEDxaHostVersion_

Constructor Summary

AccessConstructor and Description
pack-priv
NetConnection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, Properties properties)

pack-priv
NetConnection(LogWriter logWriter, String user, String password, BasicClientDataSource dataSource, int rmId, boolean isXAConn)

pack-priv
NetConnection(LogWriter
LogWriter object associated with this connection
logWriter
,
String
user id for this connection
user
,
String
password for this connection
password
,
BasicClientDataSource
The DataSource object passed from the PooledConnection object from which this constructor was called
dataSource
,
int
The Resource manager ID for XA Connections
rmId
,
boolean
true if this is a XA connection
isXAConn
,
ClientPooledConnection
The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object
cpc
)

This constructor is called from the ClientPooledConnection object to enable the NetConnection to pass this on to the associated prepared statement object thus enabling the prepared statement object to in turn raise the statement events to the ClientPooledConnection object

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

if this connection can be closed when it has uncommitted operations, true; otherwise, false
allowCloseInUOW_
()

Implements abstract org.apache.derby.client.am.ClientConnection.allowCloseInUOW_.

Check if the connection can be closed when there are uncommitted operations.
protected boolean
private void
private void
private void
checkSecmgrForSecmecSupport(int securityMechanism)

private void
private void
private void
public synchronized void
close()

Overrides org.apache.derby.client.am.ClientConnection.close.

Implements java.sql.Connection.close.

Close the connection and release its resources.
private void
completeReset(boolean isDeferredReset)

protected void
private void
private void
public Array
createArrayOf(String
the SQL name of the type the elements of the array map to. The typeName is a database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This is the value returned by Array.getBaseTypeName
typeName
,
Object[]
the elements that populate the returned object
elements
)

Implements java.sql.Connection.createArrayOf.

Factory method for creating Array objects.
public NClob
createNClob()

Implements java.sql.Connection.createNClob.

Constructs an object that implements the NClob interface.
public SQLXML
createSQLXML()

Implements java.sql.Connection.createSQLXML.

Constructs an object that implements the SQLXML interface.
public Struct
createStruct(String
the SQL type name of the SQL structured type that this Struct object maps to. The typeName is the name of a user-defined type that has been defined for this database. It is the value returned by Struct.getSQLTypeName.
typeName
,
Object[]
the attributes that populate the returned object
attributes
)

Implements java.sql.Connection.createStruct.

Factory method for creating Struct objects.
protected boolean
private byte[]
private byte[]
private byte[]
private char[]
flipBits(char[] array)

private void
flowConnect(String password, int securityMechanism)

private void
private void
private void
private void
flowKeyExchange(int securityMechanism, byte[] publicKey)

private boolean
flowReconnect(String password, int securityMechanism)

private void
flowSecurityCheckAndAccessRdb(int securityMechanism, String user, String password, byte[] encryptedUserid, byte[] encryptedPassword)

private void
flowSeedExchange(int securityMechanism, byte[] sourceSeed)

private void
private void
flowServerAttributesAndKeyExchange(int securityMechanism, byte[] publicKey)

private void
private void
private void
private void
private void
flowUSRSSBPWDconnect(String password)

The User ID and Strong Password Substitute mechanism (USRSSBPWD) authenticates the user like the user ID and password mechanism, but the password does not flow.

public int
public String

Returns:

a null String value
getClientInfo
(String
a String value
name
)

Implements java.sql.Connection.getClientInfo.

getClientInfo always returns a null String since Derby doesn't support ClientInfoProperties.
public Properties

Returns:

an empty Properties object.
getClientInfo
()

Implements java.sql.Connection.getClientInfo.

getClientInfo always returns an empty Properties object since Derby doesn't support ClientInfoProperties.
public int
private String
public EncryptionManager
pack-priv Xid[]
public InputStream
public OutputStream
public String
public int
public int
public int
public int
public int
public int
public byte[]
public int
private void
handleLoginTimeout(Throwable original)

Handle socket timeouts during connection attempts

private void
initialize(String password, BasicClientDataSource dataSource, boolean isXAConn)

private void
private void
public final boolean

Returns:

Returns the connectionNull.
isConnectionNull
()

protected boolean
public boolean

Returns:

open
isOpen
()

Returns if a transaction is in process

public boolean

Returns:

true if the connection is valid, false otherwise
isValid
(int
The time in seconds to wait for the database operation used to validate the connection to complete. If the timeout period expires before the operation completes, this method returns false. A value of 0 indicates a timeout is not applied to the database operation.
timeout
)

Implements java.sql.Connection.isValid.

Checks if the connection has not been closed and is still valid.
public boolean

Returns:

true if this implements the interface or directly or indirectly wraps an object that does.
isWrapperFor
(Class<?>
a Class defining an interface.
interfaces
)

Implements java.sql.Wrapper.isWrapperFor.

Returns false unless interfaces is implemented
private SqlException
mapSecchkcd(int secchkcd)

protected void
protected Agent
newAgent_(LogWriter logWriter, int loginTimeout, String serverName, int portNumber, int clientSSLMode)

Implements abstract org.apache.derby.client.am.ClientConnection.newAgent_.

protected ClientCallableStatement
newCallableStatement_(String sql, int type, int concurrency, int holdability)

Implements abstract org.apache.derby.client.am.ClientConnection.newCallableStatement_.

protected ClientDatabaseMetaData
protected ClientPreparedStatement
protected ClientPreparedStatement
newPreparedStatement_(String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes)

Implements abstract org.apache.derby.client.am.ClientConnection.newPreparedStatement_.

public SectionManager
protected ClientStatement
newStatement_(int type, int concurrency, int holdability)

Implements abstract org.apache.derby.client.am.ClientConnection.newStatement_.

private byte[]
pack-priv void
rdbAccessed(int svrcod, String prdid, boolean crrtknReceived, byte[] crrtkn)

private void
readAllConnectCommandsChained(int securityMechanism)

public void
pack-priv void
public void
public void
public void
public void
public void
private void
private void
readServerAttributesAndKeyExchange(int securityMechanism)

public void
protected void
readXACommit_()

Implements abstract org.apache.derby.client.am.ClientConnection.readXACommit_.

Invokes readCommit on NetXAConnection
protected void
readXARollback_()

Implements abstract org.apache.derby.client.am.ClientConnection.readXARollback_.

Invokes writeRollback on NetXAConnection
protected void
protected void
resetCallableStatement_(ClientCallableStatement cs, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)

Implements abstract org.apache.derby.client.am.ClientConnection.resetCallableStatement_.

private void
protected void
resetPreparedStatement_(ClientPreparedStatement ps, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, String[] columnNames, int[] columnIndexes)

Implements abstract org.apache.derby.client.am.ClientConnection.resetPreparedStatement_.

protected void
resetStatement_(ClientStatement statement, int type, int concurrency, int holdability)

Implements abstract org.apache.derby.client.am.ClientConnection.resetStatement_.

pack-priv void
securityCheckComplete(int svrcod, int secchkcd)

public final boolean
protected final boolean
public final boolean
protected final boolean

Returns:

true if LOB locators are supported.
serverSupportsLocators
()

Implements abstract org.apache.derby.client.am.ClientConnection.serverSupportsLocators.

Checks whether the server supports locators for large objects.
pack-priv final boolean

Returns:

true if QRYCLSIMP is fully supported
serverSupportsQryclsimp
()

Check whether the server has full support for the QRYCLSIMP parameter in OPNQRY.

protected final boolean
serverSupportsTimestampNanoseconds()

Implements abstract org.apache.derby.client.am.ClientConnection.serverSupportsTimestampNanoseconds.

Return true if the server supports nanoseconds in timestamps
protected final boolean

Returns:

true if UDTs are supported
serverSupportsUDTs
()

Check whether the server supports UDTs

protected final boolean

Returns:

true if the server supports the UTF-8 Ccsid Manager
serverSupportsUtf8Ccsid
()

Check whether the server supports the UTF-8 Ccsid Manager

pack-priv void
setAccessSecurityData(int secchkcd, int desiredSecmec, int[] secmecList, boolean sectknReceived, byte[] sectkn)

public void
setClientInfo(String
a property key String
name
,
String
a property value String
value
)

Implements java.sql.Connection.setClientInfo.

setClientInfo will always throw a SQLClientInfoException since Derby does not support any properties.
public void
setClientInfo(Properties
a Properties object with the properties to set.
properties
)

Implements java.sql.Connection.setClientInfo.

setClientInfo will throw a SQLClientInfoException unless the properties parameter is empty, since Derby does not support any properties.
public void
setConnectionNull(boolean
The connectionNull to set.
connectionNull
)

private void
public void
setIndoubtTransactions(List<Xid> indoubtTransactions)

public void
public void
pack-priv void
setServerAttributeData(String srvclsnm, String srvrlslv)

protected final boolean

Returns:

true session data caching is supported
supportsSessionDataCaching
()

Implements abstract org.apache.derby.client.am.ClientConnection.supportsSessionDataCaching.

Check whether the server supports session data caching
public <T> T

Returns:

an object that implements the interface
unwrap
(Class<T>
a Class defining an interface
interfaces
)

Implements java.sql.Wrapper.unwrap.

Returns this if this class implements the interface
public boolean
private void
writeAllConnectCommandsChained(int securityMechanism, String user, String password)

public void
pack-priv void
public void
public void
public void
public void
public void
private void
writeSecurityCheckAndAccessRdb(int securityMechanism, String user, String password, byte[] encryptedUserid, byte[] encryptedPassword)

private void
writeServerAttributesAndKeyExchange(int securityMechanism, byte[] publicKey)

public void
protected void
writeXACommit_()

Implements abstract org.apache.derby.client.am.ClientConnection.writeXACommit_.

Invokes write commit on NetXAConnection
protected void
writeXARollback_()

Implements abstract org.apache.derby.client.am.ClientConnection.writeXARollback_.

Invokes writeRollback on NetXAConnection
protected void
Inherited from org.apache.derby.client.am.ClientConnection:
abortbeginAbortingcheckForClosedConnectionclearWarningscloseResourcescommitcompleteAbnormalUnitOfWorkcompleteAbnormalUnitOfWorkcompleteChainBreakingDisconnectcompleteConnectcompleteInitialPiggyBackIsolationcompleteInitialPiggyBackSchemacompleteLocalCommitcompleteLocalRollbackcompletePiggyBackIsolationcompletePiggyBackSchemacompleteResetcompleteSqlcacreateBlobcreateClobcreateStatementcreateStatementcreateStatementfinalizeflowAutoCommitflowRollbackgetAutoCommitgetCataloggetCurrentSchemaNamegetHoldabilitygetMetaDatagetNetworkTimeoutgetSchemagetServerVersiongetTransactionIDgetTransactionIsolationgetTransactionIsolationXgetTypeMapgetWarningsgetXAStateisAbortingisClosedisClosedXisPhysicalConnClosedisReadOnlyisXAConnectionlightResetnativeSQLprepareCallprepareCallprepareCallprepareStatementprepareStatementprepareStatementprepareStatementprepareStatementprepareStatementreleaseSavepointresetresetConnectionresetPrepareCallresetPrepareStatementresetStatementrollbackrollbacksetAutoCommitsetCatalogsetHoldabilitysetNetworkTimeoutsetReadOnlysetSavepointsetSavepointsetSchemasetTransactionIsolationsetTypeMapsetXAStatetransactionInProgress