db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damian Carey" <jami...@gmail.com>
Subject Re: How to get a Derby schema.sql so we can build the next DB?
Date Thu, 18 Dec 2008 11:15:47 GMT
On Thu, Dec 18, 2008 at 9:23 PM, Alan Burlison <Alan.Burlison@sun.com> wrote:
> Damian Carey wrote:
>> How do other people create their Derby schema?
>> And how do you "move" those schema to other (new) databases?
> We have a file with the DDL necessary to create the database embedded inside
> the application, and the first time the database is started we use
> ij.runScript() to run the script that creates create the new DB.
> http://src.opensolaris.org/source/xref/website/auth/AuthDb/src/org/opensolaris/auth/db/DbManager.java,
> method createDatabase (line 634).
> So we recreate the database schema from fresh rather than copying the old
> one.
> Alan Burlison

Thanks Alan,

The DbManager class is a fantastic resource that I will utilise.
Especially the runScript method for "ij", that I didn't notice in the
"Derby Tools and Utilities Guide".

Regarding the sql you pump in to the ij.runScript(...) method: It
sounds like you hand craft that?
Do you know if that SQL is the same format as the output from the
"dblook" tool?
If it is we can do the full round trip.

I just want the round-trip so I can get Hibernate to "design" the
original database schema, then we capture it (perhaps via dblook to
DDL), then we can write that schema to other new databases (via
ij.runScript(...)) when they are created at a customer's site.

I will certainly be running some tests in the morning.


View raw message