4 Replies Latest reply on Nov 28, 2007 6:25 AM by Tim Fox

    Jboss Messaging with DB2 DefaultDS

    Teddy Clermont Newbie

      many of the create tables have primary key columns that allows null. This is not allowed in DB2 and is causing the following error:
      CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(255), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1), ALL_NODES CHAR(1), PRIMARY KEY(POSTOFFICE_NAME, NODE_ID, QUEUE_NAME))
      com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -542, SQLSTATE: 42831, SQLERRMC: POSTOFFICE_NAME

      Adding not null to the column does not help because somewhere in the code some of the insert are being done to these tables with null.

      Any possible solution to this problem?