Class SQLDatabase
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.sql.SQLDatabase
-
- Direct Known Subclasses:
DBInitializer,SQLStore,TableInitializer
public class SQLDatabase extends Object
/** Top-level SQL object. This simply maintains a connection pool to a database.Created by Jeff Gaynor
on Mar 12, 2010 at 12:58:14 PM
-
-
Constructor Summary
Constructors Constructor Description SQLDatabase()SQLDatabase(ConnectionPool connectionPool)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroyConnection(ConnectionRecord c)ConnectionRecordgetConnection()ConnectionPoolgetConnectionPool()voidreleaseConnection(ConnectionRecord c)Put the connection back on the stack for future use.static ColumnMaprsToMap(ResultSet rs)Take the values in the current row and stash them in a map, keyed by column name.voidsetConnectionPool(ConnectionPool connectionPool)
-
-
-
Constructor Detail
-
SQLDatabase
public SQLDatabase(ConnectionPool connectionPool)
-
SQLDatabase
public SQLDatabase()
-
-
Method Detail
-
getConnection
public ConnectionRecord getConnection()
-
releaseConnection
public void releaseConnection(ConnectionRecord c)
Put the connection back on the stack for future use. This should be invoked in a finally clause at the end of every method that uses a connection.- Parameters:
c-
-
destroyConnection
public void destroyConnection(ConnectionRecord c)
-
setConnectionPool
public void setConnectionPool(ConnectionPool connectionPool)
-
getConnectionPool
public ConnectionPool getConnectionPool()
-
rsToMap
public static ColumnMap rsToMap(ResultSet rs) throws SQLException
Take the values in the current row and stash them in a map, keyed by column name.- Parameters:
rs-- Returns:
- Throws:
SQLException
-
-