oracle.toplink.sdk
Class SDKAccessor

java.lang.Object
  |
  +--oracle.toplink.sdk.SDKAccessor
All Implemented Interfaces:
oracle.toplink.internal.databaseaccess.Accessor, java.lang.Cloneable
Direct Known Subclasses:
XMLFileAccessor

public class SDKAccessor
extends java.lang.Object
implements oracle.toplink.internal.databaseaccess.Accessor

SDKAccessor is a facile implementation of the Accessor interface. The only things of real substance it does is:

Since:
TOPLink/Java 3.0
See Also:
SDKCall, SDKLogin

Constructor Summary
SDKAccessor()
          Default Constructor.
 
Method Summary
TypeMethod
 void afterJTSTransactionCommit(Session session)
          To be called after JTS transaction has committed.
 void afterJTSTransactionRollback(Session session)
          To be called after JTS transaction has rolled back.
 void beginTransaction(Session session)
          Begin a transaction on the "data store".
 void clearLocalPreallocatedSequences()
          Clear any preallocated sequences.
 java.lang.Object clone()
          Clone the accessor.
 void closeConnection()
          Close the accessor's connection.
 void commitTransaction(Session session)
          Commit the current transaction on the "data store".
 void connect(DatabaseLogin login, Session session)
          Establish a connection to the "data store".
 void decrementCallCount()
          Decrement the number of calls in progress.
 void disconnect(Session session)
          Drop the connection to the "data store".
 java.lang.Object executeCall(Call call, DatabaseRow translationRow, Session session)
          Execute the specified call with the specified parameter row.
 int getCallCount()
          Return the number of calls currently in progress.
 java.util.Vector getColumnInfo(java.lang.String catalog, java.lang.String schema, java.lang.String tableName, java.lang.String columnName, Session session)
          Return column information for the specified database objects.
 java.sql.Connection getConnection()
          Deprecated. replaced by ((oracle.toplink.internal.databaseaccess.DatabaseAccessor) accessor).getConnection() This has been deprecated as the data accessor is now generic (i.e. JDBC, XML, EIS, SDK). This method cannot be used for SDK accessors and is only implemented for backward compatibility.
 java.util.Hashtable getLocalPreallocatedSequences()
          Return a hashtable of the locally-held, pre-allocated sequence numbers, keyed by sequence name.
 java.util.Vector getLocalPreallocatedSequences(java.lang.String sequenceName)
          Return a collection of the pre-allocated sequence numbers for the specified sequence name.
 java.util.Vector getTableInfo(java.lang.String catalog, java.lang.String schema, java.lang.String tableName, java.lang.String[] types, Session session)
          Return table information for the specified database objects.
 void incrementCallCount(Session session)
          Increment the number of calls in progress.
 boolean isConnected()
          Return whether the accessor has a connection to the "data store".
 void logMessage(java.lang.String message, Session session)
           
 void reestablishConnection(Session session)
          Reconnect to the database.
 void rollbackTransaction(Session session)
          Roll back the current transaction on the "data store".
 java.lang.String toString()
          Call #toString(PrintWriter), to allow subclasses to insert additional information.
 boolean usesExternalTransactionController()
          Return whether the accessor uses an external transaction controller (e.g.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SDKAccessor

public SDKAccessor()
Default Constructor.
Method Detail

afterJTSTransactionCommit

public void afterJTSTransactionCommit(Session session)
Description copied from interface: oracle.toplink.internal.databaseaccess.Accessor
To be called after JTS transaction has committed.
Specified by:
afterJTSTransactionCommit in interface oracle.toplink.internal.databaseaccess.Accessor

afterJTSTransactionRollback

public void afterJTSTransactionRollback(Session session)
Description copied from interface: oracle.toplink.internal.databaseaccess.Accessor
To be called after JTS transaction has rolled back.
Specified by:
afterJTSTransactionRollback in interface oracle.toplink.internal.databaseaccess.Accessor

beginTransaction

public void beginTransaction(Session session)
                      throws SDKDataStoreException
Begin a transaction on the "data store".
Specified by:
beginTransaction in interface oracle.toplink.internal.databaseaccess.Accessor

clone

public java.lang.Object clone()
Clone the accessor.
Specified by:
clone in interface oracle.toplink.internal.databaseaccess.Accessor

closeConnection

public void closeConnection()
Close the accessor's connection. This is used only for external connection pooling when it is intended for the connection to be reconnected in the future.
Specified by:
closeConnection in interface oracle.toplink.internal.databaseaccess.Accessor

commitTransaction

public void commitTransaction(Session session)
                       throws SDKDataStoreException
Commit the current transaction on the "data store".
Specified by:
commitTransaction in interface oracle.toplink.internal.databaseaccess.Accessor

connect

public void connect(DatabaseLogin login,
                    Session session)
             throws SDKDataStoreException
Establish a connection to the "data store".
Specified by:
connect in interface oracle.toplink.internal.databaseaccess.Accessor

decrementCallCount

public void decrementCallCount()
Decrement the number of calls in progress. Used for external pooling.
Specified by:
decrementCallCount in interface oracle.toplink.internal.databaseaccess.Accessor

disconnect

public void disconnect(Session session)
                throws SDKDataStoreException
Drop the connection to the "data store".
Specified by:
disconnect in interface oracle.toplink.internal.databaseaccess.Accessor

executeCall

public java.lang.Object executeCall(Call call,
                                    DatabaseRow translationRow,
                                    Session session)
                             throws SDKDataStoreException
Execute the specified call with the specified parameter row.
Specified by:
executeCall in interface oracle.toplink.internal.databaseaccess.Accessor
Following copied from interface: oracle.toplink.internal.databaseaccess.Accessor
Returns:
a row, a collection of rows, a row count, or a cursor

getCallCount

public int getCallCount()
Return the number of calls currently in progress. Used for load balancing and external pooling.
Specified by:
getCallCount in interface oracle.toplink.internal.databaseaccess.Accessor

getColumnInfo

public java.util.Vector getColumnInfo(java.lang.String catalog,
                                      java.lang.String schema,
                                      java.lang.String tableName,
                                      java.lang.String columnName,
                                      Session session)
                               throws SDKDataStoreException
Return column information for the specified database objects.
Specified by:
getColumnInfo in interface oracle.toplink.internal.databaseaccess.Accessor

getConnection

public java.sql.Connection getConnection()
Deprecated. replaced by ((oracle.toplink.internal.databaseaccess.DatabaseAccessor) accessor).getConnection() This has been deprecated as the data accessor is now generic (i.e. JDBC, XML, EIS, SDK). This method cannot be used for SDK accessors and is only implemented for backward compatibility.

OBSOLETE:
Specified by:
getConnection in interface oracle.toplink.internal.databaseaccess.Accessor

getLocalPreallocatedSequences

public java.util.Hashtable getLocalPreallocatedSequences()
Return a hashtable of the locally-held, pre-allocated sequence numbers, keyed by sequence name.

getLocalPreallocatedSequences

public java.util.Vector getLocalPreallocatedSequences(java.lang.String sequenceName)
Return a collection of the pre-allocated sequence numbers for the specified sequence name. If there are none, create, cache, and return an empty collection.
Specified by:
getLocalPreallocatedSequences in interface oracle.toplink.internal.databaseaccess.Accessor

getTableInfo

public java.util.Vector getTableInfo(java.lang.String catalog,
                                     java.lang.String schema,
                                     java.lang.String tableName,
                                     java.lang.String[] types,
                                     Session session)
                              throws SDKDataStoreException
Return table information for the specified database objects.
Specified by:
getTableInfo in interface oracle.toplink.internal.databaseaccess.Accessor

incrementCallCount

public void incrementCallCount(Session session)
Increment the number of calls in progress. Used for external pooling.
Specified by:
incrementCallCount in interface oracle.toplink.internal.databaseaccess.Accessor

clearLocalPreallocatedSequences

public void clearLocalPreallocatedSequences()
Clear any preallocated sequences. This should be done whenever a sequence table is modified by something besides TOPLink.

isConnected

public boolean isConnected()
Return whether the accessor has a connection to the "data store".
Specified by:
isConnected in interface oracle.toplink.internal.databaseaccess.Accessor

logMessage

public void logMessage(java.lang.String message,
                       Session session)

reestablishConnection

public void reestablishConnection(Session session)
                           throws SDKDataStoreException
Reconnect to the database. This can be used if the connection was temporarily disconnected or if it timed out.
Specified by:
reestablishConnection in interface oracle.toplink.internal.databaseaccess.Accessor

rollbackTransaction

public void rollbackTransaction(Session session)
                         throws SDKDataStoreException
Roll back the current transaction on the "data store".
Specified by:
rollbackTransaction in interface oracle.toplink.internal.databaseaccess.Accessor

toString

public java.lang.String toString()
Call #toString(PrintWriter), to allow subclasses to insert additional information.
Overrides:
toString in class java.lang.Object

usesExternalTransactionController

public boolean usesExternalTransactionController()
Return whether the accessor uses an external transaction controller (e.g. JTS).
Specified by:
usesExternalTransactionController in interface oracle.toplink.internal.databaseaccess.Accessor