Hi there.
Having investigated quite some time into this issue I come up with this
result:
The table I have defined contains an integer row. Via JDBC this row is
recognized as java.sql.Types.INTEGER. In the mapping file, both the java
property and the sql row are typed as "integer". Castor tries to set a value
with the method
PreparedStatement.setObject(4, new java.math.BigDecimal("3"),
java.sql.Types.NUMERIC);
which the JDBC driver rejects. I seem to be unable to convince Castor to use
java.sql.Types.INTEGER for this operation. What can be done (beyond changing
Castor or the JDBC driver? Are there some tricks for the mapping file? What
is the database type in database.xml set for? Can I use that to adapt Castor
for Tamino SQL?
Hiran
----- Original Message -----
From: "Hiran Chaudhuri" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 04, 2003 9:02 AM
Subject: [castor-dev] Problem running sample
> Hi there.
>
> Can someone give me a hint what's wrong running the castor sample?
> - In database.xml I entered driver and connection information for my
Tamino
> SQL Engine.
> - In create.sql I adapted the SQL statements so my database will create
the
> tables the way castor expects it.
> - In mapping.xml I actually tried not to change anything, but....
>
> As Tamino SQL does not know about a numeric data type, I changed that to
> float/decimal/whatever. From JDBC the data type is mentioned as DOUBLE.
> However I keep getting the listed error message, and suspect that it
occurs
> with the price field. If it is the group_id, what can I do to overcome
that
> error?
>
> Hiran
>
> [test] Creating new product: <id: 4 name: product4>
> [test] Castor: Creating myapp.Product (4)
> [test] Error creating myapp.Product, SQL : INSERT INTO "prod"
> ("id","name","price","group_id") VALUES (?,?,?,?)
> [test] org.exolab.castor.jdo.PersistenceException: Nested error:
> java.sql.SQLException: setDouble() is wrong Method to set inputparameter 4
> [test] java.sql.SQLException: setDouble() is wrong Method to set
> inputparameter 4
> [test] at
> de.sag.jdbc.tsql.server.AInputServer.checkType(AInputServer.java:930)
> [test] at
> de.sag.jdbc.tsql.server.AInputServer.setDouble(AInputServer.java:345)
> [test] at
> de.sag.jdbc.tsql.server.AInputServer.setBigDecimal(AInputServer.java:351)
> [test] at
> de.sag.jdbc.tsql.server.AInputServer.setObject(AInputServer.java:723)
> [test] at
> de.sag.jdbc.tsql.APreparedStatement.setObject(APreparedStatement.java:665)
> [test] at
> de.sag.jdbc.tsql.APreparedStatement.setObject(APreparedStatement.java:674)
> [test] at
> org.exolab.castor.jdo.engine.SQLTypes.setObject(SQLTypes.java:420)
> [test] at
org.exolab.castor.jdo.engine.SQLEngine.create(SQLEngine.java:598)
> [test] at
> org.exolab.castor.persist.ClassMolder.create(ClassMolder.java:903)
> [test] at
org.exolab.castor.persist.LockEngine.create(LockEngine.java:458)
> [test] at
>
org.exolab.castor.persist.TransactionContext.create(TransactionContext.java:
> 883)
> [test] at
> org.exolab.castor.jdo.engine.DatabaseImpl.create(DatabaseImpl.java:366)
> [test] at castorjdo.Test.run(Test.java:222)
> [test] at castorjdo.Test.main(Test.java:63)
>