-
DB2 Error - DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704,
Hi all
My application J2EEruns in jboss. I have migrated my database from a windows machine to a Linux machine.
Jboss is starting without any error
The application runs fine when running with the database in the windows machine. But when i try to run it with the database in the Linux machine (which is migrated from windows). It shows the following in the log file,
ERROR [http-0.0.0.0-8080-1] com.infosys.saas.ecomm.catalog.dao.CatalogmasterDAOImpl - Error at the time of executing the query = CatalogmasterSearchQuery.Message
B2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: cataloguser.TCATALOG_MASTER
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: cataloguser.TCATALOG_MASTER
Help neded to fix this.
Thankx in advance,
Gokul
-
Re: DB2 Error - DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704,
You can get the details for any error message from a DB2 command line by issuing:
db2 ? sqlXXXX
where XXXX is the message number, padded if necessary with 0 so it is 4 digits long. (Depending on your OS, you may have to put a \ or ^ in front of the ?.)
In this case, you'll find that SQLCODE -204 is "object does not exist". DB2 is looking for the object "cataloguser.TCATALOG_MASTER"
-----------------------------------
Doug Doole
DB2 Universal Database Development
IBM Toronto Labs
-
Re: DB2 Error - DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704,
"DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC:"
DRIVER = "com.ibm.db2.jcc.DB2Driver";
URL = "jdbc:db2://localhost:50000/SPT";
UID = "DB2ADMIN";
PASSWORD = "******";
caused by: table cannot be found by the login ID and password.
solved this by adding Schema of that table within sql statement.
before added, this bring error
sql: "SELECT * FROM tmp"
after added
sql: "SELECT * FROM Schema.tmp"
in my case from the picture i attached:
sql: "SELECT * FROM COMPANY"
after added
sql: "SELECT * FROM billson.COMPANY"
then Connection successful!
nice day,
billson.