I am using DB2 UDB 8.1 on windows 2000

I am using DB2 type 4 driver (com.ibm.db2.jcc.DB2Driver) from the db2jcc.jar library. When I do a setObject on a preparedstatement I get an illegal conversion exception.

The column on which this error occurs is of type char(13) for bit data.

Could someone tell me what I am doing wrong or is this a type 4 driver bug that has been fixed in a newer version.

I did not have this problem when I used type 2 driver from db2java.zip library using COM.ibm.db2.jdbc.net.DB2Driver driver.

Here is my code fragment and the exception.

pstmt = con.prepareStatement(updateStmt.toString());
pstmt.setObject(bindIndex, rowStampValue);

com.ibm.db2.jcc.b.SQLException: Illegal Conversion
at com.ibm.db2.jcc.b.n.a(n.java:568)
at com.ibm.db2.jcc.b.cf.setString(cf.java:558)
at com.ibm.db2.jcc.b.cf.setObject(cf.java:766)

Thanks in advance.