Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC and DB2 Char(n) FOR BIT DATA  RSS feed

 
john jillella
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried setString()?
 
john jillella
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott Selikoff wrote:Have you tried setString()?


Yes, I tried setString but doesn't work. Thanks.
 
Scott Selikoff
author
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!