Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008


    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=?");
    ResultSet rs = ps.executeQuery():

    Exception 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..

  2. #2
    Join Date
    Jan 2008
    I fixed it

    I removed the classpath
    from websphere JDBC provider classpath
    and added another path to db2jcc.jar like F:/DB2/db2jcc.jar

    to day I go through the site

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts