org.lateralnz.c3d
Class DCConnection

java.lang.Object
  extended by org.lateralnz.c3d.DCConnection
All Implemented Interfaces:
java.io.Serializable, java.sql.Connection

public class DCConnection
extends java.lang.Object
implements java.sql.Connection, java.io.Serializable

an implementation of database connection. This also implements XAResource so we can provide some necessary functionality to the simpletrans package -- some of this stuff is a bit on the hacky side (with the excuse that some of the trans api docs are less than clear, and hardly what one could call straightforward to implement). I recommend -not- using this package if you're using any other transaction manager, because it is not correctly implemented (at the moment).

See Also:
Serialized Form

Field Summary
protected  boolean blockCache
           
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
DCConnection(java.sql.Connection conn, DatabaseEngine dbengine)
           
 
Method Summary
 void clearWarnings()
           
 void close()
           
 void commit()
           
 java.sql.Statement createStatement()
           
 java.sql.Statement createStatement(int resultsetType, int resultsetConcurrency)
           
 java.sql.Statement createStatement(int resultsetType, int resultsetConcurrency, int resultsetHoldability)
           
 void finalize()
           
 boolean getAutoCommit()
           
 java.lang.String getCatalog()
           
 int getHoldability()
           
 java.sql.DatabaseMetaData getMetaData()
           
protected  java.sql.Connection getRealConnection()
           
 int getTransactionIsolation()
           
 java.util.Map getTypeMap()
           
 java.sql.SQLWarning getWarnings()
           
 boolean isClosed()
           
 boolean isReadOnly()
           
 java.lang.String nativeSQL(java.lang.String str)
           
 java.sql.CallableStatement prepareCall(java.lang.String str)
           
 java.sql.CallableStatement prepareCall(java.lang.String str, int resultsetType, int resultsetConcurrency)
           
 java.sql.CallableStatement prepareCall(java.lang.String str, int resultsetType, int resultsetConcurrency, int resultsetHoldability)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String str)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String str, int autoGeneratedKeys)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String str, int[] columnIndexes)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String str, int resultsetType, int resultsetConcurrency)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String str, int resultsetType, int resultsetConcurrency, int resultsetHoldability)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String str, java.lang.String[] columnNames)
           
 void releaseSavepoint(java.sql.Savepoint savepoint)
           
 void rollback()
           
 void rollback(java.sql.Savepoint savepoint)
          rollback to a savepoint is not supported by this connection
 void setAutoCommit(boolean param)
           
 void setCatalog(java.lang.String str)
           
 void setHoldability(int param)
           
 void setReadOnly(boolean param)
           
 java.sql.Savepoint setSavepoint()
           
 java.sql.Savepoint setSavepoint(java.lang.String str)
           
 void setTransactionIsolation(int param)
           
 void setTypeMap(java.util.Map map)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blockCache

protected boolean blockCache
Constructor Detail

DCConnection

public DCConnection(java.sql.Connection conn,
                    DatabaseEngine dbengine)
             throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getRealConnection

protected java.sql.Connection getRealConnection()

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Specified by:
clearWarnings in interface java.sql.Connection
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Specified by:
close in interface java.sql.Connection
Throws:
java.sql.SQLException

commit

public void commit()
            throws java.sql.SQLException
Specified by:
commit in interface java.sql.Connection
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultsetType,
                                          int resultsetConcurrency)
                                   throws java.sql.SQLException
Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

createStatement

public java.sql.Statement createStatement(int resultsetType,
                                          int resultsetConcurrency,
                                          int resultsetHoldability)
                                   throws java.sql.SQLException
Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

finalize

public void finalize()
              throws java.sql.SQLException
Overrides:
finalize in class java.lang.Object
Throws:
java.sql.SQLException

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException
Specified by:
getAutoCommit in interface java.sql.Connection
Throws:
java.sql.SQLException

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException
Specified by:
getCatalog in interface java.sql.Connection
Throws:
java.sql.SQLException

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
Specified by:
getHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
Specified by:
getMetaData in interface java.sql.Connection
Throws:
java.sql.SQLException

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
Specified by:
getTransactionIsolation in interface java.sql.Connection
Throws:
java.sql.SQLException

getTypeMap

public java.util.Map getTypeMap()
                         throws java.sql.SQLException
Specified by:
getTypeMap in interface java.sql.Connection
Throws:
java.sql.SQLException

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Specified by:
getWarnings in interface java.sql.Connection
Throws:
java.sql.SQLException

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Specified by:
isClosed in interface java.sql.Connection
Throws:
java.sql.SQLException

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
Specified by:
isReadOnly in interface java.sql.Connection
Throws:
java.sql.SQLException

nativeSQL

public java.lang.String nativeSQL(java.lang.String str)
                           throws java.sql.SQLException
Specified by:
nativeSQL in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String str)
                                       throws java.sql.SQLException
Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String str,
                                              int resultsetType,
                                              int resultsetConcurrency)
                                       throws java.sql.SQLException
Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String str,
                                              int resultsetType,
                                              int resultsetConcurrency,
                                              int resultsetHoldability)
                                       throws java.sql.SQLException
Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String str)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String str,
                                                   int autoGeneratedKeys)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String str,
                                                   int[] columnIndexes)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String str,
                                                   java.lang.String[] columnNames)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String str,
                                                   int resultsetType,
                                                   int resultsetConcurrency)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String str,
                                                   int resultsetType,
                                                   int resultsetConcurrency,
                                                   int resultsetHoldability)
                                            throws java.sql.SQLException
Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException
Specified by:
releaseSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException
Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException
rollback to a savepoint is not supported by this connection

Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException

setAutoCommit

public void setAutoCommit(boolean param)
                   throws java.sql.SQLException
Specified by:
setAutoCommit in interface java.sql.Connection
Throws:
java.sql.SQLException

setCatalog

public void setCatalog(java.lang.String str)
                throws java.sql.SQLException
Specified by:
setCatalog in interface java.sql.Connection
Throws:
java.sql.SQLException

setHoldability

public void setHoldability(int param)
                    throws java.sql.SQLException
Specified by:
setHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException

setReadOnly

public void setReadOnly(boolean param)
                 throws java.sql.SQLException
Specified by:
setReadOnly in interface java.sql.Connection
Throws:
java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException
Specified by:
setSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String str)
                                throws java.sql.SQLException
Specified by:
setSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException

setTransactionIsolation

public void setTransactionIsolation(int param)
                             throws java.sql.SQLException
Specified by:
setTransactionIsolation in interface java.sql.Connection
Throws:
java.sql.SQLException

setTypeMap

public void setTypeMap(java.util.Map map)
                throws java.sql.SQLException
Specified by:
setTypeMap in interface java.sql.Connection
Throws:
java.sql.SQLException