{"id":137,"date":"2011-03-21T19:50:07","date_gmt":"2011-03-21T19:50:07","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=137"},"modified":"2011-05-30T17:43:09","modified_gmt":"2011-05-30T17:43:09","slug":"coldfusion-varbinary-fields","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/coldfusion-varbinary-fields\/","title":{"rendered":"ColdFusion \/ JDBC \/ MySQL &#038; VarBinary fields"},"content":{"rendered":"<p>If you&#39;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.<\/p>\n<p>If you <a class=\"target-blank\" href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/cast-functions.html#function_cast\">cast<\/a> the value as a char before returning it, that should resolve the issue. i.e.<\/p>\n<p><code>select user_id, user_username, cast(aes_decrypt(user_password, &#39;mykey&#39;) as CHAR) as user_password<br \/>\n\tfrom user<br \/>\n\t<\/code><\/p>\n<p>&nbsp;<\/p>\n<p>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).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#39;ve used a varbinary field to store data, such as an encrypted password, you mind find that the JDBC Connector (used by ColdFusion) falls&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[34,13],"tags":[64,63],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":2,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}