I am using
DB2 UDB - Express 8.2,
WebSphere Application Server - Express 6.0.2
In machine m100 it is running ok with the java code that getting database connection and executing queries successfully (no exceptions throwing..)
In my machine I installed db2 and websphere and running the same java application .But it is throwing one exception while executing the queries like:
PreparedStatement ps = con.prepareStatement("select XX from table where id=?");
ps.setString(1,"123");
ResultSet rs = ps.executeQuery():
Exception com.ibm.db2.jcc.a.SqlException: The value of input host variable or parameter number "1" cannot be used because of its data type.
because 'id' field is type integer. so if I change to ps.setInt(1, 123); then it will work fine in my machine
But the same setString() is working fine in another machine(m100)..
Then why the same code (setString()) is not work on my machine????
Any reason???? plz help me..