|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.JDOConnectionImpl
public final class JDOConnectionImpl
Implementation of a JDO connection for RDBMS datastores. Provides a wrapper to a java.sql.Connection in this implementation.
| Field Summary | |
|---|---|
protected static Localiser |
LOCALISER
Localisation utility for output messages |
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
JDOConnectionImpl(java.sql.Connection conn,
java.lang.Runnable onClose)
Constructor. |
|
| Method Summary | |
|---|---|
void |
assertAvailable()
Assert the JDOConnection is available |
void |
clearWarnings()
Method to clear warnings from the connection. |
void |
close()
Method to close the connection. |
void |
commit()
Method to commit the connection. |
java.sql.Statement |
createStatement()
Accessor for a statement. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Accessor for a statement. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Accessor for a statement. |
boolean |
getAutoCommit()
Accessor for the autocommit setting. |
java.lang.String |
getCatalog()
Accessor for the catalog. |
int |
getHoldability()
Access the holdability of the connection. |
java.sql.DatabaseMetaData |
getMetaData()
Accessor for the database metadata. |
java.lang.Object |
getNativeConnection()
|
int |
getTransactionIsolation()
Accessor for the transaction isolation level. |
java.util.Map |
getTypeMap()
Accessor for the type map. |
java.sql.SQLWarning |
getWarnings()
Accessor for the warnings. |
boolean |
isClosed()
Accessor for whether the connection is closed. |
boolean |
isReadOnly()
Accessor for whether the connection is read only. |
java.lang.String |
nativeSQL(java.lang.String sql)
Accessor for using native SQL. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
|
java.sql.CallableStatement |
prepareCall(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int arg1)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int[] arg1)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
java.lang.String[] arg1)
|
void |
releaseSavepoint(java.sql.Savepoint pt)
Mutator to release the savepoint. |
void |
rollback()
Method to rollback the connection. |
void |
rollback(java.sql.Savepoint pt)
Mutator to rollback the savepoint. |
void |
setAutoCommit(boolean autoCommit)
Method to set the autocommit for the connection. |
void |
setCatalog(java.lang.String catalog)
Mutator for the catalog |
void |
setHoldability(int holdability)
Method to set the holdability for the connection. |
void |
setReadOnly(boolean readOnly)
Method to set the read-only nature for the connection. |
java.sql.Savepoint |
setSavepoint()
Mutator to set the savepoint. |
java.sql.Savepoint |
setSavepoint(java.lang.String arg0)
|
void |
setTransactionIsolation(int level)
Method to set the transaction isolation for the connection. |
void |
setTypeMap(java.util.Map map)
Method to set the type map |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
| Constructor Detail |
|---|
public JDOConnectionImpl(java.sql.Connection conn,
java.lang.Runnable onClose)
conn - the connectiononClose - the Runnable operation that will be called at user call to close()| Method Detail |
|---|
public int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLException - if there is a problem
public int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLException - if there is a problem
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLException - thrown if there is a problempublic void close()
close in interface java.sql.Connectionclose in interface javax.jdo.datastore.JDOConnection
public void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLException - thrown if an error occurs.
public void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLException - thrown if an error occurs.
public boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLException - thrown if an error occurs.
public boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLException - thrown if an error occurs.
public boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLException - thrown if an error occurs.
public void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionholdability - The holdability
java.sql.SQLException - thrown if an error occurs.
public void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionlevel - The transaction isolation
java.sql.SQLException - thrown if an error occurs.
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.ConnectionautoCommit - Whether to autocommit
java.sql.SQLException - thrown if an error occurs.
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.ConnectionreadOnly - whether it is read-only
java.sql.SQLException - thrown if an error occurs.
public java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLException - Thrown if an error occurs
public void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectioncatalog - The catalog
java.sql.SQLException - Thrown if an error occurs
public java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLException - Thrown if an error occurs
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLException - Thrown if an error occurs
public java.sql.Savepoint setSavepoint()
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException - Thrown if an error occurs
public void releaseSavepoint(java.sql.Savepoint pt)
throws java.sql.SQLException
releaseSavepoint in interface java.sql.Connectionpt - The savepoint
java.sql.SQLException - Thrown if an error occurs
public void rollback(java.sql.Savepoint pt)
throws java.sql.SQLException
rollback in interface java.sql.Connectionpt - The savepoint
java.sql.SQLException - Thrown if an error occurs
public java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLException - Thrown if an error occurs
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.ConnectionresultSetType - type of resultsresultSetConcurrency - The concurrency
java.sql.SQLException - Thrown if an error occurs
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in interface java.sql.ConnectionresultSetType - type of resultsresultSetConcurrency - The concurrencyresultSetHoldability - The holdability
java.sql.SQLException - Thrown if an error occurs
public java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLException - Thrown if an error occurs
public void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionmap - The type map
java.sql.SQLException - Thrown if an error occurs
public java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionsql - The sql
java.sql.SQLException - Thrown if an error occurs
public java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException
public java.sql.CallableStatement prepareCall(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
int arg1)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
int[] arg1)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLException
public java.sql.Savepoint setSavepoint(java.lang.String arg0)
throws java.sql.SQLException
setSavepoint in interface java.sql.Connectionjava.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0,
java.lang.String[] arg1)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic void assertAvailable()
javax.jdo.JDOUserException - if the connection is no longer availablepublic java.lang.Object getNativeConnection()
getNativeConnection in interface javax.jdo.datastore.JDOConnection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||