| java.lang.Object org.jamwiki.db.DatabaseConnection
DatabaseConnection | public class DatabaseConnection (Code) | | This class provides methods for retrieving database connections, executing queries,
and setting up connection pools.
|
Field Summary | |
final protected static int | SLOW_QUERY_LIMIT Any queries that take longer than this value (specified in milliseconds) will print a warning to the log. |
Method Summary | |
public static void | closeConnection(Connection conn, Statement stmt, ResultSet rs) Utility method for closing a database connection, a statement and a result set.
This method must ALWAYS be called for any connection retrieved by the
DatabaseConnection.getConnection getConnection() method, and the
connection SHOULD NOT have already been closed.
Parameters: conn - A database connection, retrieved using DatabaseConnection.getConnection(),that is to be closed. | public static void | closeConnection(Connection conn, Statement stmt) Utility method for closing a database connection and a statement. | public static void | closeConnection(Connection conn) Utility method for closing a database connection. | protected static void | closeConnectionPool() Close the connection pool, to be called for example in the case
of the Servlet being shutdown. | protected static WikiResultSet | executeQuery(String sql) | protected static WikiResultSet | executeQuery(String sql, Connection conn) | protected static void | executeUpdate(String sql) | protected static int | executeUpdate(String sql, Connection conn) | protected static Connection | getConnection() | protected static void | handleErrors(Connection conn) | protected static void | setPoolInitialized(boolean poolInitialized) | public static void | testDatabase(String driver, String url, String user, String password, boolean existence) |
SLOW_QUERY_LIMIT | final protected static int SLOW_QUERY_LIMIT(Code) | | Any queries that take longer than this value (specified in milliseconds) will print a warning to the log.
|
closeConnection | public static void closeConnection(Connection conn, Statement stmt, ResultSet rs)(Code) | | Utility method for closing a database connection, a statement and a result set.
This method must ALWAYS be called for any connection retrieved by the
DatabaseConnection.getConnection getConnection() method, and the
connection SHOULD NOT have already been closed.
Parameters: conn - A database connection, retrieved using DatabaseConnection.getConnection(),that is to be closed. This connection SHOULD NOT have been previously closed. Parameters: stmt - A statement object that is to be closed. May be null . Parameters: rs - A result set object that is to be closed. May be null . |
closeConnection | public static void closeConnection(Connection conn, Statement stmt)(Code) | | Utility method for closing a database connection and a statement. This method
must ALWAYS be called for any connection retrieved by the
DatabaseConnection.getConnection getConnection() method, and the
connection SHOULD NOT have already been closed.
Parameters: conn - A database connection, retrieved using DatabaseConnection.getConnection(),that is to be closed. This connection SHOULD NOT have been previously closed. Parameters: stmt - A statement object that is to be closed. May be null . |
closeConnection | public static void closeConnection(Connection conn)(Code) | | Utility method for closing a database connection. This method must ALWAYS be
called for any connection retrieved by the
DatabaseConnection.getConnection getConnection() method, and the
connection SHOULD NOT have already been closed.
Parameters: conn - A database connection, retrieved using DatabaseConnection.getConnection(),that is to be closed. This connection SHOULD NOT have been previously closed. |
closeConnectionPool | protected static void closeConnectionPool() throws Exception(Code) | | Close the connection pool, to be called for example in the case
of the Servlet being shutdown.
|
setPoolInitialized | protected static void setPoolInitialized(boolean poolInitialized)(Code) | | |
|
|