Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package varekd.io;
- import java.io.File;
- import java.sql.Connection;
- import java.sql.SQLException;
- import snaq.db.ConnectionPoolManager;
- import varekd.util.Logger;
- public class DBConnection {
- private static ConnectionPoolManager pool = null;
- public static Connection getConnection(String s) throws SQLException {
- return pool.getConnection(s);
- }
- public static boolean loadDBConnectionPool() {
- try{
- Class.forName("com.mysql.jdbc.Driver");
- if(pool != null) {
- pool.release();
- }
- pool = ConnectionPoolManager.getInstance(new File("conf/", "dbpool.properties"));
- return true;
- } catch(Exception e) {
- Logger.err(e);
- }
- return false;
- }
- static {
- }
- /*public static int getNumIdle() { return dataSource.getNumIdle(); }
- public static int getNumActive() { return dataSource.getNumActive(); }*/
- }
Add Comment
Please, Sign In to add comment