• Post Reply Bookmark Topic Watch Topic
  • New Topic

DB2 ZOS DB2 SQL error: SQLCODE: -181, SQLSTATE: 22007, SQLERRMC: null  RSS feed

Anshul Choudhary
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all

I have a pretty muddling problem at hand.

I am trying to insert a row into table which contains a field LAST_UPDATE_TIME. I set this to the current time using java.sql.date and then run my Insert statement.

But I keep getting this error in my logs: Error while adding ComSubQuestion : Sql Exception: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -181, SQLSTATE: 22007, SQLERRMC: null

I am using DB2 ZOS and JNDI conncetivity.

Below is the query:

I set the current time in my object by the following code:

currentSubQuestion.setLastUpdateTime(new java.sql.Date());

and then later in some other piece of code use this object to insert time for the new record by the following code.

dQ = new dbConn.prepareStatement(sqlStmt);
java.sql.Date currDate=new java.sql.Date(currentComSubQuestion.getLastUpdateTime().getTime());

The DB2 Driver I am using is: DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09013"
with level identifier "01040107".
Informational tokens are "DB2 v9.1.0.3", "s070719", "MI00203", and Fix Pack

When I run this piece of code in the following DB version: Version:- "DB2 v8.1.9.710", "s050502", "WR21351", and FixPak "9"
Driver :- db2jcc.jar
Driver Class :- com.ibm.db2.jcc.DB2Driver

it works perfectly fine.

I am not a pro in this and hence really need some help from the bigger brains.

Any suggestion/comments are most welcome.

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!