get array of bytes from database

Hi,,

am encrypted amessage and store it as abyte at the sql database ( the datta type is varchar )..

now i retreive this message from the database but the result dosesen't mach the stored array?why?

how i can store and retreive array of bytes at sql database?

please help me fast>>

[319 byte] By [javaanimatora] at [2007-11-27 3:40:44]
# 1
Varchar is character-based, and you are talking about bytes. How do you convert?
BIJ001a at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 2
if you want to store bytes, use BLOB
kdajania at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 3
Thanks,,am hava sql server 2000 and i search fro the datatype you say (BLOB) but i don't get it...can you clarify to me how i can found it ? or if it has alternative name at sql 2000 please post it to me with my great thanks...
javaanimatora at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 4
You could apply say base64 encoding to the binary data and so store textually. BLOB is the SQL data type "binary large object," for something like an image etc.
BIJ001a at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 5
Hi,can you clarify to me what do you mean by " base64 encoding to the binary data "?please give me an example if you can ?thanks,,
javaanimatora at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 6
Some trivial googling yields: http://en.wikipedia.org/wiki/Base64 http://www.freesoft.org/CIE/RFC/1521/7.htm
BIJ001a at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 7
thanks in your advance,,,but i ask for a java code that do this concept....I you have it please help me?thanks again,,,
javaanimatora at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...
# 8
Look again (or look). There is lots of Java code referenced by at least the first of those links.
ejpa at 2007-7-12 8:44:12 > top of Java-index,Core,Core APIs...