Constructor and Description |
---|
ConnectionPool(DBMetaData dbmd)
Create new Pool that is used for a OADataSourceJDBC.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeAllConnections()
Close all connections and remove from Connection Pool.
|
protected OAConnection |
createNewOAConnection() |
Connection |
getConnection(boolean bExclusive)
Returns an unused JDBC connection, null if maxConnections has been reached and all current connections are used.
|
void |
getInfo(Vector<Object> vec)
Called by OADataSource.getInfo to return information about database connections.
|
protected OAConnection |
getOAConnection(boolean bForStatement,
boolean bExclusive) |
PreparedStatement |
getPreparedStatement(String sql,
boolean bHasAutoGenerated)
Returns a JDBC PreparedStatment that can be used for direct JDBC calls.
|
Statement |
getStatement(String message)
Returns a JDBC Statement that can be used for direct JDBC calls.
|
protected OAConnection |
getStatementConnection() |
boolean |
isDatabaseAvailable()
Returns true if database is still connected.
|
void |
open() |
void |
releaseConnection(Connection connection) |
void |
releasePreparedStatement(PreparedStatement statement,
boolean bCanBeReused)
Release a PreparedStatement obtained from getPreparedStatement.
|
void |
releaseStatement(Statement statement)
Release a Statment obtained from getStatement.
|
void |
run()
Low priority Thread used to close extra connections that are not being used.
|
public ConnectionPool(DBMetaData dbmd)
public void open()
public void close()
public void run()
public boolean isDatabaseAvailable()
public void closeAllConnections()
public Connection getConnection(boolean bExclusive) throws Exception
Exception
protected OAConnection getOAConnection(boolean bForStatement, boolean bExclusive) throws Exception
Exception
protected OAConnection createNewOAConnection() throws Exception
Exception
public void releaseConnection(Connection connection)
protected OAConnection getStatementConnection() throws Exception
Exception
public Statement getStatement(String message) throws Exception
message
- reason/description for using statement. This is used by getInfo(),Exception
public void releaseStatement(Statement statement)
public PreparedStatement getPreparedStatement(String sql, boolean bHasAutoGenerated) throws Exception
sql
- to assign to prepared statement.bHasAutoGenerated
- true if this is an insert that will have a generated pkeyException
public void releasePreparedStatement(PreparedStatement statement, boolean bCanBeReused)
Copyright © 1999–2019 ViaOA. All rights reserved.