author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Tue, 12 Nov 2019 08:55:35 +0100 | |
changeset 414 | 0e707eef1e4a |
parent 364 | samples/livedb/build.xml@088d9d560bda |
permissions | -rw-r--r-- |
jtulach@355 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
jtulach@355 | 2 |
<project name="livedb" default="default" basedir="."> |
jtulach@359 | 3 |
<!-- BEGIN: livedb.derby.create --> |
jtulach@359 | 4 |
<target name="-check-db"> |
jaroslav@414 | 5 |
<property name="db" location="target/classes/db"/> |
jtulach@359 | 6 |
<available property="db.exists" file="${db}"/> |
jtulach@359 | 7 |
</target> |
jaroslav@414 | 8 |
<target name="create-db" description="Create a database on classpath" |
jaroslav@414 | 9 |
unless="db.exists" depends="-check-db" |
jaroslav@414 | 10 |
> |
jtulach@359 | 11 |
<mkdir dir="${db}"/> |
jtulach@359 | 12 |
<delete dir="${db}"/> |
jtulach@359 | 13 |
<echo message="Creating DB in ${db}"/> |
jaroslav@414 | 14 |
<sql classpath="${cp}" userid="j1" password="j1" |
jtulach@359 | 15 |
url="jdbc:derby:${db};create=true" |
jaroslav@414 | 16 |
driver="org.apache.derby.iapi.jdbc.AutoloadedDriver" |
jtulach@359 | 17 |
> |
jtulach@359 | 18 |
create table APP.AGE ( |
jtulach@359 | 19 |
NAME VARCHAR(30), |
jtulach@359 | 20 |
AGE NUMERIC(3) |
jtulach@359 | 21 |
); |
jtulach@359 | 22 |
insert into APP.AGE values ('apidesign', 3); |
jtulach@359 | 23 |
</sql> |
jtulach@359 | 24 |
<!-- don't forget to shutdown the DB --> |
jaroslav@414 | 25 |
<sql classpath="${cp}" userid="j1" password="j1" |
jtulach@359 | 26 |
url="jdbc:derby:${db};shutdown=true" |
jaroslav@414 | 27 |
driver="org.apache.derby.iapi.jdbc.AutoloadedDriver" |
jtulach@359 | 28 |
onerror="continue" |
jtulach@359 | 29 |
errorproperty="ignore.error" |
jtulach@359 | 30 |
failonconnectionerror="false" |
jtulach@359 | 31 |
>none</sql> |
jtulach@359 | 32 |
<echo message="DB created OK."/> |
jtulach@359 | 33 |
</target> |
jtulach@359 | 34 |
<!-- END: livedb.derby.create --> |
jtulach@355 | 35 |
</project> |