| java.lang.Object org.apache.lucene.store.jdbc.datasource.DataSourceUtils
DataSourceUtils | abstract public class DataSourceUtils (Code) | | A set of Jdbc DataSource utilities.
author: kimchy |
closeResultSet | public static void closeResultSet(ResultSet rs)(Code) | | Close the given JDBC ResultSet and ignore any thrown exception. This is
useful for typical finally blocks in manual JDBC code.
Parameters: rs - the JDBC ResultSet to close |
closeStatement | public static void closeStatement(Statement stmt)(Code) | | Close the given JDBC Statement and ignore any thrown exception. This is
useful for typical finally blocks in manual JDBC code.
Parameters: stmt - the JDBC Statement to close |
commitConnectionIfPossible | public static void commitConnectionIfPossible(Connection con) throws JdbcStoreException(Code) | | Commits the connection only if the connection is controlled by us. The connection is controlled if it is
the TransactionAwareDataSourceProxy and it is the most outer connection in the tree of connections
the TransactionAwareDataSourceProxy returned.
|
controlConnection | public static boolean controlConnection(Connection connection)(Code) | | Returns true if the connection was created by the
TransactionAwareDataSourceProxy and it
controls the connection (i.e. it is the most outer connection created).
|
getColumnIndexFromColumnName | public static int getColumnIndexFromColumnName(ResultSetMetaData metaData, String columnName) throws SQLException(Code) | | Returns the column index for the guven column name. Note that if there
are two columns with the same name, the first onde index will be
returned.
-1 is returned if none is found.
|
releaseConnection | public static void releaseConnection(Connection con)(Code) | | Close the given JDBC connection and ignore any thrown exception. This is
useful for typical finally blocks in manual JDBC code.
Will only close the connection under two conditions:
If the connection was not created by the
TransactionAwareDataSourceProxy , or if it was created
by
TransactionAwareDataSourceProxy , and the connection controls the connection
(i.e. it is the most outer connection created).
|
rollbackConnectionIfPossible | public static void rollbackConnectionIfPossible(Connection con) throws JdbcStoreException(Code) | | Tollbacks the connection only if the connection is controlled by us. The connection is controlled if it is
the TransactionAwareDataSourceProxy and it is the most outer connection in the tree of connections
the TransactionAwareDataSourceProxy returned.
|
|
|