3 Replies Latest reply on Oct 3, 2003 1:56 AM by vincentchun

    MySQL auto-increment problem

    vincentchun Newbie

      How to set auto-increment in JBoss with MySQL 4?

      I use jboss-3.2.1_tomcat-4.1.24 and I have set auto_increment in MySQL.

      In my jbosscmp-jdbc.xml, I have set the following:
      <cmp-field>
      <field-name>MessageID</field-name>
      <column-name>MESSAGEID</column-name>
      <auto-increment/>
      </cmp-field>

      In my ejb-jar.xml, I have set the following:
      <prim-key-class>java.lang.Integer</prim-key-class>
      ......
      <cmp-field >
      <field-name>MessageID</field-name>
      </cmp-field>
      <primkey-field>MessageID</primkey-field>
      ......

      It do not work, is there any extra setting for auto-increment setup?

      or Can anyone post a MySQL auto-increment example?