3 Replies Latest reply on May 21, 2002 11:22 AM by suvankar17

    Field Mapping - Invalid parameter error for ORACLE type NUMB

    jonlees

      I have successfully created and deployed into JBoss an EJB that maps to a table in an existing Oracle database. All the fields can be accessed in the usual way, except for those with an Oracle datatype of NUMBER(2).

      When I comment out the cmp-field entry in the ejb-jar and jaws xml files, the bean's read methods return null for these fields. When I comment them back in, the read method gives a "java.lang.IllegalArgumentException". I'm guessig that this is because the NUMBER(2) is not an integer and this is what I'm trying to map it to!!

      An example of my jaws.xml and ejb-jar.xml files;

      <cmp-field><field-name>feedid</field-name></cmp-field>
      <!--cmp-field><field-name>stat</field-name></cmp-field-->

      Any idea anybody..?

        • 1. Re: Field Mapping - Invalid parameter error for ORACLE type
          bjs_pd

          Hi Jon!

          If you are using the JBOSS 3.x Version and trying to map at an existing DB-Table you have to specify the mapping at the 'jbosscmp-jdbc.xml'. Or you can change the mappingtypes at the standardjbosscmp-jdbc.xml'.

          CU
          BJ

          • 2. Re: Field Mapping - Invalid parameter error for ORACLE type
            jonlees

            Thanks for the reply bjs. However, I am using JBoss 2.4.4 and soon we will be upgrading to 2.4.6 - Not sure when 3.0 will happen.

            Anyhow, given that I have a NUMBER(2) field in the database, what java.lang.* type should I be reading this into? That's the crux of the question I think.

            I have tried changing the DB field to a NUMBER(3) and then reading it into a java.lang.byte, but this does not work either!! Any help would be much appreciated....

            Jon

            • 3. Re: Field Mapping - Invalid parameter error for ORACLE type
              suvankar17

              Use java premitive int for your case, it would work. There is one more option , you can make use of the jaws.xml file where you can exactly specify the maping between jdbc type and the oracle data type..I am attching an working file ..i hope it helps you..