wood burning stoves*
The moose likes JDBC and the fly likes column type to save byte array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "column type to save byte array" Watch "column type to save byte array" New topic

column type to save byte array

Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
Hi All,
I'm having problems saving and retrieving byte arrays in my logon bean from the database, which is mySQL and sometimes Oracle.
I'm hashing a password and saving it and a salt, both as byte arrays, into varchar fields in the database. When I retrieve them, they have changed.
Should I use a different column data type?
While debugging it, I checked to make sure that at least in Java, if I convert a byte array to a string and back to a byte array again, it remains the same.
Thanks in advance for any help!


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 565
I'm still flummoxed by this. Does anybody have any advice please?
I've been looking at blob type fields, but they seem to be totally over the top and use extra resources.
All I want is a field to reliably save the output from my String.toBytes() function.
I agree. Here's the link: http://aspose.com/file-tools
subject: column type to save byte array
Similar Threads
convert existed database to record store
Store char[] as column type
how to insert a byte array into an MS Access database
Adding byte arrays
Playing around with 2D arrays