|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.cpa.persistence.sql.engine.CastorConnection
public final class CastorConnection
CastorConnection class holding connection and factory parameters to encapsulate their usage in case of creation of CastorStatements.
| Constructor Summary | |
|---|---|
CastorConnection(PersistenceFactory factory,
Connection connection)
Constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Releases this Connection object's database and JDBC resources immediately
instead of waiting for them to be automatically released. |
void |
commit()
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. |
CastorStatement |
createStatement()
Method to create new CastorStatement using local instances of Connection & PersistenceFactory. |
Connection |
getConnection()
Getter returning current _connection. |
void |
rollback()
Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. |
void |
setAutoCommit(boolean autoCommit)
Sets this connection's auto-commit mode to the given state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CastorConnection(PersistenceFactory factory,
Connection connection)
factory - Instance of PersistenceFactory to be used to create CastorStatements.connection - Instance of the connection to be used to create CastorStatements.| Method Detail |
|---|
public CastorStatement createStatement()
public Connection getConnection()
public void setAutoCommit(boolean autoCommit)
throws SQLException
commit or the method
rollback. By default, new connections are in auto-commit mode.
autoCommit - true to enable auto-commit mode; false
to disable it
SQLException - if a database access error occurs
public void commit()
throws SQLException
Connection object. This method should
be used only when auto-commit mode has been disabled.
SQLException - if a database access error occurs or this Connection
object is in auto-commit mode.
public void rollback()
throws SQLException
Connection object. This method should be used
only when auto-commit mode has been disabled.
SQLException - if a database access error occurs or this Connection
object is in auto-commit mode.
public void close()
throws SQLException
Connection object's database and JDBC resources immediately
instead of waiting for them to be automatically released.
Calling the method close on a Connection object that is already
closed is a no-op.
Note: A Connection object is automatically closed when it is garbage
collected. Certain fatal errors also close a Connection object.
SQLException - if a database access error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||