|
Enhydra 3.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines a database connection.
Method Summary | |
void |
allocate()
Method called when this connection object is allocated from the connection allocator. |
void |
close()
Close this connection. |
void |
commit()
Commit a transaction. |
boolean |
execute(java.lang.String sql)
Execute a SQL statement that does not return a resultset. |
java.sql.ResultSet |
executeQuery(java.sql.PreparedStatement preparedStmt,
java.lang.String msg)
Execute a prepared query statement. |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute a SQL query statement. |
int |
executeUpdate(java.sql.PreparedStatement preparedStmt,
java.lang.String msg)
Execute a prepared update statement. |
int |
executeUpdate(java.lang.String sql)
Execute a SQL update statement. |
java.sql.Connection |
getConnection()
Get the underlying Connection object. |
int |
getGeneration()
Get the generation number specified when the connection was created. |
java.lang.String |
getUrl()
Get the database URL. |
java.lang.String |
getUser()
Get the database user name. |
boolean |
handleException(java.sql.SQLException sqlExcept)
Check if a connection is valid after an SQL exception is thrown. |
void |
incrRequestCount()
Increment the count of the number of requests against this connection. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Creates a CallableStatement object for calling database stored procedures. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Get a prepared statement given an SQL string. |
void |
release()
Return this connection to its allocator. |
void |
reset()
Closes down all query-specific resources. |
void |
rollback()
Rollback a transaction. |
void |
setAutoCommit(boolean on)
Autocommit on/off. |
void |
validate()
Validates this connection. |
void |
warningCheck(java.sql.ResultSet resultSet)
Check for warnings in a result set. |
Method Detail |
public void validate() throws java.sql.SQLException
public void reset() throws java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL statement to prepared.public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL statement to be called.public java.sql.ResultSet executeQuery(java.sql.PreparedStatement preparedStmt, java.lang.String msg) throws java.sql.SQLException
reset()
should be called.preparedStmt
- The statement to execute.msg
- for logging/debug purposespublic java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
reset()
should be called.sql
- The SQL query statementpublic int executeUpdate(java.lang.String sql) throws java.sql.SQLException
reset()
should be called.sql
- The SQL query statementpublic int executeUpdate(java.sql.PreparedStatement preparedStmt, java.lang.String msg) throws java.sql.SQLException
reset()
should be called.preparedStmt
- The statement to execute.msg
- for logging/debug purposespublic boolean execute(java.lang.String sql) throws java.sql.SQLException
reset()
should be called.sql
- The SQL query statementpublic void warningCheck(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- The result set to check for warnings.public void release()
public boolean handleException(java.sql.SQLException sqlExcept)
sqlExcept
- the SQL exception that occured.public void commit() throws java.sql.SQLException
public void setAutoCommit(boolean on) throws java.sql.SQLException
on
- false to disable auto commit mode. True to enable.public void rollback() throws java.sql.SQLException
public void allocate() throws java.sql.SQLException
reset
had no been called on the previous operation.public void close()
public int getGeneration()
public void incrRequestCount()
public java.lang.String getUrl()
public java.lang.String getUser()
public java.sql.Connection getConnection()
Connection
object.
Use with extreme caution.
|
Enhydra 3.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |