In all examples below, the instance name was replaced with 'xxx'.
From the CLP I can perform the following:
db2 => connect to TEST
Database Connection Information
Database server = DB2/NT64 10.1.0
SQL authorization ID = xxx...
Local database alias = TEST
db2 => SELECT ACCTNUM FROM xxx.ACCOUNT
2 record(s) selected.
SO I go to the JDBC connection, with the following credentials:
and execute the following prepared statement:
SELECT ACCTNUM FROM xxx.ACCOUNT;
... and I get the following error (SQLCODE 104 apparently means that there is a problem with a character acting as a symbol):
DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=;;xxx.ACCOUNT;END
-OF-STATEMENT, DRIVER=3.63.123 (com.ibm.db2.jcc.am.SqlSyntaxErrorException). Mes
sage payload is of type: String
... so, just in case the trailing semi-colon is an illegal symbol, I tried the following (without trailing semi-colon):
SELECT ACCTNUM FROM xxx.ACCOUNT
... but now I get the following error.
DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=INSTUID;SELECT;xxx
.ACCOUNT, DRIVER=3.63.123 (com.ibm.db2.jcc.am.SqlSyntaxErrorException). Message
payload is of type: String
Note I am using th efollowing jar: db2jcc.jar
SQLCODE 551 apparently says that I need to grant some sort of privilege so that the comamnd can be processed statically (Prepared statement)
1> Can I assume that in the first statement, the semei-colon end of statement was actually causing the problem, and that the SQLCODE of 551 is the real problem
2> How do I grant privileges so the JDBC (using the