You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Ruta Kadhe <ru...@gmail.com> on 2005/02/16 07:24:59 UTC

Does derby support .sql files?

Hi,
Consider Derby in embeded mode.
When database is to be created in embeded mode, is their any support
in Derby to run .sql file which has Database Creation scripts?

If not, is there any alternative method by which we can read the
scripts and run those scripts to create database?

Thanks & Regards,
Ruta

Re: Does derby support .sql files?

Posted by Jeremy Boynes <jb...@apache.org>.
Ruta Kadhe wrote:
> Hi,
> Consider Derby in embeded mode.
> When database is to be created in embeded mode, is their any support
> in Derby to run .sql file which has Database Creation scripts?
> 

You can use ij to execute SQL scripts (although you may tweak the syntax 
e.g. for statement delimiters if you are porting from another database).

You can also use the <sql> Ant task to execute scripts during a build.

In both cases you would not start your application but use the embedded 
driver from ij/ant to create it directly; once created, you can run the 
application normally.

The resulting database is portable between servers (and encryptable) so 
you may not need to run scripts in a target environment.

--
Jeremy