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 02:58:08 GMT
On Thu, Dec 18, 2008 at 12:59 PM, Stephan van Loendersloot (LIST)
<stephan@republika.nl> wrote:
> Damian Carey wrote:
>>> On Wed, Dec 17, 2008 at 7:24 PM, Damian Carey <jamianb@gmail.com> wrote:
>>>> Hi all,
>>>> We're long term Java-Desktop-App-via-Hibernate-On-Postgres users
>>>> trying to transition to Derby.
>>>> When we deploy a new site we want to be able to (1) create the fresh
>>>> database then (2) "run" schema.sql to construct the database schema,
>>>> prior to (3) running the app and adding the data.
>> So I'm looking for a way to get the SQL so that we can create the
>> database on the fly for each new customer.
>> We currently also use that "SQL-on-startup" to modify the schema from
>> time to time.  It works like a charm with our Postgres infrastructure,
>> but I'm not sure how best to retain those capabilities with Derby.
>> Cheers,
>> -Damian
> Hi Damian,
> I think your best bet is using the 'dblook' command-line utility for getting
> a schema dump that can be fed into the 'ij' command-line utility. Both are
> part of Derby and you can find more information on how to use them in the
> 'Derby Tools and Utilities Guide':
> http://db.apache.org/derby/docs/dev/tools/
> Regards,
>   Stephan.

Thanks Stephan,
I was successfully using "dblook" to extract the schema to file, but I
can't see where to use the "ij" tool to pump that into a new database.

How do other people create their Derby schema?
And how do you "move" those schema to other (new) databases?

I've been creating my schemas using Hibernate, but that is a "dev"
tool and not for production use, so we do schema creation and testing
here in house, and only ship the proven schema to install at a
customer's site.
So I can create a schema, but now I just want a way to get the schema
out of one database into all my new databases.

Any suggestions welcome!
Thanks you,

View raw message