package de.grobmeier.database;import java.sql.*;import java.util.*;import com.protomatter.jdbc.pool.*;/*** @author Grobmeier, Christian*/public class ConnectionManager{ static String driver = "com.mysql.jdbc.Driver"; static String url = "jdbc:mysql://localhost/possessed?user=imm59&password=nix"; static JdbcConnectionPool pool; static { try { init(); } catch(Exception e) { e.printStackTrace(); } } static void init() throws Exception { Hashtable args = new Hashtable(); args.put("jdbc.driver", driver); args.put("jdbc.URL", url); pool = new JdbcConnectionPool("ConPool", args); } static public Connection getConnection() throws ClassNotFoundException, SQLException { Connection con = DriverManager.getConnection("jdbc:protomatter:pool:ConPool"); return con; }}
con = ConnectionManager.getConnection();statement = con.createStatement();result = statement.executeQuery(sql);