Hello,

in my database-table (Informix) there are several datatypes:

id_dt10000    integer
name   char(6)
text    char(20)
art    smallint

the entitybean uses the java.lang.Short class to this field 'art' in the
table. The GenIC generates the following code, which throws an exception in
the line converting 'art'

            bn.id_dt10000 = (java.lang.Integer)rs.getObject("id_dt10000");
            bn.name = rs.getString("name");
            bn.text = rs.getString("text");
            bn.art =
(java.lang.Short)MarshallTool.fromBytes((byte[])rs.getBytes("art"));

The exception is:

Failed to load bean from database
java.sql.SQLException: Can't convert to: byte array
        at java.lang.Throwable.<init>(Throwable.java:74)
        at java.lang.Exception.<init>(Exception.java:38)
        at java.sql.SQLException.<init>(SQLException.java:36)
        at com.informix.util.IfxErrMsg.getSQLMinorException(IfxErrMsg.java)
        at com.informix.jdbc.IfxObject.toBytes(IfxObject.java)
        at com.informix.jdbc.IfxResultSet.getBytes(IfxResultSet.java)
        at com.informix.jdbc.IfxResultSet.getBytes(IfxResultSet.java)
        at
de.dpd.dp100.JOnASdp10001EBBeandp10001EB.loadData(JOnASdp10001EBBeandp10001E
B.java:993)
        at
org.objectweb.jonas.container.EntitySynchroImpl.considerRequest(EntitySynchr
oImpl.java:179)
        at
org.objectweb.jonas.container.JBeanEntity.preinvoke(JBeanEntity.java:511)
        at
de.dpd.dp100.JOnASdp10001EBBeandp10001EB.getFrom_anweisung(JOnASdp10001EBBea
ndp10001EB.java:438)
        at
de.dpd.dp100.JOnASdp10001EBBeandp10001EB_Skel.dispatch(JOnASdp10001EBBeandp1
0001EB_Skel.java:155)
        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:159)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:147)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(Compiled Code)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:6
43)
        at java.lang.Thread.run(Thread.java:492)

Why does GenIC wants to cast the resultset into a byte array???
It works for Integer, String, Date, why not for Short?

Thanks for any hints or tips.

Best regards, Juergen Messer

----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to