You're making it too difficult. Use something like Commons Codec, to base64 encode your string before you save it and base64 decode when you read it out of the database. Converting from byte[] to...