|
jxDBCon 0.9z | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourceforge.jxdbcon.AbstractConnection
The main class for all database connection implementations.
When subclassing, the following must be defined:
Field Summary | |
protected Properties |
info
The properties used to create the connection. |
protected Map |
typeMap
The type map. |
protected SQLWarning |
warning
The warnings. |
Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Fields inherited from interface org.sourceforge.jxdbcon.InfoKeys |
CATALOG, DESCRIPTION, DRIVER, HOST, PASSWORD, PORT, SUBDRIVER, USER |
Constructor Summary | |
protected |
AbstractConnection()
Construct the connection object. |
Method Summary | |
void |
clearWarnings()
Null the warnings. |
Object |
clone()
Clone this connection. |
void |
close()
Close the connection. |
void |
commit()
Commit work. |
Statement |
createStatement()
Create a statement. |
abstract Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Create a statement. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
resultSetHoldability parameter is ignored. |
static AbstractConnection |
duplicate(AbstractConnection conn,
String newURL,
Properties newInfo)
Duplicate a connection. |
protected void |
fillPropertyInfo(ArrayList pi,
Properties info)
Fill the given list with the DriverPropertyInfo structures recognized by the driver. |
void |
finalize()
Close the connection, if it was left open. |
boolean |
getAutoCommit()
Get the auto commit state. |
String |
getCatalog()
Get the current catalog. |
protected abstract EscapeContext |
getEscapeContext(Object paramBuf,
ConversionContext paramContext)
Create an EscapeContext. |
int |
getHoldability()
Not supported. |
Properties |
getInfo()
Get the connection information. |
int |
getTransactionIsolation()
Get the transaction isolation level. |
Map |
getTypeMap()
Get the connection's type map. |
SQLWarning |
getWarnings()
Get the warning instance. |
boolean |
isClosed()
Retrieves whether this Connection object has been closed |
boolean |
isReadOnly()
Get the read only state. |
String |
nativeSQL(String sql)
Converts the given SQL statement into the system's native SQL grammar, process JDBC escapes. |
protected void |
open(String url,
Properties info)
Open the connection. |
CallableStatement |
prepareCall(String sql)
Prepare a call. |
abstract CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
|
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
resultSetHoldability parameter is ignored. |
PreparedStatement |
prepareStatement(String sql)
Prepare a statement. |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys)
autoGeneratedKeys parameter is ignored. |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes)
columnIndexes parameter is ignored. |
abstract PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
|
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
resultSetHoldability parameter is ignored. |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
columnNames parameter is ignored. |
void |
releaseSavepoint(Savepoint savepoint)
Not supported. |
void |
rollback()
Rollback work. |
void |
rollback(Savepoint savepoint)
Not supported. |
void |
setAutoCommit(boolean autoCommit)
Set the auto commit state. |
void |
setCatalog(String catalog)
Set the current catalog. |
void |
setHoldability(int holdability)
Not supported. |
void |
setReadOnly(boolean readOnly)
Set the read only state. |
Savepoint |
setSavepoint()
Not supported. |
Savepoint |
setSavepoint(String name)
Not supported. |
void |
setTransactionIsolation(int level)
Set the transaction isolation level. |
void |
setTypeMap(Map map)
Set the connection's type map. |
protected void |
takeOver(AbstractConnection conn)
Take over the connection to the dbms created by a different instance. |
String |
toString()
Format the connection's properties into a String. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.sql.Connection |
getMetaData |
Field Detail |
protected Properties info
protected Map typeMap
getTypeMap()
protected SQLWarning warning
getWarnings()
Constructor Detail |
protected AbstractConnection()
Method Detail |
public final void clearWarnings()
clearWarnings
in interface Connection
public final Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void close() throws SQLException
close
in interface Connection
SQLException
- if an error occurspublic void commit() throws SQLException
commit
in interface Connection
SQLException
- if a database error occurspublic Statement createStatement() throws SQLException
createStatement
in interface Connection
SQLException
public abstract Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
createStatement
in interface Connection
SQLException
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement
in interface Connection
SQLException
public static AbstractConnection duplicate(AbstractConnection conn, String newURL, Properties newInfo) throws SQLException
SQLException
protected void fillPropertyInfo(ArrayList pi, Properties info)
public final void finalize() throws Throwable
finalize
in class Object
Throwable
close()
public boolean getAutoCommit()
getAutoCommit
in interface Connection
public final String getCatalog()
getCatalog
in interface Connection
protected abstract EscapeContext getEscapeContext(Object paramBuf, ConversionContext paramContext)
public int getHoldability() throws SQLException
getHoldability
in interface Connection
SQLException
- if a database error occurspublic final Properties getInfo()
public int getTransactionIsolation() throws SQLException
getTransactionIsolation
in interface Connection
SQLException
- if a database error occurspublic final Map getTypeMap()
getTypeMap
in interface Connection
public final SQLWarning getWarnings()
getWarnings
in interface Connection
public final boolean isClosed()
isClosed
in interface Connection
public boolean isReadOnly()
isReadOnly
in interface Connection
public String nativeSQL(String sql) throws SQLException
nativeSQL
in interface Connection
sql
- the sql statement
SQLException
- if a database error occursprotected void open(String url, Properties info) throws SQLException
SQLException
public CallableStatement prepareCall(String sql) throws SQLException
prepareCall
in interface Connection
SQLException
public abstract CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall
in interface Connection
SQLException
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement
in interface Connection
SQLException
public abstract PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement
in interface Connection
SQLException
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement
in interface Connection
SQLException
public void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint
in interface Connection
savepoint
- The Savepoint
SQLException
- if a database error occurspublic void rollback() throws SQLException
rollback
in interface Connection
SQLException
- if a database error occurspublic void rollback(Savepoint savepoint) throws SQLException
rollback
in interface Connection
savepoint
- The Savepoint
SQLException
- if a database error occurspublic void setAutoCommit(boolean autoCommit) throws SQLException
setAutoCommit
in interface Connection
autoCommit
- the desired auto commit mode
SQLException
- if a database error occurspublic void setCatalog(String catalog) throws SQLException
setCatalog
in interface Connection
catalog
- the new catalog
SQLException
- if a database error occurspublic void setHoldability(int holdability) throws SQLException
setHoldability
in interface Connection
holdability
- the holdability
SQLException
- if a database error occurspublic void setReadOnly(boolean readOnly) throws SQLException
setReadOnly
in interface Connection
readOnly
- the desired read only state
SQLException
- if a database error occurspublic Savepoint setSavepoint() throws SQLException
setSavepoint
in interface Connection
SQLException
- if a database error occurspublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint
in interface Connection
name
- The Savepoint's name
SQLException
- if a database error occurspublic void setTransactionIsolation(int level) throws SQLException
setTransactionIsolation
in interface Connection
level
- the desired isolation level
SQLException
- if a database error occurspublic final void setTypeMap(Map map)
setTypeMap
in interface Connection
map
- the new type mapprotected void takeOver(AbstractConnection conn) throws SQLException
SQLException
public String toString()
toString
in class Object
|
jxDBCon 0.9z | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |