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