public Connection getConnection(String hostname, int portnumber, String username, String password, String dBorSIDName) throws SQLException, ClassNotFoundException { String connectString = getConnectStringTemplate(); connectString = connectString.replaceAll("host", hostname); connectString = connectString.replaceAll("port", Integer.toString(portnumber)); connectString = connectString.replaceAll("dbname", dBorSIDName); logger.info("Connect to:"+ connectString); Connection conn = getConnection(getDriver(), connectString, username, password); return conn; }