db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: Does derby support .sql files?
Date Wed, 16 Feb 2005 08:28:18 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Just to provide an example, IJ has the following RUN command to run sql
files.<br>
<br>
C:\p4clients\sat_52&gt;java -Dij.protocol=jdbc:derby:
org.apache.derby.tools.ij<br>
ij version 10.1<br>
ij&gt; <b>run 'test.sql';</b><br>
ij&gt; connect 'jdbc:derby:tdb;create=true';<br>
ij&gt; create table t (i int, j int, c char(10));<br>
0 rows inserted/updated/deleted<br>
ij&gt; insert into t values (1, 1, 'satheesh'), (2,2, 'bandaram');<br>
2 rows inserted/updated/deleted<br>
<br>
Type <b>help;</b> in IJ to see all other options.<br>
<br>
Satheesh<br>
<br>
Jeremy Boynes wrote:<br>
<blockquote cite="mid4212EA1C.10902@apache.org" type="cite">Ruta Kadhe
wrote:
  <br>
  <blockquote type="cite">Hi,
    <br>
Consider Derby in embeded mode.
    <br>
When database is to be created in embeded mode, is their any support
    <br>
in Derby to run .sql file which has Database Creation scripts?
    <br>
    <br>
  </blockquote>
  <br>
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).
  <br>
  <br>
You can also use the &lt;sql&gt; Ant task to execute scripts during a
build.
  <br>
  <br>
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.
  <br>
  <br>
The resulting database is portable between servers (and encryptable) so
you may not need to run scripts in a target environment.
  <br>
  <br>
--
  <br>
Jeremy
  <br>
  <br>
  <br>
</blockquote>
</body>
</html>

Mime
View raw message