1 Reply Latest reply on Jan 2, 2002 3:48 PM by Dain Sundstrom

    Creating PK with SQL Server

    glm Newbie

      I have a table that automatically creates its integer id and is its primary key (PK). When creating the row for the first time what technique are you using to capture this primary key value for a CMP Entity Bean in the ejbCreate() method? With Oracle I would just insert an empty row and read back the "dual" value. What do you do in SQL Server?

      Thanks,

      Gary

        • 1. Re: Creating PK with SQL Server
          Dain Sundstrom Master

          Capturing the value of an autogenerated column is only supported in a standard way with JDBC 3.0 drivers (I am not aware of any yet). Some JDBC drivers have a nonstandard way to get the value, so you will have to check with your vendor. You will also have to use jdbc directly (i.e., bmp). You may also have problems with the jdbc pool in jboss, but I am not sure.