> I have some complication currently. I have a table with
>
> passwordhash CHAR(20) BINARY
>
> column. Jooq generator interprets this column as string type currently. But
> actually it contains binary data of the password hash. And this creates a
> small complication because I need to treat this column as byte array in Java
> code, not a String. What is the best way to solve such a complication? I
> think it's not very good to store binary data in Java strings, right?

According to the documentation, BINARY should be the better data type for you:

http://dev.mysql.com/doc/refman/5.5/en/binary-varbinary.html

On the other hand, you can always invoke String.getBytes() to get the
String's underlying byte[] (usually UTF-8 encoded data. In your case,
it's true binary data, I guess).
But I'd prefer the BINARY data type...

Reply via email to