Created
February 15, 2016 06:19
-
-
Save xMlex/3f4265243e482afad869 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package l2ft.gameserver.database; | |
import l2ft.commons.dbcp.BasicDataSource; | |
import l2ft.gameserver.Config; | |
import java.sql.Connection; | |
import java.sql.SQLException; | |
public class DatabaseFactory extends BasicDataSource { | |
private static final DatabaseFactory _instance = new DatabaseFactory(); | |
public static final DatabaseFactory getInstance() throws SQLException { | |
return _instance; | |
} | |
public DatabaseFactory() { | |
super(Config.DATABASE_DRIVER, Config.DATABASE_URL, Config.DATABASE_LOGIN, Config.DATABASE_PASSWORD, Config.DATABASE_MAX_CONNECTIONS, Config.DATABASE_MAX_CONNECTIONS, Config.DATABASE_MAX_IDLE_TIMEOUT, Config.DATABASE_IDLE_TEST_PERIOD, false); | |
} | |
@Override | |
public Connection getConnection() throws SQLException { | |
return getConnection(null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment