Mainframe CICS DB2 : Security mechanism not supported

I was writing a code to access DB2 in CICS where I encountered this error. This error encounters when you are trying to access a secured Db with default options. In order to get this working, you have to specify ‘securityMechanism’ property in your connection string with value as supported by server, see below:

jdbc:db2://SERVERNAME:3700/DB:securityMechanism=7;

Continue reading “Mainframe CICS DB2 : Security mechanism not supported”

Mainframe CICS DB2 : java.lang.NoClassDefFoundError: com/ibm/crypto/provider/IBMJCE

I was trying to access Mainframe () DB2 using standalone application with “com.ibm.db2.jcc.DB2Driver” driver where I encountered the below error

java.lang.NoClassDefFoundError: com/ibm/crypto/provider/IBMJCE

Problem was that ibmjceprovider.jar was missing from my classpath and java.security file I added the jar file and then added below line in security file..it works.

security.provider.10=com.ibm.crypto.provider.IBMJCE

DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704

SQLCODE -204 is "object does not exist".

I was getting this error while executing a query, this was happening because I was using the SCHEMA name of Q7 database and executing the query inside Q0 db.

means not able to find table with given user id.

When I corrected the db name it works fine.

This error also appear when you are not using schema name in query.

DB2 SQL0407N : Assignment of a NULL value to a NOT NULL column “TBSPACEID=2, TABLEID=26, COLNO=0” is not allowed.

SQL0407N Assignment of a NULL value to a NOT NULL column name is not allowed.

If you encounter this error and If the value for name is of the form “TBSPACEID=n1, TABLEID=n2, COLNO=n3”, you can determine the table name and column name using the following query:

 

SELECT C.TABSCHEMA,
C.TABNAME, C.COLNAME FROM SYSCAT.TABLES AS T,
SYSCAT.COLUMNS AS C WHERE
T.TBSPACEID = 2 AND  T.TABLEID = 26 AND  C.COLNO = 0 AND
C.TABSCHEMA = T.TABSCHEMA AND  C.TABNAME = T.TABNAME