Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.appserver.server.sql
Interface DBConnection  view DBConnection download DBConnection.java


public interface DBConnection

This interface defines a database connection.

Since:
LBS1.8
Version:
$Revision: 1.18.12.1 $

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

validate

public void validate()
              throws java.sql.SQLException
Validates this connection. Check to see that it is not closed and has been properly allocated.


reset

public void reset()
           throws java.sql.SQLException
Closes down all query-specific resources.


prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
Get a prepared statement given an SQL string. If the statement is cached, return that statement, otherwise prepare and save in the cache.


prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException
Creates a CallableStatement object for calling database stored procedures. Refer to jdk api refernece.


executeQuery

public java.sql.ResultSet executeQuery(java.sql.PreparedStatement preparedStmt,
                                       java.lang.String msg)
                                throws java.sql.SQLException
Execute a prepared query statement. Once the query has completed, reset() should be called.


executeQuery

public java.sql.ResultSet executeQuery(java.lang.String sql)
                                throws java.sql.SQLException
Execute a SQL query statement. This is a wrapper that adds logging. Once the query has completed, reset() should be called.


executeUpdate

public int executeUpdate(java.lang.String sql)
                  throws java.sql.SQLException
Execute a SQL update statement. This is a wrapper that adds logging. Once the update has completed, reset() should be called.


executeUpdate

public int executeUpdate(java.sql.PreparedStatement preparedStmt,
                         java.lang.String msg)
                  throws java.sql.SQLException
Execute a prepared update statement. Once the update has completed, reset() should be called.


execute

public boolean execute(java.lang.String sql)
                throws java.sql.SQLException
Execute a SQL statement that does not return a resultset. This is a wrapper that adds logging. Once the query has completed, reset() should be called.


warningCheck

public void warningCheck(java.sql.ResultSet resultSet)
                  throws java.sql.SQLException
Check for warnings in a result set.


release

public void release()
Return this connection to its allocator. This object should not be used after calling this function.


handleException

public boolean handleException(java.sql.SQLException sqlExcept)
Check if a connection is valid after an SQL exception is thrown. If it is not usable, then the connection is dropped from the connection allocator and closed. The connection is then no longer usable.


commit

public void commit()
            throws java.sql.SQLException
Commit a transaction.


setAutoCommit

public void setAutoCommit(boolean on)
                   throws java.sql.SQLException
Autocommit on/off.


rollback

public void rollback()
              throws java.sql.SQLException
Rollback a transaction. Should only be used when auto-commit mode has been disabled.


allocate

public void allocate()
              throws java.sql.SQLException
Method called when this connection object is allocated from the connection allocator.


close

public void close()
Close this connection. Use by the connection allocator when this object is no longer used. Errors are ignored.


getGeneration

public int getGeneration()
Get the generation number specified when the connection was created.


incrRequestCount

public void incrRequestCount()
Increment the count of the number of requests against this connection.


getUrl

public java.lang.String getUrl()
Get the database URL.


getUser

public java.lang.String getUser()
Get the database user name. Normally user for error messages.


getConnection

public java.sql.Connection getConnection()
Get the underlying Connection object. Use with extreme caution.