How to View Bit Values in MySQL Query Browser
I stumbled across this useful tidbit the other day in the MySQL Forums. I’ve always been frustrated that bit data type values fail to appear in MySQL Query Browser. Instead, it simply displays a ‘b’ regardless of the actual value.
I looked through all of the options but couldn’t find a setting related to the issue. The solution (workaround) turned out to be very easy. Just add 0 to the column in the SELECT list and the values will appear.
For example:
SELECT myBooleanColumn + 0 as myBooleanColumn FROM myTable
Either a 1 or a 0 will now appear as the value in the results.
Update ColdFusion Query Columns With JavaCast
I recently found myself in need of a way to convert a Binary data column into Base64 encoded data when returning a query. After a quick Google, I was directed to Ben Nadel’s post “Updating Columns In An Existing ColdFusion Query Object” which details how to use javaCast to update a ColdFusion query.
From there, I just needed to add the small extra step of Base64 encoding and my query was ready to go.
<cfloop query="q">
<cfset base64Data = toBase64(q.my_binary_data) />
<cfset q["my_binary_data"][q.currentRow] = javaCast("string",'#base64Data#') />
</cfloop>
This is not the first time I found a useful solution on Ben’s site. If you use ColdFusion, you should definitely check it out. He has some great, easy-to-understand, posts on many useful topics.
10 Easy Steps to set up Model-Glue 2: Unity on a Shared Host
Once I had it working, I was astounded by the simplicity. The only pre-requisite is that your server is running ColdFusion 8 or above. Here are the steps:
Note that the following steps assume your site is already created
- Download ColdSpring.
- Unzip ColdSpring, rename the unzipped folder to “coldspring” and copy it into your site root.
- Download Model-Glue.
- Unzip the Model-Glue archive into a temp folder.
- Copy the Model-Glue folder into your site root.
- Copy the contents of the /modelglueapplicationtemplate directory to your site root. Do NOT copy the folder itself.
- From your site root, open /config/ColdSpring.xml and delete the two occurrences of “/modelglueapplicationtemplate” on lines 12 and 13. This should result in your viewMappings being “/views” and your generatedViewMapping being “/views/generated”
- From your site root, open /config/ModelGlue.xml and delete “modelglueapplicationtemplate.” from line 3 making it “controller.Controller” instead of “modelglueapplicationtemplate.controller.Controller”.
- Delete Application.cfm from your site root and replace it with the Application.cfc in this zip file.
- Open Application.cfc and change the application name from yourAppNameHere to your application name. If you don’t know what to use, use your domain minus the dot, i.e., “myDomainCOM”.
Providing your server is running ColdFusion 8 or above, you should now have a working Model-Glue site! To test it, open the site in your browser and you should see a message stating “Model-Glue is up and running!”
-rG


