|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.holub.database.jdbc.adapters.ConnectionAdapter
com.holub.database.jdbc.JDBCConnection
public class JDBCConnection
A limited version of the Connection class. All methods
undocumented base-class overrides throw a
SQLException if called.
Note that you can't
mix non-autocommit behavior with explicit
SQL begin/commit statements. For example, if you
turn off autocommit mode (which causes a SQL begin
to be issued), and then execute a SQL begin manually,
a call to `commit` will commit the inner transaction,
but not the outer one. In effect, you can't do
nested transactions using the JDBC commit() or
rollback() methods.
|
This code may be used freely by yourself with the following restrictions:
|
| Field Summary |
|---|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
JDBCConnection(String uri)
|
|
JDBCConnection(URI uri)
|
|
| Method Summary | |
|---|---|
void |
close()
Close a database connection. |
void |
commit()
Terminate the current transactions and start a new one. |
Statement |
createStatement()
|
boolean |
getAutoCommit()
Return true if auto-commit mode is enabled |
void |
rollback()
Roll back the current transactions and start a new one. |
void |
setAutoCommit(boolean enable)
Once set true, all SQL statements form a stand-alone transaction. |
| Methods inherited from class com.holub.database.jdbc.adapters.ConnectionAdapter |
|---|
clearWarnings, createStatement, createStatement, getCatalog, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCConnection(String uri)
throws SQLException,
URISyntaxException,
IOException
SQLException
URISyntaxException
IOException
public JDBCConnection(URI uri)
throws SQLException,
IOException
SQLException
IOException| Method Detail |
|---|
public void close()
throws SQLException
close in interface Connectionclose in class ConnectionAdapterSQLExceptionsetAutoCommit(boolean)
public Statement createStatement()
throws SQLException
createStatement in interface ConnectioncreateStatement in class ConnectionAdapterSQLException
public void commit()
throws SQLException
commit in interface Connectioncommit in class ConnectionAdapterSQLExceptionsetAutoCommit(boolean)
public void rollback()
throws SQLException
rollback in interface Connectionrollback in class ConnectionAdapterSQLExceptionsetAutoCommit(boolean)
public void setAutoCommit(boolean enable)
throws SQLException
commit()
and rollback() methods will work correctly.
Similarly, a commit is issued automatically when
auto-commit mode is enabled.
Auto-commit mode is on by default.
setAutoCommit in interface ConnectionsetAutoCommit in class ConnectionAdapterSQLException
public boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectiongetAutoCommit in class ConnectionAdapterSQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||