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.EmbedConnection30
          extended by org.apache.derby.impl.jdbc.EmbedConnection40
All Implemented Interfaces:
java.sql.Connection, java.sql.Wrapper, EngineConnection

public class EmbedConnection40
extends EmbedConnection30


Field Summary
 
Fields inherited from class org.apache.derby.impl.jdbc.EmbedConnection
autoCommit, dbMetadata, 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
 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.
 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 uless the properties paramenter 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.
<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.EmbedConnection30
releaseSavepoint, rollback, setSavepoint, setSavepoint
 
Methods inherited from class org.apache.derby.impl.jdbc.EmbedConnection
addLobFile, addLOBMapping, addLOBReference, addWarning, cancelRunningStatement, checkForTransactionInProgress, checkIfClosed, clearLOBMapping, clearWarnings, close, commit, commitIfAutoCommit, commitIfNeeded, createBlob, createClob, createStatement, createStatement, createStatement, finalize, getApplicationConnection, getAutoCommit, getCatalog, getConnectionSynchronization, getContextManager, getCurrentSchemaName, getDatabase, getDBName, getEngineType, getHoldability, getLanguageConnection, getlobHMObj, getLOBMapping, getLocalDriver, getMetaData, getPrepareIsolation, getResultSetOrderId, getTR, getTransactionIsolation, getWarnings, handleException, handleException, isClosed, isInGlobalTransaction, isReadOnly, nativeSQL, needCommit, newSQLException, newSQLException, newSQLException, prepareCall, prepareCall, prepareCall, prepareMetaDataStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, removeLobFile, removeLOBMapping, resetFromPool, restoreContextStack, rollback, setApplicationConnection, setAutoCommit, setCatalog, setDrdaID, setHoldability, setInactive, setPrepareIsolation, setReadOnly, 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
 

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
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.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.

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 occured

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.

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 uless the properties paramenter 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.

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.

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.

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

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

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

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

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