|
iiitToolkit 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.iiit.jdbc.JdbcConnectionPool
To be used as an pooled replacement of java.sql.connection.
Constructor Summary | |
JdbcConnectionPool(String url,
String user,
String password)
Creates a pool prepared to connect to the given database URL. |
|
JdbcConnectionPool(String url,
String user,
String password,
int connections)
Creates a pool prepared to connect to the given database URL and opens pre-defined connectios for later use. |
Method Summary | |
JdbcStatement |
createStatement()
Creates a Statement object for sending SQL statements to the database. |
protected void |
destroyConnection(JdbcConnection connection)
Remove the connection from the pool of busy ones but do not move it to free ones. |
JdbcDatabaseMetaData |
getMetaData()
Retrieves a JdbcDatabaseMetaData object that contains metadata about the database to which this JdbcConnectionPool object represents a connection. |
JdbcPreparedStatement |
prepareStatement(String sql)
Creates a PreparedStatement object for sending parameterized SQL statements to the database. |
protected void |
releaseConnection(JdbcConnection connection)
marks the connection as free and moves it into the pool of free connections. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JdbcConnectionPool(String url, String user, String password)
url
- a database url of the form jdbc:subprotocol:subnameuser
- the database user on whose behalf the connection is being madepassword
- the user's passwordpublic JdbcConnectionPool(String url, String user, String password, int connections)
url
- a database url of the form jdbc:subprotocol:subnameuser
- the database user on whose behalf the connection is being madepassword
- the user's passwordconnections
- then number of connections to openMethod Detail |
public JdbcStatement createStatement() throws JdbcException
JdbcException
- if a database access error occurspublic JdbcPreparedStatement prepareStatement(String sql) throws JdbcException
sql
- an SQL statement that may contain one or more '?' IN parameter placeholders
JdbcException
- if a database access error occurspublic JdbcDatabaseMetaData getMetaData() throws JdbcException
JdbcException
- if a database access error occursprotected void releaseConnection(JdbcConnection connection)
connection
- The JdbcConnection to releaseprotected void destroyConnection(JdbcConnection connection)
connection
- the connection to remove.
|
iiitToolkit 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |