net.sourceforge.jtds.jdbc
Class ConnectionJDBC3

java.lang.Object
  extended bynet.sourceforge.jtds.jdbc.ConnectionJDBC2
      extended bynet.sourceforge.jtds.jdbc.ConnectionJDBC3
All Implemented Interfaces:
java.sql.Connection

public class ConnectionJDBC3
extends ConnectionJDBC2

Implements JDBC 3.0 specific functionality. Separated from ConnectionJDBC2 in order to allow the same classes to run under both J2SE 1.3 (ConnectionJDBC2)and 1.4 (ConnectionJDBC3).

Version:
$Id: ConnectionJDBC3.java,v 1.15.2.2 2009-07-26 17:15:05 ickzon Exp $
Author:
Alin Sinpalean, Brian Heineman, Mike Hutchinson
Created:
March 30, 2004

Field Summary
private  int savepointId
          Counter for generating unique savepoint identifiers
private  java.util.Map savepointProcInTran
          Maps each savepoint to a list of tmep procedures created since the savepoint
private  java.util.ArrayList savepoints
          The list of savepoints.
 
Fields inherited from class net.sourceforge.jtds.jdbc.ConnectionJDBC2
TRANSACTION_SNAPSHOT
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Constructor Summary
(package private) ConnectionJDBC3(java.lang.String url, java.util.Properties props)
          Create a new database connection.
 
Method Summary
(package private)  void addCachedProcedure(java.lang.String key)
          Add a stored procedure to the savepoint cache.
(package private)  void addCachedProcedure(java.lang.String key, ProcEntry proc)
          Add a stored procedure to the cache.
(package private)  void clearSavepoints()
          Releases all savepoints.
private  int getNextSavepointId()
          Returns the next savepoint identifier.
 void releaseSavepoint(java.sql.Savepoint savepoint)
           
 void rollback(java.sql.Savepoint savepoint)
           
 java.sql.Savepoint setSavepoint()
           
private  void setSavepoint(SavepointImpl savepoint)
          Add a savepoint to the list maintained by this connection.
 java.sql.Savepoint setSavepoint(java.lang.String name)
           
 
Methods inherited from class net.sourceforge.jtds.jdbc.ConnectionJDBC2
addStatement, checkLocal, checkOpen, clearWarnings, close, commit, createStatement, createStatement, createStatement, enlistConnection, finalize, getAppName, getAutoCommit, getBatchSize, getBindAddress, getBufferDir, getBufferMaxMemory, getBufferMinPackets, getCachedTds, getCatalog, getCharset, getCharsetInfo, getCollation, getCursorName, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseName, getDatabaseProductName, getDatabaseProductVersion, getDomainName, getHoldability, getInstanceName, getLastUpdateCount, getLobBuffer, getLoginTimeout, getMacAddress, getMaxPrecision, getMaxStatements, getMetaData, getMutex, getNamedPipe, getNetPacketSize, getPacketSize, getPassword, getPortNumber, getPrepareSql, getProcessId, getProcName, getProgName, getRmHost, getRowCount, getServerName, getServerType, getSocket, getSocketKeepAlive, getSocketTimeout, getSybaseInfo, getTcpNoDelay, getTdsVersion, getTextSize, getTransactionIsolation, getTypeMap, getURL, getUseCursors, getUseJCIFS, getUseLOBs, getUseMetadataCache, getUseNTLMv2, getUser, getUseUnicode, getWarnings, getWsid, getXaState, getXid, isCharsetSpecified, isClosed, isReadOnly, isWideChar, isXaEmulation, nativeSQL, notImplemented, prepareCall, prepareCall, prepareCall, prepareSQL, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseTds, removeCachedProcedure, removeStatement, rollback, sendXaPacket, setAutoCommit, setCatalog, setClosed, setCollation, setDatabase, setDBServerInfo, setHoldability, setNetPacketSize, setReadOnly, setRowCount, setServerCharset, setSybaseInfo, setTextSize, setTransactionIsolation, setTypeMap, setXaState, setXid, unpackProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

savepoints

private java.util.ArrayList savepoints
The list of savepoints.


savepointProcInTran

private java.util.Map savepointProcInTran
Maps each savepoint to a list of tmep procedures created since the savepoint


savepointId

private int savepointId
Counter for generating unique savepoint identifiers

Constructor Detail

ConnectionJDBC3

ConnectionJDBC3(java.lang.String url,
                java.util.Properties props)
          throws java.sql.SQLException
Create a new database connection.

Parameters:
url - The connection URL starting jdbc:jtds:.
props - The additional connection properties.
Throws:
java.sql.SQLException
Method Detail

setSavepoint

private void setSavepoint(SavepointImpl savepoint)
                   throws java.sql.SQLException
Add a savepoint to the list maintained by this connection.

Parameters:
savepoint - The savepoint object to add.
Throws:
java.sql.SQLException

clearSavepoints

void clearSavepoints()
Releases all savepoints. Used internally when committing or rolling back a transaction.

Overrides:
clearSavepoints in class ConnectionJDBC2

releaseSavepoint

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

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException
Specified by:
rollback in interface java.sql.Connection
Overrides:
rollback in class ConnectionJDBC2
Throws:
java.sql.SQLException

setSavepoint

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

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String name)
                                throws java.sql.SQLException
Specified by:
setSavepoint in interface java.sql.Connection
Overrides:
setSavepoint in class ConnectionJDBC2
Throws:
java.sql.SQLException

getNextSavepointId

private int getNextSavepointId()
Returns the next savepoint identifier.

Returns:
the next savepoint identifier

addCachedProcedure

void addCachedProcedure(java.lang.String key,
                        ProcEntry proc)
Add a stored procedure to the cache.

Overrides:
addCachedProcedure in class ConnectionJDBC2
Parameters:
key - The signature of the procedure to cache.
proc - The stored procedure descriptor.

addCachedProcedure

void addCachedProcedure(java.lang.String key)
Add a stored procedure to the savepoint cache.

Parameters:
key - The signature of the procedure to cache.


Generated on October 27 2012