Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static public void db_test()
- {
- Connection conn;
- String strDatabasePath = "192.168.1.100:/data/nik/IBDATA.GDB";
- String strURL="jdbc:firebirdsql:"+strDatabasePath;
- String strUser="SYSDBA";
- String strPassword="masterkey";
- try
- {Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();}
- catch(IllegalAccessException | InstantiationException | ClassNotFoundException ex)
- {Logger.getLogger(DM.class.getName()).log(Level.SEVERE, null, ex);}
- try
- {
- Properties properties=new Properties();
- properties.put("user",strUser);
- properties.put("password",strPassword);
- conn = DriverManager.getConnection(
- strURL + "?lc_ctype=WIN1251",properties);
- PreparedStatement q1 = conn.prepareStatement("select * from params");
- ResultSet r1 = q1.executeQuery();
- PreparedStatement q2 = conn.prepareStatement("select * from clients");
- ResultSet r2 = q2.executeQuery();
- r1.next(); r1.getObject(1); //<b>org.firebirdsql.jdbc.FBSQLException: The result set is closed</b>
- r2.next(); r2.getObject(1);
- }
- catch(SQLException ex)
- {
- Logger.getLogger(DM.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement