1 Reply Latest reply on Nov 18, 2001 8:30 PM by dogada

    java.sql.Date field in a CMP

    sergeibatiuk

      I have just found out that I could not load an entity bean from Oracle database because it contained a java.sql.Date field called 'birthDate'. Without this field a CMP works correctly.

      What should I do to use a java.sql.Date (or any other Date field) with JBoss?

      Sincerely,
      Sergei Batiuk.

        • 1. Re: java.sql.Date field in a CMP
          dogada

          Hi!

          I use java.util.Date fields in CMP on Jboss without any problem, but with a bit different jaws.xml.

          1. Use CMP-field 'birthDate' of type java.util.Date instead of java.sql.Date. JBoss converts such fields for you.

          2. If previous step will not solve your problem, add in jaws.xml in 'Person' section something like following:

          <cmp-field>
          <field-name>birthDate</field-name>
          <column-name>birthDate</column-name>
          <jdbc-type>DATE</jdbc-type>
          <sql-type>DATE</sql-type>
          </cmp-field>

          (See JBoss JAWS-docs for comments).

          Hope it helps.