Bruce Snyder wrote:
> This one time, at band camp, Micka�l Guessant said:
> 
> MG>For DB2, the castor doclet will generate the following mapping and
> MG>DDL for a float attribute :
> MG>
> MG>     <field name="floatValue" type="float">
> MG>       <sql name="FLOATVALUE" />
> MG>       <bind-xml name="floatValue" />
> MG>     </field>
> MG>
> MG>FLOATVALUE DECIMAL(16,8) ,
> MG>
> MG>Note that the field type float is specified, but no sql type. The
> MG>default is just OK.
> MG>
> MG>You are trying to use type="numeric", which maps to
> MG>java.math.BigDecimal, see :
> MG>http://castor.exolab.org/types.html
> 
> Maybe the example needs to be changed/fixed due to this. My guess is that the
> use of numeric<->BigDecimal is not handled appropriately by the DB2 JDBC
> drivers. Do you know if this is this a correct guess? 
>
After some more tests, it appears that :
- The JDO example is working just fine with DB2 UDB 7.2
- With a size of (18,2) (example) or (16,8) (castor doclet) the
conversion is OK, even with sql-type numeric
- A problem appears when the DECIMAL size in DB2 is too small :
      [java] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] 
SQL0302N  The value of a host variable in the EXECUTE or OPEN statement 
is too large for its corresponding use.  SQLSTATE=22003


-- 
Mickael Guessant

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to