package test;

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

public class testMain {
	public static void main(String[] args){
		try {
			//Load JDBC Driver
			Class.forName("org.postgresql.Driver");
			String constr = "jdbc:postgresql://127.0.0.1:5432/postgres";
			String user = "postgres";
			String pass = "postgres";
			
			//DB Connect
			Connection con1 = DriverManager.getConnection(constr,user,pass);
			Connection con2 = DriverManager.getConnection(constr,user,pass);
			
			//PreparedStatement
			PreparedStatement stmt1,stmt2;
			stmt1=con1.prepareStatement(""); //EMPTY_QUERY
			stmt1.execute();
			stmt1.execute();
			stmt1.execute();
			stmt1.execute();
			stmt1.execute(); // prepare cached
			stmt2=con2.prepareStatement(""); //EMPTY_QUERY
			stmt2.execute(); // S_1 does not exist error.
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
