|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.james.util.JDBCUtil
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.
Constructor Summary | |
JDBCUtil()
|
Method Summary | |
void |
closeJDBCConnection(Connection conn)
Closes database connection and logs if an error is encountered |
void |
closeJDBCResultSet(ResultSet aResultSet)
Closes database result set and logs if an error is encountered |
void |
closeJDBCStatement(Statement stmt)
Closes database statement and logs if an error is encountered |
protected abstract void |
delegatedLog(String errorString)
An abstract method which child classes override to handle logging of errors in their particular environments. |
boolean |
tableExists(DatabaseMetaData dbMetaData,
String tableName)
Checks database metadata to see if a table exists. |
boolean |
tableExistsCaseSensitive(DatabaseMetaData dbMetaData,
String tableName)
Checks database metadata to see if a table exists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCUtil()
Method Detail |
protected abstract void delegatedLog(String errorString)
errorString
- the error message generatedpublic boolean tableExists(DatabaseMetaData dbMetaData, String tableName) throws SQLException
dbMetaData
- the database metadata to be used to look up this tabletableName
- the table name
SQLException
- if an exception is encountered while accessing the databasepublic boolean tableExistsCaseSensitive(DatabaseMetaData dbMetaData, String tableName) throws SQLException
dbMetaData
- the database metadata to be used to look up this tabletableName
- the case sensitive table name
SQLException
- if an exception is encountered while accessing the databasepublic void closeJDBCConnection(Connection conn)
conn
- the connection to be closedpublic void closeJDBCStatement(Statement stmt)
stmt
- the statement to be closedpublic void closeJDBCResultSet(ResultSet aResultSet)
aResultSet
- the result set to be closed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |