469,338 Members | 8,595 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

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

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
0 14783

Post your reply

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

Similar topics

1 post views Thread by Pedro Oguri | last post: by
15 posts views Thread by Twan Kennis | last post: by
1 post views Thread by chaitu | last post: by
1 post views Thread by oddbande | last post: by
3 posts views Thread by barmatt80 | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.