I have a graph where I am passing values to update a field in a SQL Server table. The field in the sql server table is a BIGINT type. The metadata in the graph has the field as a Long as the values can exceed 2,147,483,647.
When I try to do an update using the DB Output update process… I get this message
15:12:46,848 DEBUG [WatchDog] - Node DB_OUTPUT_TABLE0 error details:
org.jetel.exception.JetelException: Incompatible Clover & JDBC field types - field Field0 Clover type: long caused by: java.sql.SQLException: Incompatible Clover & JDBC field types - field Field0 Clover type: long
at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:522)
at org.jetel.graph.Node.run(Node.java:366)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Incompatible Clover & JDBC field types - field Field0 Clover type: long
at org.jetel.connection.CopySQLData.jetel2sql(CopySQLData.java:162)
at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:539)
at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:518)
… 2 more
15:12:46,910 WARN [WatchDog] - Interrupted node: DATA_READER0
Does anyone have any ideas?
I had a look at this and BIGINT looks like it is supported by java.lang.Long.
I have a graph which is doing a reformat and then at the end of it will be updating the database.
The datafield of the Database table is a smallint as set in SQL Server.
I am having problems getting the db output function to update this correctly.
The only data types I can see that clover has are…
Integer → 2^31
Numberic → 2^1023
Long → 2^63
Byte which is far too small giving a maximum of 127.
I need one in the middle giving a value of 2^15 and cant see this.
I am using Java code to parse this as a short but when it hits the edge it goes wrong and uses the data type the edge is set to. Which is understandable.
My Java code is…
Short x = (short)(counter);
(outputRecords[1].getField(OUT0_memseqno)).setValue(x);
The error message I get is…
19:08:45,128 DEBUG [WatchDog] - Node DB_OUTPUT_TABLE0 error details:
org.jetel.exception.JetelException: Incompatible Clover & JDBC field types - field memseqno Clover type: numeric caused by: java.sql.SQLException: Incompatible Clover & JDBC field types - field memseqno Clover type: numeric
at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:522)
at org.jetel.graph.Node.run(Node.java:366)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Incompatible Clover & JDBC field types - field memseqno Clover type: numeric
at org.jetel.connection.CopySQLData.jetel2sql(CopySQLData.java:162)
at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:539)
at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:518)
… 2 more
19:08:45,222 WARN [WatchDog] - Interrupted node: DATA_READER0
I get this message for whatever data type I try.
If I use byte this is not a big enough data type to handle what I will be passing or could be passing in the future.
Any ideas please?
I do have a work around which means running some code through Query Analyser / Enterprise Manager but this is not the way I would like to go as I would like to automate this.