0

How to Add a Derby Database with DerbyCFC

ColdFusion, DerbyCFC

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.


Search

Twitter
You should follow me on Twitter here
About Me
I am a 34-year old Web Developer specializing in ColdFusion. I live and work in downtown Washington, DC with my wife and two daughters. Read more About Me

2007 CFeMmy Best Newcommer winner
As voted on by fellow CF Bloggers.
CFinNC - Carolina ColdFusion / Flex / Air Conference - Oct 17-18, 2009