org.apache.derby.impl.jdbc
Class EmbedConnection40

java.lang.Object
  extended by org.apache.derby.impl.jdbc.EmbedConnection
      extended by org.apache.derby.impl.jdbc.EmbedConnection40
All Implemented Interfaces:
java.sql.Connection, java.sql.Wrapper, EngineConnection, EngineConnection40

public class EmbedConnection40
extends EmbedConnection
implements EngineConnection40


Field Summary
 
Fields inherited from class org.apache.derby.impl.jdbc.EmbedConnection
autoCommit, dbMetadata, exceptionClose, memoryState, needCommit, NO_MEM, rootConnection, tr
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
EmbedConnection40(EmbedConnection inputConnection)
          Creates a new instance of EmbedConnection40
EmbedConnection40(InternalDriver driver, java.lang.String url, java.util.Properties info)
           
 
Method Summary
 void abort(java.util.concurrent.Executor executor)
           
 java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements)
           
 java.sql.NClob createNClob()
           
 java.sql.SQLXML createSQLXML()
           
 java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes)
           
 java.util.Properties getClientInfo()
          getClientInfo always returns an empty Properties object since Derby doesn't support ClientInfoProperties.
 java.lang.String getClientInfo(java.lang.String name)
          getClientInfo always returns a null String since Derby doesn't support ClientInfoProperties.
 int getNetworkTimeout()
           
 java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
          Returns the type map for this connection.
 boolean isValid(int timeout)
          Checks if the connection has not been closed and is still valid.
 boolean isWrapperFor(java.lang.Class<?> interfaces)
          Returns false unless interfaces is implemented
 void setClientInfo(java.util.Properties properties)
          setClientInfo will throw a SQLClientInfoException unless the properties parameter is empty, since Derby does not support any properties.
 void setClientInfo(java.lang.String name, java.lang.String value)
          setClientInfo will always throw a SQLClientInfoException since Derby does not support any properties.
 void setNetworkTimeout(java.util.concurrent.Executor executor, int milliseconds)
           
<T> T
unwrap(java.lang.Class<T> interfaces)
          Returns this if this class implements the interface
 
Methods inherited from class org.apache.derby.impl.jdbc.EmbedConnection
addLobFile, addLOBMapping, addLOBReference, addWarning, beginAborting, cancelRunningStatement, checkForTransactionInProgress, checkIfClosed, clearLOBMapping, clearWarnings, close, close, commit, commitIfAutoCommit, commitIfNeeded, createBlob, createClob, createStatement, createStatement, createStatement, finalize, getApplicationConnection, getAutoCommit, getCatalog, getConnectionSynchronization, getContextManager, getCurrentSchemaName, getDatabase, getDBName, getEngineType, getExceptionFactory, getHoldability, getLanguageConnection, getLOBMapping, getLocalDriver, getMetaData, getPrepareIsolation, getResultSetOrderId, getSchema, getTR, getTransactionIsolation, getWarnings, handleException, handleException, isAborting, isClosed, isInGlobalTransaction, isReadOnly, nativeSQL, needCommit, newSQLException, newSQLException, newSQLException, newSQLException, prepareCall, prepareCall, prepareCall, prepareMetaDataStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, removeLobFile, removeLOBMapping, resetFromPool, restoreContextStack, rollback, rollback, setApplicationConnection, setAutoCommit, setCatalog, setDrdaID, setHoldability, setInactive, setPrepareIsolation, setReadOnly, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMap, setupContextStack, stripSubSubProtocolPrefix, toString, transactionIsIdle, xa_commit, xa_prepare, xa_rollback
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.jdbc.EngineConnection
addWarning, clearLOBMapping, getCurrentSchemaName, getExceptionFactory, getHoldability, getLOBMapping, getPrepareIsolation, getSchema, isInGlobalTransaction, resetFromPool, setDrdaID, setPrepareIsolation, setSchema
 
Methods inherited from interface java.sql.Connection
clearWarnings, close, commit, createBlob, createClob, createStatement, createStatement, createStatement, getAutoCommit, getCatalog, getMetaData, getTransactionIsolation, getWarnings, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap
 

Constructor Detail

EmbedConnection40

public EmbedConnection40(EmbedConnection inputConnection)
Creates a new instance of EmbedConnection40


EmbedConnection40

public EmbedConnection40(InternalDriver driver,
                         java.lang.String url,
                         java.util.Properties info)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

createArrayOf

public java.sql.Array createArrayOf(java.lang.String typeName,
                                    java.lang.Object[] elements)
                             throws java.sql.SQLException
Specified by:
createArrayOf in interface java.sql.Connection
Throws:
java.sql.SQLException

createNClob

public java.sql.NClob createNClob()
                           throws java.sql.SQLException
Specified by:
createNClob in interface java.sql.Connection
Throws:
java.sql.SQLException

createSQLXML

public java.sql.SQLXML createSQLXML()
                             throws java.sql.SQLException
Specified by:
createSQLXML in interface java.sql.Connection
Throws:
java.sql.SQLException

createStruct

public java.sql.Struct createStruct(java.lang.String typeName,
                                    java.lang.Object[] attributes)
                             throws java.sql.SQLException
Specified by:
createStruct in interface java.sql.Connection
Throws:
java.sql.SQLException

isValid

public boolean isValid(int timeout)
                throws java.sql.SQLException
Checks if the connection has not been closed and is still valid. The validity is checked by checking that the connection is not closed.

Specified by:
isValid in interface java.sql.Connection
Parameters:
timeout - This should be the time in seconds to wait for the database operation used to validate the connection to complete (according to the JDBC4 JavaDoc). This is currently not supported/used.
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

setClientInfo

public void setClientInfo(java.lang.String name,
                          java.lang.String value)
                   throws java.sql.SQLClientInfoException
setClientInfo will always throw a SQLClientInfoException since Derby does not support any properties.

Specified by:
setClientInfo in interface java.sql.Connection
Parameters:
name - a property key String
value - a property value String
Throws:
java.sql.SQLClientInfoException - unless both name and value are null

setClientInfo

public void setClientInfo(java.util.Properties properties)
                   throws java.sql.SQLClientInfoException
setClientInfo will throw a SQLClientInfoException unless the properties parameter is empty, since Derby does not support any properties. All the property keys in the properties parameter are added to failedProperties of the exception thrown, with REASON_UNKNOWN_PROPERTY as the value.

Specified by:
setClientInfo in interface java.sql.Connection
Parameters:
properties - a Properties object with the properties to set
Throws:
java.sql.SQLClientInfoException - unless properties parameter is null or empty

getClientInfo

public java.lang.String getClientInfo(java.lang.String name)
                               throws java.sql.SQLException
getClientInfo always returns a null String since Derby doesn't support ClientInfoProperties.

Specified by:
getClientInfo in interface java.sql.Connection
Parameters:
name - a String value
Returns:
a null String value
Throws:
java.sql.SQLException - if the connection is closed.

getClientInfo

public java.util.Properties getClientInfo()
                                   throws java.sql.SQLException
getClientInfo always returns an empty Properties object since Derby doesn't support ClientInfoProperties.

Specified by:
getClientInfo in interface java.sql.Connection
Returns:
an empty Properties object
Throws:
java.sql.SQLException - if the connection is closed.

getTypeMap

public final java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap()
                                                                    throws java.sql.SQLException
Returns the type map for this connection.

Specified by:
getTypeMap in interface java.sql.Connection
Overrides:
getTypeMap in class EmbedConnection
Returns:
type map for this connection
Throws:
java.sql.SQLException - if a database access error occurs

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> interfaces)
                     throws java.sql.SQLException
Returns false unless interfaces is implemented

Specified by:
isWrapperFor in interface java.sql.Wrapper
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.SQLException
Returns this if this class implements the interface

Specified by:
unwrap in interface java.sql.Wrapper
Parameters:
interfaces - a Class defining an interface
Returns:
an object that implements the interface
Throws:
java.sql.SQLExption - if no object if found that implements the interface
java.sql.SQLException

abort

public void abort(java.util.concurrent.Executor executor)
           throws java.sql.SQLException
Specified by:
abort in interface EngineConnection40
Throws:
java.sql.SQLException

getNetworkTimeout

public int getNetworkTimeout()
                      throws java.sql.SQLException
Specified by:
getNetworkTimeout in interface EngineConnection40
Throws:
java.sql.SQLException

setNetworkTimeout

public void setNetworkTimeout(java.util.concurrent.Executor executor,
                              int milliseconds)
                       throws java.sql.SQLException
Specified by:
setNetworkTimeout in interface EngineConnection40
Throws:
java.sql.SQLException

Built on Wed 2013-06-12 15:21:56+0000, from revision ???

Apache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.