Storing a byte array in MS-SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mswombat
    New Member
    • Feb 2007
    • 1

    Storing a byte array in MS-SQL

    Hi,
    I'm new to the forums and new to Java. I have a byte[] field which contains encrypted data that I need to store in a SQL database. I'm trying to store this data in a varbinary field in SQL but don't know how to do this. I keep getting SQL exception errors.

    Do I need to do any conversions to store the byte[] into a varbinary, and then retrieve the varbinary from sql and then convert back to a byte array.


    Thanks,
    Cassandra.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    mswombat-

    Could you post your error messages and code?

    Just a guess, but if your'e getting class not found errors, you probably need to declare/register/attach the driver, but we could help more if the code and errors were available.

    sicarie

    Comment

    Working...