look, this is the original method its supposed to use
Code:
public PoolConnection getFreeConnection() {
PoolConnection c;
for(int i = 0; i < pool.size(); i++) {
c = pool.get(i);
if(c.borrow()) {
return c;
}
}
c = new PoolConnection();
try {
c.setConnection(DriverManager.getConnection(details.get("url"),
details.get("user"), details.get("password")));
} catch (SQLException e) {
e.printStackTrace();
}
c.borrow();
pool.add(c);
return c;
}
yet i have my own class for connecting etc which uses this method
Code:
public static void init() throws Exception {
LOG.log(Level.INFO, "initiating database connection...");
try {
FileInputStream fis = new FileInputStream("database.xml");
props.loadFromXML(fis);
} catch (Exception e) {
LOG.log(Level.SEVERE, "error loading database properties", e);
throw new Exception("error loading database properties");
}
connect();
}