Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving, getting byte[ ]

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I have MySQl server.
my database will store the username and his password.
the application will not store the password as a plain text, instead, the application will compute the digest of the password (using MessageDigest class), so the application will save the password as byte[ ] type.
my questions are :
1. what is the type of byte[ ] should be in the database ?
2. to store byte[ ] in the database we use :
resultset.updateBytes(...);
and to retrieve byte[ ] we use :
resultset.getBytes(...);
right ??
thanks ranchers.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
1) Take a look at section 8.3.2 of Sun's document about the BINARY type.
2) Yes, your calls are correct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic