getConnection method code for retrieving a connection.

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();
   }
}