org.apache.derby.client.am
Class LogicalConnection40

java.lang.Object
  extended by org.apache.derby.client.am.LogicalConnection
      extended by org.apache.derby.client.am.LogicalConnection40
All Implemented Interfaces:
java.sql.Connection, java.sql.Wrapper
Direct Known Subclasses:
CachingLogicalConnection40

public class LogicalConnection40
extends LogicalConnection

A simple delegation wrapper handle for a physical connection. This class only contains JDBC 4.0 specific methods. NOTE: All non-implemented JDBC 4.0 methods are located here, but when they are implemented, they should be moved to the superclass if possible.


Field Summary
 
Fields inherited from class org.apache.derby.client.am.LogicalConnection
physicalConnection_
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
LogicalConnection40(Connection physicalConnection, ClientPooledConnection pooledConnection)
           
 
Method Summary
 java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements)
           
 java.sql.Blob createBlob()
           
 java.sql.Clob createClob()
           
 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 forwards to physicalConnection_.
 java.lang.String getClientInfo(java.lang.String name)
          getClientInfo forwards to physicalConnection_.
 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)
           
protected  LogicalDatabaseMetaData newLogicalDatabaseMetaData()
          Returns a newly created logical database metadata object.
 void setClientInfo(java.util.Properties properties)
          setClientInfo forwards to physicalConnection_.
 void setClientInfo(java.lang.String name, java.lang.String value)
          setClientInfo forwards to physicalConnection_.
<T> T
unwrap(java.lang.Class<T> interfaces)
           
 
Methods inherited from class org.apache.derby.client.am.LogicalConnection
checkForNullPhysicalConnection, clearWarnings, close, closeWithoutRecyclingToPool, commit, createStatement, createStatement, createStatement, finalize, getAutoCommit, getCatalog, getHoldability, getMetaData, getRealMetaDataObject, getServerVersion, getTransactionIsolation, getWarnings, isClosed, isReadOnly, nativeSQL, notifyException, nullPhysicalConnection, prepareCall, prepareCall, prepareCall, preparePositionedUpdateStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicalConnection40

public LogicalConnection40(Connection physicalConnection,
                           ClientPooledConnection pooledConnection)
                    throws SqlException
Throws:
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

createBlob

public java.sql.Blob createBlob()
                         throws java.sql.SQLException
Throws:
java.sql.SQLException

createClob

public java.sql.Clob createClob()
                         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

getClientInfo

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

Returns:
an empty Properties object
Throws:
java.sql.SQLException - if an error occurs

getClientInfo

public java.lang.String getClientInfo(java.lang.String name)
                               throws java.sql.SQLException
getClientInfo forwards to physicalConnection_. Always returns a null String since Derby does not support ClientInfoProperties.

Parameters:
name - a property key to get String
Returns:
a property value String
Throws:
java.sql.SQLException - if an error occurs

newLogicalDatabaseMetaData

protected LogicalDatabaseMetaData newLogicalDatabaseMetaData()
                                                      throws java.sql.SQLException
Returns a newly created logical database metadata object.

Overrides:
newLogicalDatabaseMetaData in class LogicalConnection
Returns:
A logical database metadata object for JDBC 4 environments.
Throws:
java.sql.SQLException

getTypeMap

public 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 LogicalConnection
Returns:
type map for this connection
Throws:
java.sql.SQLException - if a database access error occurs

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 running a simple query against the database.

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 call on the physical connection throws an exception.

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> interfaces)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

setClientInfo

public void setClientInfo(java.util.Properties properties)
                   throws java.sql.SQLClientInfoException
setClientInfo forwards to physicalConnection_.

Parameters:
properties - a Properties object with the properties to set
Throws:
java.sql.SQLClientInfoException - if an error occurs

setClientInfo

public void setClientInfo(java.lang.String name,
                          java.lang.String value)
                   throws java.sql.SQLClientInfoException
setClientInfo forwards to physicalConnection_.

Parameters:
name - a property key String
value - a property value String
Throws:
java.sql.SQLException - if an error occurs
java.sql.SQLClientInfoException

unwrap

public <T> T unwrap(java.lang.Class<T> interfaces)
         throws java.sql.SQLException
Throws:
java.sql.SQLException

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

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