Dear All,
Thanks for your help for ma questions in this forum.i really apreciate it thank you
i have a problem from connecting from java to AS400......
i want to be able to read from a physical file
this is ma code below and where should i put the file jt400.jar in which directory?
Thanks in advance for all your help
Thanks for your help for ma questions in this forum.i really apreciate it thank you
i have a problem from connecting from java to AS400......
i want to be able to read from a physical file
this is ma code below and where should i put the file jt400.jar in which directory?
Thanks in advance for all your help
HTML Code:
try { Class.forName("com.ibm.db2.jdbc.app.DB2Driver"); System.out.println("After Driver"); } catch (ClassNotFoundException e) { System.out.println("Database Driver could not be loaded " + e); } Define connection information. String databaseURL = "jdbc:odbc:Equation"; String query; String userName = "user1"; String password = "P13"; Connection con = null; ResultSet resultSet = null; PreparedStatement ps = null; System.out.println("After Connection"); query = "select * from library1/File1 where fieldone='0001'; try { ps = con.prepareStatement(query); resultSet = ps.executeQuery(); resultSet.next(); while ( !(resultSet == null)) { System.out.println("field4 " + resultSet.getString("FIELD4")); resultSet.next(); } System.out.println("Out"); } catch (SQLException ex) { System.out.println("Global isFI failed to connect " + ex); } System.out.println("Finish");
Comment