• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to retrieve a char data from resultset

 
Ketan Parekh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to retreive a char data from resultset but there is not method like rs.getChar(). I tried by defining a string variable and using rs.getString method and then using charAt method on String var but its not happening.

anyone can pls help me.

Thanks.
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tested the following in MySQL and found it working.

 
Ketan Parekh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks brother for the reply. I had earlier tried this way it was not working as mentioned in the post. But there was problem in the driver which connect sql server through jdbc odbc bridge, that if the column name are not in the order as defined in the table defination while retreiving resultset.

It worked finally well after arranging in the table defination order.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic