DODS 7.6 API

com.lutris.appserver.server.sql.pscache
Class PreparedStatementCache

java.lang.Object
  extended by com.lutris.appserver.server.sql.pscache.PreparedStatementCache

public class PreparedStatementCache
extends java.lang.Object


Constructor Summary
PreparedStatementCache(ExtendedDBConnection conn, int maxPSCount)
           
 
Method Summary
 void clean()
           
 void close()
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, boolean autogenerate)
           
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int iResultSetType, int iResultSetConcurrency)
          Get a prepared statement given an SQL string.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int iResultSetType, int iResultSetConcurrency, boolean tuned, boolean autogenerated)
           
 void releaseStatement(CachedPreparedStatement psForRelease)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreparedStatementCache

public PreparedStatementCache(ExtendedDBConnection conn,
                              int maxPSCount)
Method Detail

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int iResultSetType,
                                                   int iResultSetConcurrency)
                                            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.

Parameters:
sql - The SQL statement to prepared.
iResultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE.
iResultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE.
Returns:
The prepared statement, which is associated only with this extendedConnection and must not be used once the extendedConnection is released.
Throws:
java.sql.SQLException - If a SQL error occured compiling the statement.

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   boolean autogenerate)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int iResultSetType,
                                                   int iResultSetConcurrency,
                                                   boolean tuned,
                                                   boolean autogenerated)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException

releaseStatement

public void releaseStatement(CachedPreparedStatement psForRelease)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()

clean

public void clean()

DODS 7.6 API