net.sf.jso.sql
Class JDBCTransaction

java.lang.Object
  extended bynet.sf.jso.sql.JDBCTransaction

public class JDBCTransaction
extends java.lang.Object

Manages a transaction to a database with a JDBC java.sql.Connection object obtained through a connection pool.


Constructor Summary
JDBCTransaction()
          Constructs the transaction.
JDBCTransaction(ConnectionPool aPool)
          Constructs the transaction.
 
Method Summary
 void commit()
          Commits the transaction.
protected  void finalize()
          Frees resources before it's garbage collected.
 java.sql.Connection getConnection()
          Returns the connection used by the transaction.
 boolean isActive()
          Indicates if the transaction is active.
 void rollback()
          Rolls back the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCTransaction

public JDBCTransaction()
Constructs the transaction.


JDBCTransaction

public JDBCTransaction(ConnectionPool aPool)
                throws java.sql.SQLException
Constructs the transaction.

Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.lang.IllegalStateException
Returns the connection used by the transaction.

Returns:
The connection used by the transaction.
Throws:
java.lang.IllegalStateException

isActive

public boolean isActive()
Indicates if the transaction is active.


commit

public void commit()
            throws java.sql.SQLException
Commits the transaction.

Throws:
java.sql.SQLException

rollback

public void rollback()
              throws java.sql.SQLException
Rolls back the transaction.

Throws:
java.sql.SQLException

finalize

protected void finalize()
                 throws java.lang.Throwable
Frees resources before it's garbage collected.

Throws:
java.lang.Throwable