|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.pool.PoolObject
org.formaria.data.sql.ConnectionObject
public class ConnectionObject
A wrapper for a connection for use by a ConnectionManager
Copyright (c) Formaria Ltd. 2008
$Revision: 2.3 $ License: see license.txt
| Constructor Summary | |
|---|---|
ConnectionObject(java.sql.Connection conn,
PoolManager pool)
Constructs a new connection object |
|
| Method Summary | |
|---|---|
void |
close()
Return the connection to the connection manager |
void |
closePreparedStatement()
Create a prepared statement. |
void |
closeStatement()
Create a prepared statement. |
java.sql.Statement |
createStatement()
Create a statement |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Create a statement |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Create a statement |
java.sql.Connection |
getConnection()
Get a reference to the Connection. If attempting to create a statement or a PreparedStatment, please use this methods values instead of calling the connection's methods directly. |
boolean |
isClosed()
Check to see that the connection to the database is still active. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Creates a PreparedStatement object for sending parameterized SQL statements to the database. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Creates a PreparedStatement object for sending parameterized SQL statements to the database. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a PreparedStatement object for sending parameterized SQL statements to the database. |
boolean |
validate()
Check to see if a connection can be made and is still in a working state |
| Methods inherited from class org.formaria.pool.PoolObject |
|---|
expireLease, getInUse, getLastUse, lease |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionObject(java.sql.Connection conn,
PoolManager pool)
conn - a JDBC connectionpool - the pool manager| Method Detail |
|---|
public boolean isClosed()
public boolean validate()
validate in class PoolObject
public void close()
throws java.lang.Exception
close in class PoolObjectjava.lang.Exception - possible exceptions while trying to close the JDBC connection object
public java.sql.Statement createStatement()
throws java.sql.SQLException
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
java.sql.SQLException
public java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability - - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
java.sql.SQLExceptionpublic void closeStatement()
ps - the PreparedStatement to be retrived
public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
sql - - an SQL statement that may contain one or more '?' IN parameter placeholders
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
sql - - an SQL statement that may contain one or more '?' IN parameter placeholdersresultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
sql - - an SQL statement that may contain one or more '?' IN parameter placeholdersresultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability - - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
java.sql.SQLExceptionpublic void closePreparedStatement()
ps - the PreparedStatement to be retrivedpublic java.sql.Connection getConnection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||