Hi All,
I have a big problem. I need to insert data into a DB2 database (details below) from a java client (via JDBC). The problem is that I don't know the type of the columns so the insertion is: INSERT into TABLE1 (col1,col2) values ('value1','value2'), where value1 and value2 may be an integer or a String.
I try to better explain, my client receives 5 values and it doesn't know the structure of the db, it knows that the first values is the table name, the second and the third are the name of columns and the fourth and fifth are the values, but it doesn't know the type (INT,CHAR,....). This client uses four different db, SQL server, mysql, Informix and DB2. For all the others db I add the quotes for each value (like in the insert above) and the insertion ends with success, instead DB2 returns an error, it doesn't succeed to make the insertion.
How can I force the insertion? Is there a configuration value to set to allow the insertion to succeed?
For the test I created a test table (TestTable (id INTEGER, name VARCHAR)) and I want to make this insertion: INSERT into TestTable (id,name) values ('1','Tom').
Details DB2:
DB2 Express-C
version: v9.5.0.808
Fix Pack: 0
Details OS:
Windows XP Professional 2002
Service pack 3
Many Thanks
Davide Guidotti