package dao; import java.sql.Connection; import java.sql.SQLException; import org.h2.jdbcx.JdbcConnectionPool; /** * * @author mark */ public class JdbcConnection { private static final String url = "jdbc:h2:tcp://localhost/~/work/projects/injection/db/users;IFEXISTS=TRUE"; private static final String username = "sa"; private static final String password = ""; private static final JdbcConnectionPool pool = JdbcConnectionPool.create(url, username, password); public static Connection getConnection() { try { return pool.getConnection(); } catch (SQLException ex) { throw new RuntimeException(ex); } } }