getConnection method code for retrieving a connection.
- By Nitin Nanda
- December 18, 2000
COMPONENT JAVA
Extending the Power of JDBC Drivers
Nitin Nanda
Listing 4. getConnection method code for retrieving a connection.
// retrieve one unused
for(int i = 0; i < vConnections.size(); i++)
{
JRConnection jrConnection = (JRConnection) vConnections.elementAt(i);
if(jrConnection.isInUse() == false)
{
jrConnection.setInUse(true);
return jrConnection.getConnection();
}
}