/** * Returns the singleton instance of the {@code ConnectionPoolManager} for the specified properties file. * @param propsFile filename of the properties file to use (path info should not be specified; available CLASSPATH will be searched for the properties file) * @return instance of {@code ConnectionPoolManager} relating to the specified properties file * @throws IOException if there was an problem loading the properties */ public static synchronized ConnectionPoolManager getInstance(String propsFile) throws IOException { return getInstance(propsFile, DEFAULT_CHARSET); }
/** * Returns the singleton instance of the ConnectionPoolManager for the specified properties file. * @param propsFile filename of the properties file to use (path info should not be specified; available CLASSPATH will be searched for the properties file) * @return instance of ConnectionPoolManager relating to the specified properties file * @throws IOException if there was an problem loading the properties */ public static synchronized ConnectionPoolManager getInstance(File propsFile) throws IOException { return getInstance(propsFile, DEFAULT_CHARSET); }
public SQLUpdate(String poolname) throws IOException, SQLException { cpm = ConnectionPoolManager.getInstance(); openConnection(poolname); }
/** * Returns the standard singleton instance of the {@code ConnectionPoolManager}. * If an instance has been obtained with a user-specified {@link Properties} object * then this instance is returned, otherwise an attempt is made to return an * instance using the default properties file ({@code dbpool.properties}). * @return An instance of {@code ConnectionPoolManager} * @throws IOException if there was an problem loading the properties */ public static synchronized ConnectionPoolManager getInstance() throws IOException { Object o = managers.get(PROPERTIES_INSTANCE_KEY); ConnectionPoolManager cpm = (o != null) ? (ConnectionPoolManager)o : null; if (cpm == null || cpm.isReleased()) cpm = getInstance(DEFAULT_PROPERTIES_FILE); return cpm; }