jQuery in Action, 2nd edition
The moose likes JDBC and the fly likes JDBC and DB2 Char(n) FOR BIT DATA Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "JDBC and DB2 Char(n) FOR BIT DATA" Watch "JDBC and DB2 Char(n) FOR BIT DATA" New topic
Author

JDBC and DB2 Char(n) FOR BIT DATA

john jillella
Greenhorn

Joined: Sep 23, 2009
Posts: 3
Guys,
I have problem calling a Db2 pl/sql procedure which accepts char(n) for bit data.

Please let know suitable cs.setXXX method and corresponding JDBC datatype. An example is appreciated. Thank you
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

Have you tried setString()?


My Blog: Down Home Country Coding with Scott Selikoff
john jillella
Greenhorn

Joined: Sep 23, 2009
Posts: 3
Scott Selikoff wrote:Have you tried setString()?


Yes, I tried setString but doesn't work. Thanks.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

How about setBytes or setCharacterStream? I would just go through the ResultSet API and try the ones related to characters/string. Otherwise check the DB2 JDBC documentation and see if nchar is an unsupported type, although I doubt it's not supported.
john jillella
Greenhorn

Joined: Sep 23, 2009
Posts: 3
Scott Selikoff wrote:How about setBytes or setCharacterStream? I would just go through the ResultSet API and try the ones related to characters/string. Otherwise check the DB2 JDBC documentation and see if nchar is an unsupported type, although I doubt it's not supported.


I tried using setBytes. i'll try again tomorrow. In Db2 database it is shown as a binary value.

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JDBC and DB2 Char(n) FOR BIT DATA
 
Similar Threads
JDBC DB2 driver
Performance problem in jdbc
dsn setup in websphere..
How to read char() for bit data DB2's type in Java?
Packed decimal conversion - Java