| java.lang.Object org.apache.james.util.JDBCUtil
JDBCUtil | abstract public class JDBCUtil (Code) | | Helper class for managing common JDBC tasks.
This class is abstract to allow implementations to
take advantage of different logging capabilities/interfaces in
different parts of the code.
version: CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $ |
Method Summary | |
public void | closeJDBCConnection(Connection conn) | public void | closeJDBCResultSet(ResultSet aResultSet) | public void | closeJDBCStatement(Statement stmt) | public boolean | columnExists(DatabaseMetaData dbMetaData, String tableName, String columnName) Checks database metadata to see if a column exists in a table
Try UPPER, lower, and MixedCase, both on the table name and the column name, to see if the column is there. | public boolean | columnExistsCaseSensitive(DatabaseMetaData dbMetaData, String tableName, String columnName) Checks database metadata to see if a column exists in a table. | abstract protected void | delegatedLog(String errorString) An abstract method which child classes override to handle logging of
errors in their particular environments. | public boolean | tableExists(DatabaseMetaData dbMetaData, String tableName) Checks database metadata to see if a table exists. | public boolean | tableExistsCaseSensitive(DatabaseMetaData dbMetaData, String tableName) Checks database metadata to see if a table exists. |
closeJDBCConnection | public void closeJDBCConnection(Connection conn)(Code) | | Closes database connection and logs if an error
is encountered
Parameters: conn - the connection to be closed |
closeJDBCResultSet | public void closeJDBCResultSet(ResultSet aResultSet)(Code) | | Closes database result set and logs if an error
is encountered
Parameters: aResultSet - the result set to be closed |
closeJDBCStatement | public void closeJDBCStatement(Statement stmt)(Code) | | Closes database statement and logs if an error
is encountered
Parameters: stmt - the statement to be closed |
columnExists | public boolean columnExists(DatabaseMetaData dbMetaData, String tableName, String columnName) throws SQLException(Code) | | Checks database metadata to see if a column exists in a table
Try UPPER, lower, and MixedCase, both on the table name and the column name, to see if the column is there.
Parameters: dbMetaData - the database metadata to be used to look up this column Parameters: tableName - the table name Parameters: columnName - the column name throws: SQLException - if an exception is encountered while accessing the database |
columnExistsCaseSensitive | public boolean columnExistsCaseSensitive(DatabaseMetaData dbMetaData, String tableName, String columnName) throws SQLException(Code) | | Checks database metadata to see if a column exists in a table. This method
is sensitive to the case of both the provided table name and column name.
Parameters: dbMetaData - the database metadata to be used to look up this column Parameters: tableName - the case sensitive table name Parameters: columnName - the case sensitive column name throws: SQLException - if an exception is encountered while accessing the database |
delegatedLog | abstract protected void delegatedLog(String errorString)(Code) | | An abstract method which child classes override to handle logging of
errors in their particular environments.
Parameters: errorString - the error message generated |
tableExists | public boolean tableExists(DatabaseMetaData dbMetaData, String tableName) throws SQLException(Code) | | Checks database metadata to see if a table exists.
Try UPPER, lower, and MixedCase, to see if the table is there.
Parameters: dbMetaData - the database metadata to be used to look up this table Parameters: tableName - the table name throws: SQLException - if an exception is encountered while accessing the database |
tableExistsCaseSensitive | public boolean tableExistsCaseSensitive(DatabaseMetaData dbMetaData, String tableName) throws SQLException(Code) | | Checks database metadata to see if a table exists. This method
is sensitive to the case of the provided table name.
Parameters: dbMetaData - the database metadata to be used to look up this table Parameters: tableName - the case sensitive table name throws: SQLException - if an exception is encountered while accessing the database |
|
|