import java.sql.Connection;
import java.sql.DriverManager;

abstract public class RawDataReader {
    
    public static String database = "rawdata";
    public static String dbHost = "slinky.cs.nyu.edu";
    public static String dbPort = "5432";
    public static String dbUser = "tiger";
    public static String dbPassword = "tiger";
	public Connection con = null;

    public Connection establishConnection() {
	String url = "";
	//Connection con = null;
	try {
	    url = "jdbc:postgresql://" + dbHost + ":" + dbPort + "/" + database;
	    Class.forName("org.postgresql.Driver");
	    con = DriverManager.getConnection(url, dbUser, dbPassword);
	con.setAutoCommit(false);
	}catch (Exception e){
	    e.printStackTrace();
	}
       	return con;
    }

	public void commit() {
		try {
			con.commit();
		}catch(Exception e) {}
	}

    //public abstract void parseRecord(String record);

}