If I have declare the following in class A(which is the first class to run when servlet runs),

import com.javaexchange.dbConnectionBroker.*;
DbConnectionBroker myBroker;
Connection con = null;

and then pass the "con" & "myBroker" to my second class, class B after I have set up the pool as shown in the example,

try {
myBroker = new DbConnectionBroker("oracle.jdbc.driver.OracleDrive r",
"jdbc:oracle:thin:@209.94.3.212:1526:orcl",
"scott","tiger",2,6,
"D:\\JavaWebServer1.1\\DCB_Example1.log",0.01) ;

con = myBroker.getConnection(); <--------------------- ***

} catch (IOException e5) {
}

classB classb = new classB(con, myBroker, etc..........); <------------------ [class B constructor]

And then declare the same thing in the class B as follow (Because all the DB task is perform in class B),

import com.javaexchange.dbConnectionBroker.*;
DbConnectionBroker inComingBroker;

.................................................. ...................
all the db task here
.................................................. ...................

inComingBroker.freeConnection();


Would that be okay if I do like the above? Will there be any memory or connection problem?