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 inherited from class org.apache.derby.client.am.ClientConnection
agent_, autoCommit_, commBufferSize_, databaseMetaData_, databaseName_, dataSource_, portNumber_, productID_, resetConnectionAtFirstSql_, serverNameIP_, XA_T0_NOT_ASSOCIATED, XA_T1_ASSOCIATED, xaHostVersion_
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Close the connection and release its resources.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)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()EncryptionManagergetEncryptionManager()java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()java.lang.StringgetProductID()intgetRDB()intgetRSYNCMGR()intgetSECMGR()intgetSecurityMechanism()intgetSQLAM()intgetSYNCPTMGR()byte[]getTargetPublicKey()intgetXAMGR()booleanisConnectionNull()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 implementedSectionManagernewSectionManager(Agent agent)voidreadCommitSubstitute_()voidreadLocalCommit_()voidreadLocalRollback_()voidreadLocalXACommit_()voidreadLocalXARollback_()voidreadLocalXAStart_()voidreadTransactionStart()booleanserverSupportLongRDBNAM()booleanserverSupportsLayerBStreaming()voidsetClientInfo(java.util.Properties properties)setClientInfowill throw aSQLClientInfoExceptionunless thepropertiesparameter is empty, since Derby does not support any properties.voidsetClientInfo(java.lang.String name, java.lang.String value)setClientInfowill always throw aSQLClientInfoExceptionsince Derby does not support any properties.voidsetConnectionNull(boolean connectionNull)voidsetIndoubtTransactions(java.util.List<javax.transaction.xa.Xid> indoubtTransactions)voidsetInputStream(java.io.InputStream inputStream)voidsetOutputStream(java.io.OutputStream outputStream)<T> Tunwrap(java.lang.Class<T> interfaces)Returnsthisif this class implements the interfacebooleanwillAutoCommitGenerateFlow()voidwriteCommitSubstitute_()voidwriteLocalCommit_()voidwriteLocalRollback_()voidwriteLocalXACommit_()voidwriteLocalXARollback_()voidwriteLocalXAStart_()voidwriteTransactionStart(ClientStatement statement)-
Methods inherited from class org.apache.derby.client.am.ClientConnection
abort, clearWarnings, closeResources, commit, completeAbnormalUnitOfWork, completeAbnormalUnitOfWork, completeChainBreakingDisconnect, completeConnect, completeInitialPiggyBackIsolation, completeInitialPiggyBackSchema, completeLocalCommit, completeLocalRollback, completePiggyBackIsolation, completePiggyBackSchema, completeSqlca, createBlob, createClob, createStatement, createStatement, createStatement, flowAutoCommit, 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, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, setXAState, transactionInProgress
-
-
-
-
Method Detail
-
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()
-
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
-
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)
-
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.
-
serverSupportsLayerBStreaming
public final boolean serverSupportsLayerBStreaming()
-
serverSupportLongRDBNAM
public final boolean serverSupportLongRDBNAM()
-
isOpen
public boolean isOpen()
Returns if a transaction is in process- Returns:
- open
-
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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG