• Post Reply Bookmark Topic Watch Topic
  • New Topic

getBytes()

 
Jardel Tan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Byte eng
while (rs.next()) {
eng = rs.getBytes("trial");
}
i retrieve error Can't convert byte[] to java.lang.Byte
hi how to getBytes() instead of getString()from databases
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you don't have your byte defined as an array. What you have, if it could work, would only be able to contain the first byte
try... byte eng[] = getbytes("test");
HTH
Dan
 
Jardel Tan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx!
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!