Problems with saveData

Hi all,
i´m trying to create a new record but in the moment of ```
databaseManager.saveData()

the next error is shown and the record is not created

save failed for 1 or more records
> com.servoy.j2db.dataprocessing.DataException: [Relativity JDBC Driver]java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Short

i already check that i´m not saving an int on a string and stuff like that.
I´m working with postgres
what could be the reason?

tks in advance

does the log show a bigger error?

It seems that the jdbc driver can’t convert a Integer to a Short (that it expects)

Hi,

I contacted Micro Focus support as Relativity is the ODBC/JDBC driver this customer is using to access COBOL data.

<< [Relativity JDBC Driver]java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Short >>

The error message that this customer is receiving appears to be correct. In the SQL statement that was provided, it appears that the customer is trying to bind a Long data item into the field “Fechacarga”. This field is defined as an Integer in the Relativity catalog.

In order to INSERT into the field “Fechacarga”, the customer should provide an Integer data item and not a Long.

The problem is that Servoy is sending a long. If you create a new form and with the Smart Client try go add a record, when you try to Save Data you receive that error.

Regards,

Juan Urraburu

Juan,

This sounds like an issue in the driver to me.
Servoy sends a Long, but according to the JDBC Conversions by setObject, the driver should support a mapping for Double, Long, Integer to SMALLINT(short) or INTEGER column types.

http://download.oracle.com/javase/1.4.2 … ml#1004845

Rob

Hello
We had the same error message

Save failed for 1 or more records
Com.servoy.j2db.dataprocessing.DataException: [Relativity JDBC Driver] java.lang.ClassCastException: java.lang.Integer not can be cast to java.lang.Short

When you create a catalog of Relativity, the field pic 9 (4) are defined as SMALLINT, and what we do is pass it to INTEGER and voila, it works!

Greetings.
Roberto Diez.
Santa Fe - Argentina.

Grande Roberto!!!

Saludos,

Juan Manuel