Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

But I have become passionate about making software.

How to Add a Derby Database with DerbyCFC

February 13, 2008

Two simple lines to add a Derby database with DerbyCFC:

<cfset variables.derbyCFC = createObject("component","derbyCFC").init(adminPassword)> <cfset variables.success = variables.derbyCFC.createIfNotExists(name)>

That will add a database with a datasource of the same name. The createIfNotExists function also takes in all the other potential settings for a datasource (select, insert, grant, etc). I made some small changes to the code base to make the creation possible in two lines and with this comes version 1 of DerbyCFC. I hope it proves useful for open source projects, let me know if you use it and if you have any suggestions.

It has been a fun little project to work on and interesting to delve a little more into the AdminAPI. Lots of good stuff in there.

No Comments

Some comments have been lost over the years due to moving hosts.


More blog entries that I have written.

Code coloring by PRISM.