473,883 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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;
PreparedStateme nt pstmt = null;
ResultSet rs = null;
String sqlQuery = "select seqname from SYSIBM.SYSSEQUE NCES";
Class.forName(" com.ibm.db2.jcc .DB2Driver");
dbconn = DriverManager.g etConnection"jd bc:db2://host:port/dbname", "user",
"passw");
System.out.prin tln("Connection :"+dbconn);
pstmt = dbconn.prepareS tatement(sqlQue ry);
System.out.prin tln("Created stmt:"+pstmt);
rs = pstmt.executeQu ery();
System.out.prin tln("got resultset:"+rs) ;

Error:

com.ibm.db2.jcc .b.SqlException : DB2 SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: ACPUSER;EXECUTE ;NULLID.SYSSH20 0
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:3 0)
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.jav a: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.executeQu ery(ad.java:472 )
Aug 2 '07 #1
0 17769

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

Similar topics

1
2887
by: Pedro Oguri | last post by:
On this piece of code: When SELECT returns nothing sqlca.sqlcode = 0 and no_data_found_func isn´t called. How do I know if the insertion was OK? EXEC SQL INSERT INTO TB_SWITCH ( ID_SWITCH, ID_SITE, ID_PROPRIETARIO,
4
12054
by: prasad | last post by:
I am getting sql error during binding a program which access a temporary table. The temporary table declaration and access methods are given below. EXEC SQL DECLARE GLOBAL TEMPORARY TABLE TEM88 LIKE SYSIBM.SYSDUMMY1 END-EXEC. EXEC SQL INSERT INTO TEM88 SELECT * FROM SYSIBM.SYSDUMMY1 END-EXEC.
0
2968
by: Dmitry Tolpeko | last post by:
Hello, Could anybody please explain me why DB2 z/OS 8.1 fails on the simple procedure below: Error: DSNHSMS2 LINE 12 COL 6 NESTED COMPOUND STATEMENTS NOT ALLOWED It failes on DECLARE EXIT HANDLER FOR SQLEXCEPTION
15
7252
by: Twan Kennis | last post by:
Hi, I have a DB2 database on the IBM iSeries platform, on which I created several Stored Procedures with the SQLCODE as a return-parameter. These Stored Procedures are called from a Windows application (build in Visual Basic) using an ADO/OLE DB Provider on a IBM Client Access ODBC driver. On the Internet I found a whitepaper "SQL messages and codes" provided by IBM which describes a complete list of all SQLSTATEs, SQLCODEs and
1
5492
by: chaitu | last post by:
Hi, Can anybody tell me what the error code for Export is. Like i get the message SQL3104N The Export utility is beginning to export data to file "/home/db2as/sqllib/bluee_tables1/DBCHECK.ixf". if it is beginning to export and
1
2783
by: oddbande | last post by:
I get a lot of these messages in db2diag.log - seems like problems with health Monitor: 2007-01-05-15.05.06.380000+060 I260759H331 LEVEL: Severe PID : 3860 TID : 4004 PROC : db2fmp.exe INSTANCE: DB2 NODE : 000 APPID : *LOCAL.DB2.070104233148 FUNCTION: DB2 UDB, Health Monitor, hmonSQLConnect, probe:90 MESSAGE : SQLSetConnectAttr error sqlRC= sqlcode=
4
5083
by: barmatt80 | last post by:
I am stumped on the error reporting with sql server. I was told i need to return @SQLCode(code showing if successful or not) and @ErrMsg(and the message returned). I am clueless on this. I wrote this procedure: ALTER PROCEDURE . @Emp_SSN int, @Annual_Forward decimal(10,2),
1
2161
by: barmatt80 | last post by:
I have found alot of help on this site, and is helping me along. I am having trouble with a stored procedure. This is my first stored procedure. The task I was given was to create a stored procedure that will accept leave balances for employees from our web based leave system. Those 4 values are: @Annual_Forward, @Sick_Forward, @Family_Forward, @Other_Forward. All variables are not going to be passed, so allowing null/empty values is a...
1
8140
by: crazy_jutt | last post by:
Hi, We are getting following errors in diaglog. We have 4096 value as MAXAGENTS and 512 for maxuproc I am confused as which value we are hitting. are we hitting OS ( maxuproc ) value or MAXAGENTS. is there anything else i am missing which need to be looked into ? ----------------------------------------------------------- 2008-03-07-10.41.59.535278-300 I46678299C345 LEVEL: Severe PID : 307324 TID : 1 ...
3
1860
by: barmatt80 | last post by:
I have read many error message articles on the web but still cannot get this to work. I need to return the description of the error that is produced to a output variable (@ErrMsg). In my stored procedure, I assign @SQLCode to @@Error. @SQLCode is also an output variable. I got the @SQLCode to return no problem, just the description is wrong. IF @SQLCode <> 0 BEGIN SELECT description = @ErrMsg FROM master.dbo.sysmessages ...
0
9933
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9781
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10836
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9567
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7114
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4211
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3230
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.