How to Add a Derby Database with DerbyCFC
ColdFusion, DerbyCFCTwo 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.
DerbyCFC: New Project with createIfNotExists function for Derby Databases
ColdFusion 8, DerbyCFCI've just released version 0.9 of DerbyCFC on RIAForge which is designed to make it easier to work with the Derby database embedded in ColdFusion 8.
DerbyCFC comes with two functions; createIfNotExists which does pretty much what it says and will create a new Derby datasource and database. getDerbyDatasources returns all Derby datasources in either raw format (a collection of structures) or as a query with a slightly smaller set of attributes.

The download zip includes example pages for creating a datasource and listing of current datasources. Go to the DerbyCFC project page.
I'm debating whether to extend this to provide a UI that would list and edit tables in a Derby database so let me know your thoughts. My hope is that this will make it easier to create Derby databases for other open source projects.






Loading....