aspose file tools*
The moose likes JDBC and the fly likes JDBC and DB2 Char(n) FOR BIT DATA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

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://aspose.com/file-tools
 
subject: JDBC and DB2 Char(n) FOR BIT DATA