Unix Technical Forum

newline character in PreparedStatement doesn't recognized with jcc driver?

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>, ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 11:03 AM
Mark Barinstein
 
Posts: n/a
Default newline character in PreparedStatement doesn't recognized with jcc driver?

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 11:03 AM
Serge Rielau
 
Posts: n/a
Default Re: newline character in PreparedStatement doesn't recognized with jcc driver?

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:35 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com