If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > com.ibm.db2.jcc.a.SqlException:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-08, 01:21
david_david david_david is offline
Registered User
 
Join Date: Jan 2008
Posts: 8
com.ibm.db2.jcc.a.SqlException:

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..
Reply With Quote
  #2 (permalink)  
Old 02-15-08, 01:50
david_david david_david is offline
Registered User
 
Join Date: Jan 2008
Posts: 8
I fixed it

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


to day I go through the site
http://publib.boulder.ibm.com/infoce...eqdb2dist.html

jpulikkottil@gmail.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On