|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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. |
boolean |
isMarkedForDrop()
|
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
java.sql.SQLException
- If it is not valid.public void reset() throws java.sql.SQLException
java.sql.SQLException
- If a database error occurs.public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL statement to prepared.
java.sql.SQLException
- If a SQL error occured compiling the
statement.public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
sql
- The SQL statement to be called.
java.sql.SQLException
- If a database access error occurs
statement.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 purposes
java.sql.SQLException
- If a SQL error occured executing the
statement.public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLException
reset()
should be called.
sql
- The SQL query statement
java.sql.SQLException
- If a SQL error occured executing the
statement.public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
reset()
should be called.
sql
- The SQL query statement
java.sql.SQLException
- If a SQL error occured executing the update.public 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 purposes
java.sql.SQLException
- If a SQL error occured executing the
statement.public boolean execute(java.lang.String sql) throws java.sql.SQLException
reset()
should be called.
sql
- The SQL query statement
java.sql.SQLException
- If a SQL error occured executing the
statement.public void warningCheck(java.sql.ResultSet resultSet) throws java.sql.SQLException
resultSet
- The result set to check for warnings.
java.sql.SQLException
- If a SQL error occured compiling the
statement.public void release()
public boolean handleException(java.sql.SQLException sqlExcept)
sqlExcept
- the SQL exception that occured.
public void commit() throws java.sql.SQLException
java.sql.SQLException
- If a database access error occurs.public void setAutoCommit(boolean on) throws java.sql.SQLException
on
- false to disable auto commit mode. True to enable.
java.sql.SQLException
- if a database access error occurs.public void rollback() throws java.sql.SQLException
java.sql.SQLException
- if a database access error occurs.public void allocate() throws java.sql.SQLException
java.sql.SQLException
- if 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.
public boolean isMarkedForDrop()
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |