SiteKickr Web Development

ColdFusion / JDBC / MySQL & VarBinary fields

If you've used a varbinary field to store data, such as an encrypted password, you mind find that the JDBC Connector (used by ColdFusion) falls short when returning the value.

If you cast the value as a char before returning it, that should resolve the issue. i.e.

select user_id, user_username, cast(aes_decrypt(user_password, 'mykey') as CHAR) as user_password
from user

 

Note: This approach also comes in handy when the JDBC / ColdFusion connector decides to arbitrarily return a result column as a BINARY field (often the case when using the GROUP_CONCAT function).