By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,589 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,589 IT Pros & Developers. It's quick & easy.

DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501

P: 1
Hi All,

Since last couple of week i am trying to connect to QA box. But i am getting error. Strange thing is that i can connect to DEV box using same code. Please let me know what is the possible solution.

I am able to get connection. I am able to create statement but whenever program goign to line execute it throws error as below:

Here is my code:

Connection dbconn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sqlQuery = "select seqname from SYSIBM.SYSSEQUENCES";
Class.forName("com.ibm.db2.jcc.DB2Driver");
dbconn = DriverManager.getConnection"jdbc:db2://host:port/dbname", "user",
"passw");
System.out.println("Connection:"+dbconn);
pstmt = dbconn.prepareStatement(sqlQuery);
System.out.println("Created stmt:"+pstmt);
rs = pstmt.executeQuery();
System.out.println("got resultset:"+rs);

Error:

com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: ACPUSER;EXECUTE;NULLID.SYSSH200
at com.ibm.db2.jcc.b.zc.e(zc.java:1606)
at com.ibm.db2.jcc.b.zc.a(zc.java:1206)
at com.ibm.db2.jcc.a.db.h(db.java:149)
at com.ibm.db2.jcc.a.db.a(db.java:43)
at com.ibm.db2.jcc.a.r.a(r.java:30)
at com.ibm.db2.jcc.a.sb.g(sb.java:152)
at com.ibm.db2.jcc.b.zc.n(zc.java:1186)
at com.ibm.db2.jcc.b.ad.db(ad.java:1761)
at com.ibm.db2.jcc.b.ad.d(ad.java:2203)
at com.ibm.db2.jcc.b.ad.U(ad.java:489)
at com.ibm.db2.jcc.b.ad.executeQuery(ad.java:472)
Aug 2 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.