File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    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
 
Similar Threads
JDBC DB2 driver
dsn setup in websphere..
Performance problem in jdbc
Packed decimal conversion - Java
How to read char() for bit data DB2's type in Java?