You might want to check the datatype of your columns in DB2, make sute its "varchar", you will get this error if there is conflict with data types meaning your setting in your string in your prepared statemnent as shown below:
But one of them might not be a proper data type in db2, that's why it will go in an invalid state, if you still have problems, post you Table ddl for you Libaray.table1, i will take a look at it. What version of db2 you are using?
You might also want to specify in your insert statements:
INSERT INTO LIBRARY.TABLE1(DB2_FIELD1, DB2_FIELD2) VALUES(?,?)
If still doesn't work then try the following statement , just to see if you can insert it:
INSERT INTO LIBRARY.TABLE1 (DB2_FIELD1, DB2_FIELD2) VALUES('A','B')
At least this will give you an idea that there is nothing wrong with the datatypes in db2.
Let me know if it helps.