Hi, I got problem about updating backup data to postgresSQL server. I am using postgresSQL database server 7.3 (for live) and postgresSQL database server 7.4 (for backup). When i was updated data to postgresSQL database server 7.3 by running following java program, there was no problem yet when i am using for postgresSQL database server 7.4 got error like "Exception in thread "main" java.lang.NullPointerException at UpdateAll_pjitlsa.main(UpdateAll_pjitlsa,103)"
The following are my java program. line 103 is "connect_pg.setAutoCommit(false)"
try { // create another connection to connect to postgresql Class.forName("org.postgresql.Driver"); connection_pg = DriverManager.getConnection ("jdbc:postgresql://localhost:5432/net_jit","postgres","");
stm_pg = connection_pg.createStatement();
//create preparedstatement for insert operation pstm = connection_pg.prepareStatement ("insert into pjitlsa (jla010,jla020,jla030,jla040,jla041,jla050,jla051,jla052,jla060,jla070,jla080,j la090,jla100,jla110,jla120,jla130,jla140,jla150,jla160) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
try { //Insert update records number to PostgreSQL "PJITLOG" table stm_pg.executeUpdate("Update pjitlog set ncsupdate=now(),ncsrecords="+i+" where trim(jlg030)='PJITLSA'");
} catch (SQLException e) { myout.write("\n"); myout.write("PostgreSQL update records nubmer to PostGreSQL pjitlog error:"+e.getMessage()+"\n"); }
yes. i checked already. when i run for postgresSQL database server 7.3 (for live), it work well yet when i run for postgresSQL database server 7.4(for backup) from another PC, it doesn't work.