ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe McGlynn" <mcgl...@onetouch.com>
Subject Ant target using "java" to create PointBase db
Date Sat, 30 Dec 2000 16:54:05 GMT
This is a tough question to ask succinctly, so please bear with me.

I want to use Ant to automate my builds, which include creating a new SQL
database instance using PointBase (a commercial Java-based ORDBMS).  They
have a command line utility that will create an "empty" db and execute a SQL
script (to create tables and so forth).  I have done this via a DOS BAT
file, so I'm sure this part works.

I get as far as the PointBase tool creating the new empty database, but it
never runs the script.  The name of the script is an argument to the
PointBase utility, which must see all of the other parameters just fine.  At
this point I am using Ant from within netbeans IDE.

I'm attaching the Ant code below, any suggestions would be hugely
appreciated.  (I know the classpath here is not done in a very nice way, but
this is just scaffolding to get this part of the build to work, I'll figure
out how to get Ant to not rely on fixed -CP later)

TIA,
Joe

================

<?xml version="1.0"?>

<!--*********************************************************-->
<!-- Ant build routine for SW Process project SQL database   -->
<!-- developed by Joe McGlynn, 12/26/00                      -->
<!-- all rights reserved, distributable under GPL            -->
<!--*********************************************************-->

<project name="build_database" basedir="." default="all">

    <!--*********************************************************-->
    <!-- define global properties for this build step            -->
    <!--*********************************************************-->
    <property name="src.sql" value="${basedir}\dbsource.sql"/>
    <property name="dbtarget" value="d:\pb\network\databases"/>
    <property name="DBNAME" value="swproc"/>
    <property name="dba.uid" value="public"/>
    <property name="dba.pwd" value="public"/>

    <target name="init">
        <tstamp/>
        <echo message="Begining  database creation on ${TODAY} at
${TSTAMP}"/>
        <echo message="executing from ${basedir}"/>
    </target>

    <target name="all" depends="init, MakeSchema">
        <!-- <echo message="Hello ${world}!"/> -->
    </target>

    <!--*********************************************************-->
    <!-- Use the PointBase commander utility                     -->
    <!-- to create an empty database                             -->
    <!-- and populate it with application tables                 -->
    <!--*********************************************************-->
    <target name="MakeSchema" depends="init">
        <echo message="begining target MakeSchema at ${TSTAMP} using
${src.sql}"/>
        <java classname="com.pointbase.tools.toolsCommander" fork="true">
            <classpath>
                <pathelement
location="D:\pb\client\classes\pbtools34GA.jar"/>
                <pathelement
location="D:\pb\client\classes\pbclient34GA.jar"/>
                <pathelement location="D:\pb\client"/>
            </classpath>
            <arg value="com.pointbase.jdbc.jdbcUniversalDriver" />
            <arg value="jdbc:pointbase://localhost/${DBNAME},new ${src.sql}"
/>
            <arg value="${dba.uid} ${dba.pwd}" />
        </java>
        <echo message="completed target MakeSchema at ${TSTAMP} using
${src.sql}"/>
    </target>


</project>


Mime
View raw message