Newer
Older
marking / src / dao / JdbcConnection.java
Mark on 26 Aug 2014 752 bytes A bunch of improvements.
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/323/2014/dbs/marking/project_new;IFEXISTS=TRUE";
   private static final String url = "jdbc:h2:db/info221_test1;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);
      }
   }
}