November 21, 2008

Pages


Search Site


Topics



Archives

Tweets

Entries Tagged as 'Databases'

Modifying Illudium to return the ID of an inserted row in CF8

April 28 2008 by Adam
I've been working on a project where we're using Illudium to generate some objects (beans, dao's, and gateways) to speed up our development process. We also happen to be using ColdFusion 8, which means we have access to great new features, like the primary key return value from an insert query. During a presentation on how to use Illudium and how it saves us time and effort, my team saw that I was: (1) Inserting a record, then (2) Creating a bean with all of the properties of that record except its missing id value, and then (3) searching for the matching record — so that I could use its ID in related code; and asked if there was any way to improve that. That's when it dawned on me that CF8 returns the primary key value (in most cases — Oracle just returns the "RowID" which can be used to look up the primary key), for just this reason. By the end of the day I had modified the XSLT template for the Create function in the DAO object that's packaged with Illudium to return this value instead of true or false indication of success — and with no prior knowledge or experience with XSLT. It was simple to extend my code so that it wouldn't error on earlier versions of ColdFusion (instead of the primary key value, it will return 1/-1 for success/failure), and also to account for other database types. All types documented by Adobe are supported here. Here's the updated code for create.xsl. Note that the majority of what I changed is at the end: [viewcode] src="create.xsl.txt" showsyntax=no geshi=xml scroll="yes" scrollheight="300px" link="yes" [/viewcode] And here's an example create function I made from the ART table of the CFArtGallery example datasource: [viewcode] src="fn_create.txt" showsyntax=no geshi=cfm scroll="yes" scrollheight="300px" [/viewcode] Brian Rinaldi, the creator of Illudium, offered to help me out if I got stuck, but honestly he's done such a good job architecting Illudium to be easily extended that it was a piece of cake. Thanks again for the awesome code generator, Brian!

Posted in ColdFusion | ColdFusion 8 | Databases |

Free license for Aqua Data Studio (OS X) for O.S. Developers

July 30 2007 by Adam
Since switching to my MacBook last December I have had but one regret: The lack of MS SQL Server Enterprise Manager. I quickly found Aqua Data Studio, but as a hobbyist I can't justify the cost of a personal license, and as one of few Apple nerds at my company, I couldn't convince them to buy the license for me. I have been able to get by using phpMyAdmin (gasp! php!) for MySQL databases, and a Windows laptop when I absolutely must, for MS SQL Server. Today I saw Ray Camden's post on how Aqua Fold gave him a free license because he develops Open Source software, and I fired off an email of my own. Within the hour (I bet this is also reflected in their tech support), not only did they reply asking for my personal information to fill out the license registration, but they offered me the beta of version 6.5 of ADS (which should be a public-beta in a few weeks, and launched around September). There has been some recent discussion in the CFBloggers discussion group about advertising in your blog, and in particular, giving the impression that you are presenting an objective view, even when the possibility exists that your opinion has been biased (as it might if you were given a free license). So to keep this as objective as possible, here are some cold, hard, facts:
  • Aqua Data Studio is the only DBMS GUI for OS X that I have found, that isn't in its infancy and / or doesn't just plain suck. (The part about sucking is my opinion)
  • ADS supports a ton of different DBMS'.
  • I used the free trial, and based on that, really, really wanted a license; but eventually uninstalled the trial after it expired, shedding a single tear.
  • Aqua Fold will give you a free license for Open Source use.
Draw from that whatever you want. For me, it means more productivity, and one new icon in my dock.

Posted in Apple | Databases |