Package org.apache.derby.client.net
Class NetConnection
- java.lang.Object
-
- org.apache.derby.client.am.ClientConnection
-
- org.apache.derby.client.net.NetConnection
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.sql.Connection,java.sql.Wrapper,ConnectionCallbackInterface
public class NetConnection extends ClientConnection
-
-
Field Summary
Fields Modifier and Type Field Description private booleancloseStatementsOnCloseprivate booleanconnectionNull(package private) byte[]crrtkn_protected intcurrXACallInfoOffset_private char[]deferredResetPassword_private java.lang.Stringextnam_private java.util.List<javax.transaction.xa.Xid>indoubtTransactions_private java.sql.PreparedStatementisValidStmtPrepared statement that is used each time isValid() is called on this connection.private static MessageUtilmsgutilprotected NetAgentnetAgent_private ClientPooledConnectionpooledConnection_private java.nio.ByteBufferprddta_private byte[]publicKey_private intsecurityMechanism_private byte[]sourceSeed_protected inttargetAgent_protected inttargetCmnappc_protected inttargetCmntcpip_private byte[]targetPublicKey_protected inttargetRdb_protected inttargetRsyncmgr_private inttargetSecmec_(package private) inttargetSecmgr_private byte[]targetSeed_(package private) java.lang.StringtargetSrvclsnm_(package private) java.lang.StringtargetSrvrlslv_protected inttargetSyncptmgr_protected inttargetUnicodemgr_protected inttargetXamgr_protected NetXAResourcexares_-
Fields inherited from class org.apache.derby.client.am.ClientConnection
agent_, autoCommit_, commBufferSize_, databaseMetaData_, databaseName_, dataSource_, encryptionManager_, inUnitOfWork_, isXAConnection_, open_, portNumber_, productID_, resetConnectionAtFirstSql_, serverNameIP_, user_, XA_T0_NOT_ASSOCIATED, XA_T1_ASSOCIATED, xaHostVersion_
-
-
Constructor Summary
Constructors Constructor Description NetConnection(LogWriter logWriter, int driverManagerLoginTimeout, java.lang.String serverName, int portNumber, java.lang.String databaseName, java.util.Properties properties)NetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn)NetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc)This constructor is called from the ClientPooledConnection object to enable the NetConnection to passthison 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanallowCloseInUOW_()Check if the connection can be closed when there are uncommitted operations.protected booleanallowLocalCommitRollback_()private voidcheckDatabaseName()private voidcheckPasswordLength(java.lang.String password)private voidcheckSecmgrForSecmecSupport(int securityMechanism)private voidcheckUser(java.lang.String user)private voidcheckUserLength(java.lang.String user)private voidcheckUserPassword(java.lang.String user, java.lang.String password)voidclose()Close the connection and release its resources.private voidcompleteReset(boolean isDeferredReset)protected voidconstructCrrtkn()private voidconstructExtnam()private voidconstructPrddta()java.sql.ArraycreateArrayOf(java.lang.String typeName, java.lang.Object[] elements)java.sql.NClobcreateNClob()java.sql.SQLXMLcreateSQLXML()java.sql.StructcreateStruct(java.lang.String typeName, java.lang.Object[] attributes)protected booleandoCloseStatementsOnClose_()private byte[]encryptedPasswordForEUSRIDPWD(java.lang.String password)private byte[]encryptedPasswordForUSRENCPWD(java.lang.String password)private byte[]encryptedUseridForEUSRIDPWD()private char[]flipBits(char[] array)private voidflowConnect(java.lang.String password, int securityMechanism)private voidflowEUSRIDDTAconnect()private voidflowEUSRIDPWDconnect(java.lang.String password)private voidflowEUSRPWDDTAconnect(java.lang.String password)private voidflowKeyExchange(int securityMechanism, byte[] publicKey)private booleanflowReconnect(java.lang.String password, int securityMechanism)private voidflowSecurityCheckAndAccessRdb(int securityMechanism, java.lang.String user, java.lang.String password, byte[] encryptedUserid, byte[] encryptedPassword)private voidflowSeedExchange(int securityMechanism, byte[] sourceSeed)private voidflowServerAttributes()private voidflowServerAttributesAndKeyExchange(int securityMechanism, byte[] publicKey)private voidflowSimpleConnect()private voidflowUSRENCPWDconnect(java.lang.String password)private voidflowUSRIDONLconnect()private voidflowUSRIDPWDconnect(java.lang.String password)private voidflowUSRSSBPWDconnect(java.lang.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.intgetAGENT()java.util.PropertiesgetClientInfo()getClientInfoalways returns an emptyPropertiesobject since Derby doesn't support ClientInfoProperties.java.lang.StringgetClientInfo(java.lang.String name)getClientInfoalways returns anull Stringsince Derby doesn't support ClientInfoProperties.intgetCMNTCPIP()private java.lang.StringgetDeferredResetPassword()EncryptionManagergetEncryptionManager()(package private) javax.transaction.xa.Xid[]getIndoubtTransactionIds()java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()java.lang.StringgetProductID()intgetRDB()intgetRSYNCMGR()intgetSECMGR()intgetSecurityMechanism()intgetSQLAM()intgetSYNCPTMGR()byte[]getTargetPublicKey()intgetXAMGR()private voidhandleLoginTimeout(java.lang.Throwable original)Handle socket timeouts during connection attemptsprivate voidinitialize(java.lang.String password, BasicClientDataSource40 dataSource, boolean isXAConn)private voidinitializeClientSeed()private voidinitializePublicKeyForEncryption()booleanisConnectionNull()protected booleanisGlobalPending_()booleanisOpen()Returns if a transaction is in processbooleanisValid(int timeout)Checks if the connection has not been closed and is still valid.booleanisWrapperFor(java.lang.Class<?> interfaces)Returns false unlessinterfacesis implementedprivate SqlExceptionmapSecchkcd(int secchkcd)protected voidmarkClosed_()protected AgentnewAgent_(LogWriter logWriter, int loginTimeout, java.lang.String serverName, int portNumber, int clientSSLMode)protected ClientCallableStatementnewCallableStatement_(java.lang.String sql, int type, int concurrency, int holdability)protected ClientDatabaseMetaDatanewDatabaseMetaData_()protected ClientPreparedStatementnewPositionedUpdatePreparedStatement_(java.lang.String sql, Section section)protected ClientPreparedStatementnewPreparedStatement_(java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes)SectionManagernewSectionManager(Agent agent)protected ClientStatementnewStatement_(int type, int concurrency, int holdability)private byte[]passwordSubstituteForUSRSSBPWD(java.lang.String password)(package private) voidrdbAccessed(int svrcod, java.lang.String prdid, boolean crrtknReceived, byte[] crrtkn)private voidreadAllConnectCommandsChained(int securityMechanism)voidreadCommitSubstitute_()(package private) voidreadDeferredReset()voidreadLocalCommit_()voidreadLocalRollback_()voidreadLocalXACommit_()voidreadLocalXARollback_()voidreadLocalXAStart_()private voidreadSecurityCheckAndAccessRdb()private voidreadServerAttributesAndKeyExchange(int securityMechanism)voidreadTransactionStart()protected voidreadXACommit_()Invokes readCommit on NetXAConnectionprotected voidreadXARollback_()Invokes writeRollback on NetXAConnectionprotected voidreset_(LogWriter logWriter)protected voidresetCallableStatement_(ClientCallableStatement cs, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)private voidresetNetConnection(LogWriter logWriter)protected voidresetPreparedStatement_(ClientPreparedStatement ps, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes)protected voidresetStatement_(ClientStatement statement, int type, int concurrency, int holdability)(package private) voidsecurityCheckComplete(int svrcod, int secchkcd)booleanserverSupportLongRDBNAM()protected booleanserverSupportsEXTDTAAbort()booleanserverSupportsLayerBStreaming()protected booleanserverSupportsLocators()Checks whether the server supports locators for large objects.(package private) booleanserverSupportsQryclsimp()Check whether the server has full support for the QRYCLSIMP parameter in OPNQRY.protected booleanserverSupportsTimestampNanoseconds()Return true if the server supports nanoseconds in timestampsprotected booleanserverSupportsUDTs()Check whether the server supports UDTsprotected booleanserverSupportsUtf8Ccsid()Check whether the server supports the UTF-8 Ccsid Manager(package private) voidsetAccessSecurityData(int secchkcd, int desiredSecmec, int[] secmecList, boolean sectknReceived, byte[] sectkn)voidsetClientInfo(java.lang.String name, java.lang.String value)setClientInfowill always throw aSQLClientInfoExceptionsince Derby does not support any properties.voidsetClientInfo(java.util.Properties properties)setClientInfowill throw aSQLClientInfoExceptionunless thepropertiesparameter is empty, since Derby does not support any properties.voidsetConnectionNull(boolean connectionNull)private voidsetDeferredResetPassword(java.lang.String password)voidsetIndoubtTransactions(java.util.List<javax.transaction.xa.Xid> indoubtTransactions)voidsetInputStream(java.io.InputStream inputStream)voidsetOutputStream(java.io.OutputStream outputStream)(package private) voidsetServerAttributeData(java.lang.String srvclsnm, java.lang.String srvrlslv)protected booleansupportsSessionDataCaching()Check whether the server supports session data caching<T> Tunwrap(java.lang.Class<T> interfaces)Returnsthisif this class implements the interfacebooleanwillAutoCommitGenerateFlow()private voidwriteAllConnectCommandsChained(int securityMechanism, java.lang.String user, java.lang.String password)voidwriteCommitSubstitute_()(package private) voidwriteDeferredReset()voidwriteLocalCommit_()voidwriteLocalRollback_()voidwriteLocalXACommit_()voidwriteLocalXARollback_()voidwriteLocalXAStart_()private voidwriteSecurityCheckAndAccessRdb(int securityMechanism, java.lang.String user, java.lang.String password, byte[] encryptedUserid, byte[] encryptedPassword)private voidwriteServerAttributesAndKeyExchange(int securityMechanism, byte[] publicKey)voidwriteTransactionStart(ClientStatement statement)protected voidwriteXACommit_()Invokes write commit on NetXAConnectionprotected voidwriteXARollback_()Invokes writeRollback on NetXAConnectionprotected voidwriteXATransactionStart(ClientStatement statement)-
Methods inherited from class org.apache.derby.client.am.ClientConnection
abort, beginAborting, checkForClosedConnection, clearWarnings, closeResources, commit, completeAbnormalUnitOfWork, completeAbnormalUnitOfWork, completeChainBreakingDisconnect, completeConnect, completeInitialPiggyBackIsolation, completeInitialPiggyBackSchema, completeLocalCommit, completeLocalRollback, completePiggyBackIsolation, completePiggyBackSchema, completeReset, completeSqlca, createBlob, createClob, createStatement, createStatement, createStatement, finalize, flowAutoCommit, flowRollback, getAutoCommit, getCatalog, getCurrentSchemaName, getHoldability, getMetaData, getNetworkTimeout, getSchema, getServerVersion, getTransactionID, getTransactionIsolation, getTransactionIsolationX, getTypeMap, getWarnings, getXAState, isAborting, isClosed, isClosedX, isPhysicalConnClosed, isReadOnly, isXAConnection, lightReset, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, reset, resetConnection, resetPrepareCall, resetPrepareStatement, resetStatement, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, setXAState, transactionInProgress
-
-
-
-
Field Detail
-
msgutil
private static final MessageUtil msgutil
-
netAgent_
protected NetAgent netAgent_
-
pooledConnection_
private final ClientPooledConnection pooledConnection_
-
closeStatementsOnClose
private final boolean closeStatementsOnClose
-
targetAgent_
protected int targetAgent_
-
targetCmntcpip_
protected int targetCmntcpip_
-
targetRdb_
protected int targetRdb_
-
targetSecmgr_
int targetSecmgr_
-
targetCmnappc_
protected int targetCmnappc_
-
targetXamgr_
protected int targetXamgr_
-
targetSyncptmgr_
protected int targetSyncptmgr_
-
targetRsyncmgr_
protected int targetRsyncmgr_
-
targetUnicodemgr_
protected int targetUnicodemgr_
-
extnam_
private java.lang.String extnam_
-
targetSrvclsnm_
java.lang.String targetSrvclsnm_
-
targetSrvrlslv_
java.lang.String targetSrvrlslv_
-
publicKey_
private transient byte[] publicKey_
-
targetPublicKey_
private transient byte[] targetPublicKey_
-
sourceSeed_
private transient byte[] sourceSeed_
-
targetSeed_
private transient byte[] targetSeed_
-
prddta_
private java.nio.ByteBuffer prddta_
-
crrtkn_
byte[] crrtkn_
-
targetSecmec_
private int targetSecmec_
-
securityMechanism_
private int securityMechanism_
-
deferredResetPassword_
private transient char[] deferredResetPassword_
-
connectionNull
private boolean connectionNull
-
xares_
protected NetXAResource xares_
-
indoubtTransactions_
private java.util.List<javax.transaction.xa.Xid> indoubtTransactions_
-
currXACallInfoOffset_
protected int currXACallInfoOffset_
-
isValidStmt
private java.sql.PreparedStatement isValidStmt
Prepared statement that is used each time isValid() is called on this connection. The statement is created the first time isValid is called and closed when the connection is closed (by the close call).
-
-
Constructor Detail
-
NetConnection
NetConnection(LogWriter logWriter, int driverManagerLoginTimeout, java.lang.String serverName, int portNumber, java.lang.String databaseName, java.util.Properties properties) throws SqlException
- Throws:
SqlException
-
NetConnection
NetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn) throws SqlException
- Throws:
SqlException
-
NetConnection
NetConnection(LogWriter logWriter, java.lang.String user, java.lang.String password, BasicClientDataSource40 dataSource, int rmId, boolean isXAConn, ClientPooledConnection cpc) throws SqlException
This constructor is called from the ClientPooledConnection object to enable the NetConnection to passthison to the associated prepared statement object thus enabling the prepared statement object to in turn raise the statement events to the ClientPooledConnection object- Parameters:
logWriter- LogWriter object associated with this connectionuser- user id for this connectionpassword- password for this connectiondataSource- The DataSource object passed from the PooledConnection object from which this constructor was calledrmId- The Resource manager ID for XA ConnectionsisXAConn- true if this is a XA connectioncpc- The ClientPooledConnection object from which this NetConnection constructor was called. This is used to pass StatementEvents back to the pooledConnection object- Throws:
SqlException
-
-
Method Detail
-
setDeferredResetPassword
private void setDeferredResetPassword(java.lang.String password)
-
getDeferredResetPassword
private java.lang.String getDeferredResetPassword()
-
initialize
private void initialize(java.lang.String password, BasicClientDataSource40 dataSource, boolean isXAConn) throws SqlException- Throws:
SqlException
-
resetNetConnection
private void resetNetConnection(LogWriter logWriter) throws SqlException
- Throws:
SqlException
-
reset_
protected void reset_(LogWriter logWriter) throws SqlException
- Specified by:
reset_in classClientConnection- Throws:
SqlException
-
completeReset
private void completeReset(boolean isDeferredReset) throws SqlException- Throws:
SqlException
-
flowConnect
private void flowConnect(java.lang.String password, int securityMechanism) throws SqlException- Throws:
SqlException
-
flowSimpleConnect
private void flowSimpleConnect() throws SqlException- Throws:
SqlException
-
handleLoginTimeout
private void handleLoginTimeout(java.lang.Throwable original) throws SqlExceptionHandle socket timeouts during connection attempts- Throws:
SqlException
-
flowReconnect
private boolean flowReconnect(java.lang.String password, int securityMechanism) throws SqlException- Throws:
SqlException
-
flowUSRIDPWDconnect
private void flowUSRIDPWDconnect(java.lang.String password) throws SqlException- Throws:
SqlException
-
flowUSRIDONLconnect
private void flowUSRIDONLconnect() throws SqlException- Throws:
SqlException
-
flowUSRENCPWDconnect
private void flowUSRENCPWDconnect(java.lang.String password) throws SqlException- Throws:
SqlException
-
flowEUSRIDPWDconnect
private void flowEUSRIDPWDconnect(java.lang.String password) throws SqlException- Throws:
SqlException
-
flowEUSRIDDTAconnect
private void flowEUSRIDDTAconnect() throws SqlException- Throws:
SqlException
-
flowEUSRPWDDTAconnect
private void flowEUSRPWDDTAconnect(java.lang.String password) throws SqlException- Throws:
SqlException
-
flowUSRSSBPWDconnect
private void flowUSRSSBPWDconnect(java.lang.String password) throws SqlExceptionThe User ID and Strong Password Substitute mechanism (USRSSBPWD) authenticates the user like the user ID and password mechanism, but the password does not flow. A password substitute is generated instead using the SHA-1 algorithm, and is sent to the application server. The application server generates a password substitute using the same algorithm and compares it with the application requester's password substitute. If equal, the user is authenticated. The SECTKN parameter is used to flow the client and server encryption seeds on the ACCSEC and ACCSECRD commands. More information in DRDA, V3, Volume 3 standard - PWDSSB (page 650)- Throws:
SqlException
-
flowServerAttributes
private void flowServerAttributes() throws SqlException- Throws:
SqlException
-
flowKeyExchange
private void flowKeyExchange(int securityMechanism, byte[] publicKey) throws SqlException- Throws:
SqlException
-
flowSeedExchange
private void flowSeedExchange(int securityMechanism, byte[] sourceSeed) throws SqlException- Throws:
SqlException
-
flowServerAttributesAndKeyExchange
private void flowServerAttributesAndKeyExchange(int securityMechanism, byte[] publicKey) throws SqlException- Throws:
SqlException
-
flowSecurityCheckAndAccessRdb
private void flowSecurityCheckAndAccessRdb(int securityMechanism, java.lang.String user, java.lang.String password, byte[] encryptedUserid, byte[] encryptedPassword) throws SqlException- Throws:
SqlException
-
writeAllConnectCommandsChained
private void writeAllConnectCommandsChained(int securityMechanism, java.lang.String user, java.lang.String password) throws SqlException- Throws:
SqlException
-
readAllConnectCommandsChained
private void readAllConnectCommandsChained(int securityMechanism) throws SqlException- Throws:
SqlException
-
writeServerAttributesAndKeyExchange
private void writeServerAttributesAndKeyExchange(int securityMechanism, byte[] publicKey) throws SqlException- Throws:
SqlException
-
readServerAttributesAndKeyExchange
private void readServerAttributesAndKeyExchange(int securityMechanism) throws SqlException- Throws:
SqlException
-
writeSecurityCheckAndAccessRdb
private void writeSecurityCheckAndAccessRdb(int securityMechanism, java.lang.String user, java.lang.String password, byte[] encryptedUserid, byte[] encryptedPassword) throws SqlException- Throws:
SqlException
-
readSecurityCheckAndAccessRdb
private void readSecurityCheckAndAccessRdb() throws SqlException- Throws:
SqlException
-
writeDeferredReset
void writeDeferredReset() throws SqlException- Throws:
SqlException
-
readDeferredReset
void readDeferredReset() throws SqlException- Throws:
SqlException
-
setServerAttributeData
void setServerAttributeData(java.lang.String srvclsnm, java.lang.String srvrlslv)
-
setAccessSecurityData
void setAccessSecurityData(int secchkcd, int desiredSecmec, int[] secmecList, boolean sectknReceived, byte[] sectkn) throws DisconnectException- Throws:
DisconnectException
-
securityCheckComplete
void securityCheckComplete(int svrcod, int secchkcd)
-
rdbAccessed
void rdbAccessed(int svrcod, java.lang.String prdid, boolean crrtknReceived, byte[] crrtkn)
-
newAgent_
protected Agent newAgent_(LogWriter logWriter, int loginTimeout, java.lang.String serverName, int portNumber, int clientSSLMode) throws SqlException
- Specified by:
newAgent_in classClientConnection- Throws:
SqlException
-
newStatement_
protected ClientStatement newStatement_(int type, int concurrency, int holdability) throws SqlException
- Specified by:
newStatement_in classClientConnection- Throws:
SqlException
-
resetStatement_
protected void resetStatement_(ClientStatement statement, int type, int concurrency, int holdability) throws SqlException
- Specified by:
resetStatement_in classClientConnection- Throws:
SqlException
-
newPositionedUpdatePreparedStatement_
protected ClientPreparedStatement newPositionedUpdatePreparedStatement_(java.lang.String sql, Section section) throws SqlException
- Specified by:
newPositionedUpdatePreparedStatement_in classClientConnection- Throws:
SqlException
-
newPreparedStatement_
protected ClientPreparedStatement newPreparedStatement_(java.lang.String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
- Specified by:
newPreparedStatement_in classClientConnection- Throws:
SqlException
-
resetPreparedStatement_
protected void resetPreparedStatement_(ClientPreparedStatement ps, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, int autoGeneratedKeys, java.lang.String[] columnNames, int[] columnIndexes) throws SqlException
- Specified by:
resetPreparedStatement_in classClientConnection- Throws:
SqlException
-
newCallableStatement_
protected ClientCallableStatement newCallableStatement_(java.lang.String sql, int type, int concurrency, int holdability) throws SqlException
- Specified by:
newCallableStatement_in classClientConnection- Throws:
SqlException
-
resetCallableStatement_
protected void resetCallableStatement_(ClientCallableStatement cs, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SqlException
- Specified by:
resetCallableStatement_in classClientConnection- Throws:
SqlException
-
newDatabaseMetaData_
protected ClientDatabaseMetaData newDatabaseMetaData_()
- Specified by:
newDatabaseMetaData_in classClientConnection
-
checkDatabaseName
private void checkDatabaseName() throws SqlException- Throws:
SqlException
-
checkUserLength
private void checkUserLength(java.lang.String user) throws SqlException- Throws:
SqlException
-
checkPasswordLength
private void checkPasswordLength(java.lang.String password) throws SqlException- Throws:
SqlException
-
checkUser
private void checkUser(java.lang.String user) throws SqlException- Throws:
SqlException
-
checkUserPassword
private void checkUserPassword(java.lang.String user, java.lang.String password) throws SqlException- Throws:
SqlException
-
checkSecmgrForSecmecSupport
private void checkSecmgrForSecmecSupport(int securityMechanism) throws SqlException- Throws:
SqlException
-
mapSecchkcd
private SqlException mapSecchkcd(int secchkcd)
-
constructCrrtkn
protected void constructCrrtkn() throws SqlException- Throws:
SqlException
-
constructExtnam
private void constructExtnam() throws SqlException- Throws:
SqlException
-
constructPrddta
private void constructPrddta() throws SqlException- Throws:
SqlException
-
initializePublicKeyForEncryption
private void initializePublicKeyForEncryption() throws SqlException- Throws:
SqlException
-
initializeClientSeed
private void initializeClientSeed() throws SqlException- Throws:
SqlException
-
encryptedPasswordForUSRENCPWD
private byte[] encryptedPasswordForUSRENCPWD(java.lang.String password) throws SqlException- Throws:
SqlException
-
encryptedUseridForEUSRIDPWD
private byte[] encryptedUseridForEUSRIDPWD() throws SqlException- Throws:
SqlException
-
encryptedPasswordForEUSRIDPWD
private byte[] encryptedPasswordForEUSRIDPWD(java.lang.String password) throws SqlException- Throws:
SqlException
-
passwordSubstituteForUSRSSBPWD
private byte[] passwordSubstituteForUSRSSBPWD(java.lang.String password) throws SqlException- Throws:
SqlException
-
getSQLAM
public int getSQLAM()
-
getAGENT
public int getAGENT()
-
getCMNTCPIP
public int getCMNTCPIP()
-
getRDB
public int getRDB()
-
getSECMGR
public int getSECMGR()
-
getXAMGR
public int getXAMGR()
-
getSYNCPTMGR
public int getSYNCPTMGR()
-
getRSYNCMGR
public int getRSYNCMGR()
-
flipBits
private char[] flipBits(char[] array)
-
writeCommitSubstitute_
public void writeCommitSubstitute_() throws SqlException- Specified by:
writeCommitSubstitute_in classClientConnection- Throws:
SqlException
-
readCommitSubstitute_
public void readCommitSubstitute_() throws SqlException- Specified by:
readCommitSubstitute_in classClientConnection- Throws:
SqlException
-
writeLocalXAStart_
public void writeLocalXAStart_() throws SqlException- Specified by:
writeLocalXAStart_in classClientConnection- Throws:
SqlException
-
readLocalXAStart_
public void readLocalXAStart_() throws SqlException- Specified by:
readLocalXAStart_in classClientConnection- Throws:
SqlException
-
writeLocalXACommit_
public void writeLocalXACommit_() throws SqlException- Specified by:
writeLocalXACommit_in classClientConnection- Throws:
SqlException
-
readLocalXACommit_
public void readLocalXACommit_() throws SqlException- Specified by:
readLocalXACommit_in classClientConnection- Throws:
SqlException
-
writeLocalXARollback_
public void writeLocalXARollback_() throws SqlException- Specified by:
writeLocalXARollback_in classClientConnection- Throws:
SqlException
-
readLocalXARollback_
public void readLocalXARollback_() throws SqlException- Specified by:
readLocalXARollback_in classClientConnection- Throws:
SqlException
-
writeLocalCommit_
public void writeLocalCommit_() throws SqlException- Specified by:
writeLocalCommit_in classClientConnection- Throws:
SqlException
-
readLocalCommit_
public void readLocalCommit_() throws SqlException- Specified by:
readLocalCommit_in classClientConnection- Throws:
SqlException
-
writeLocalRollback_
public void writeLocalRollback_() throws SqlException- Specified by:
writeLocalRollback_in classClientConnection- Throws:
SqlException
-
readLocalRollback_
public void readLocalRollback_() throws SqlException- Specified by:
readLocalRollback_in classClientConnection- Throws:
SqlException
-
markClosed_
protected void markClosed_()
- Specified by:
markClosed_in classClientConnection
-
isGlobalPending_
protected boolean isGlobalPending_()
- Specified by:
isGlobalPending_in classClientConnection
-
doCloseStatementsOnClose_
protected boolean doCloseStatementsOnClose_()
- Specified by:
doCloseStatementsOnClose_in classClientConnection
-
allowCloseInUOW_
protected boolean allowCloseInUOW_()
Check if the connection can be closed when there are uncommitted operations.- Specified by:
allowCloseInUOW_in classClientConnection- Returns:
- if this connection can be closed when it has uncommitted
operations,
true; otherwise,false
-
allowLocalCommitRollback_
protected boolean allowLocalCommitRollback_()
- Specified by:
allowLocalCommitRollback_in classClientConnection
-
setInputStream
public void setInputStream(java.io.InputStream inputStream)
-
setOutputStream
public void setOutputStream(java.io.OutputStream outputStream)
-
getInputStream
public java.io.InputStream getInputStream()
-
getOutputStream
public java.io.OutputStream getOutputStream()
-
writeTransactionStart
public void writeTransactionStart(ClientStatement statement) throws SqlException
- Overrides:
writeTransactionStartin classClientConnection- Throws:
SqlException
-
readTransactionStart
public void readTransactionStart() throws SqlException- Overrides:
readTransactionStartin classClientConnection- Throws:
SqlException
-
setIndoubtTransactions
public void setIndoubtTransactions(java.util.List<javax.transaction.xa.Xid> indoubtTransactions)
-
getIndoubtTransactionIds
javax.transaction.xa.Xid[] getIndoubtTransactionIds()
-
newSectionManager
public SectionManager newSectionManager(Agent agent)
- Specified by:
newSectionManagerin classClientConnection
-
willAutoCommitGenerateFlow
public boolean willAutoCommitGenerateFlow()
- Overrides:
willAutoCommitGenerateFlowin classClientConnection
-
getSecurityMechanism
public int getSecurityMechanism()
-
getEncryptionManager
public EncryptionManager getEncryptionManager()
-
getTargetPublicKey
public byte[] getTargetPublicKey()
-
getProductID
public java.lang.String getProductID()
-
isConnectionNull
public final boolean isConnectionNull()
- Returns:
- Returns the connectionNull.
-
setConnectionNull
public void setConnectionNull(boolean connectionNull)
- Parameters:
connectionNull- The connectionNull to set.
-
serverSupportsQryclsimp
final boolean serverSupportsQryclsimp()
Check whether the server has full support for the QRYCLSIMP parameter in OPNQRY.- Returns:
- true if QRYCLSIMP is fully supported
-
serverSupportsLayerBStreaming
public final boolean serverSupportsLayerBStreaming()
-
serverSupportLongRDBNAM
public final boolean serverSupportLongRDBNAM()
-
supportsSessionDataCaching
protected final boolean supportsSessionDataCaching()
Check whether the server supports session data caching- Specified by:
supportsSessionDataCachingin classClientConnection- Returns:
- true session data caching is supported
-
serverSupportsUtf8Ccsid
protected final boolean serverSupportsUtf8Ccsid()
Check whether the server supports the UTF-8 Ccsid Manager- Returns:
- true if the server supports the UTF-8 Ccsid Manager
-
serverSupportsUDTs
protected final boolean serverSupportsUDTs()
Check whether the server supports UDTs- Returns:
- true if UDTs are supported
-
serverSupportsEXTDTAAbort
protected final boolean serverSupportsEXTDTAAbort()
-
serverSupportsLocators
protected final boolean serverSupportsLocators()
Checks whether the server supports locators for large objects.- Specified by:
serverSupportsLocatorsin classClientConnection- Returns:
trueif LOB locators are supported.
-
serverSupportsTimestampNanoseconds
protected final boolean serverSupportsTimestampNanoseconds()
Return true if the server supports nanoseconds in timestamps- Specified by:
serverSupportsTimestampNanosecondsin classClientConnection
-
isOpen
public boolean isOpen()
Returns if a transaction is in process- Returns:
- open
-
writeXACommit_
protected void writeXACommit_() throws SqlExceptionInvokes write commit on NetXAConnection- Specified by:
writeXACommit_in classClientConnection- Throws:
SqlException
-
readXACommit_
protected void readXACommit_() throws SqlExceptionInvokes readCommit on NetXAConnection- Specified by:
readXACommit_in classClientConnection- Throws:
SqlException
-
writeXARollback_
protected void writeXARollback_() throws SqlExceptionInvokes writeRollback on NetXAConnection- Specified by:
writeXARollback_in classClientConnection- Throws:
SqlException
-
readXARollback_
protected void readXARollback_() throws SqlExceptionInvokes writeRollback on NetXAConnection- Specified by:
readXARollback_in classClientConnection- Throws:
SqlException
-
writeXATransactionStart
protected void writeXATransactionStart(ClientStatement statement) throws SqlException
- Specified by:
writeXATransactionStartin classClientConnection- Throws:
SqlException
-
createArrayOf
public java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
createNClob
public java.sql.NClob createNClob() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
createSQLXML
public java.sql.SQLXML createSQLXML() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
createStruct
public java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
isValid
public boolean isValid(int timeout) throws java.sql.SQLExceptionChecks if the connection has not been closed and is still valid. The validity is checked by running a simple query against the database. The timeout specified by the caller is implemented as follows: On the server: uses the queryTimeout functionality to make the query time out on the server in case the server has problems or is highly loaded. On the client: uses a timeout on the socket to make sure that the client is not blocked forever in the cases where the server is "hanging" or not sending the reply.- Parameters:
timeout- 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.- Returns:
- true if the connection is valid, false otherwise
- Throws:
java.sql.SQLException- if the parameter value is illegal or if a database error has occurred
-
close
public void close() throws java.sql.SQLExceptionClose the connection and release its resources.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.sql.Connection- Overrides:
closein classClientConnection- Throws:
java.sql.SQLException- if a database-access error occurs.
-
setClientInfo
public void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoExceptionsetClientInfowill always throw aSQLClientInfoExceptionsince Derby does not support any properties.- Parameters:
name- a property keyStringvalue- a property valueString- Throws:
java.sql.SQLClientInfoException- always.
-
setClientInfo
public void setClientInfo(java.util.Properties properties) throws java.sql.SQLClientInfoExceptionsetClientInfowill throw aSQLClientInfoExceptionunless thepropertiesparameter is empty, since Derby does not support any properties. All the property keys in thepropertiesparameter are added to failedProperties of the exception thrown, with REASON_UNKNOWN_PROPERTY as the value.- Parameters:
properties- aPropertiesobject with the properties to set.- Throws:
java.sql.SQLClientInfoException- unless the properties parameter is null or empty.
-
getClientInfo
public java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLExceptiongetClientInfoalways returns anull Stringsince Derby doesn't support ClientInfoProperties.- Parameters:
name- aStringvalue- Returns:
- a
null Stringvalue - Throws:
java.sql.SQLException- if the connection is closed.
-
getClientInfo
public java.util.Properties getClientInfo() throws java.sql.SQLExceptiongetClientInfoalways returns an emptyPropertiesobject since Derby doesn't support ClientInfoProperties.- Returns:
- an empty
Propertiesobject. - Throws:
java.sql.SQLException- if the connection is closed.
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> interfaces) throws java.sql.SQLExceptionReturns false unlessinterfacesis implemented- Parameters:
interfaces- a Class defining an interface.- Returns:
- true if this implements the interface or directly or indirectly wraps an object that does.
- Throws:
java.sql.SQLException- if an error occurs while determining whether this is a wrapper for an object with the given interface.
-
unwrap
public <T> T unwrap(java.lang.Class<T> interfaces) throws java.sql.SQLExceptionReturnsthisif this class implements the interface- Parameters:
interfaces- a Class defining an interface- Returns:
- an object that implements the interface
- Throws:
java.sql.SQLException- if no object if found that implements the interface
-
-