This is a discussion on newline character in PreparedStatement doesn't recognized with jcc driver? within the DB2 forums, part of the Database Server Software category; --> Hello. db2 v8.1.2, Windows 2003 Server. Next code: --- cut --- try { Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection conn = DriverManager.getConnection("jdbc:db2://<serv>:50000/<db>", <login>, ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello. db2 v8.1.2, Windows 2003 Server. Next code: --- cut --- try { Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection conn = DriverManager.getConnection("jdbc:db2://<serv>:50000/<db>", <login>, <pwd>); PreparedStatement pst = conn.prepareStatement("select count(1)\nfrom syscat.tables\nwhere tabschema=?"); pst.setString(1, "SYSIBM"); ResultSet rs = pst.executeQuery(); if (rs.next()) System.out.println(rs.getInt(1)); } catch (SQLException e) { e.printStackTrace(); } --- cut --- throws Exception: --- cut --- com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -7, SQLSTATE: 42601, SQLERRMC: ;select count(1) at com.ibm.db2.jcc.c.cl.e(cl.java:1213) .... --- cut --- This piece of code has been working fine with app, net drivers on db2 v6.1, 7.2 Is this a feature of the jcc driver? Best regards, Barinstein Mark. |
| ||||
| Don't quote me on that one, but I think I saw this before and teh conclusion was that thsi is a behavior of the driver. Don't recall whether it was "as designed" or a bug though. Cheers Serge |