diff --git a/README b/README index 857a2e2f0..4420f2d48 100644 --- a/README +++ b/README @@ -53,6 +53,8 @@ ------------- Documentation is available in HTML format, in the docs/ directory. + For building see docs/index.html#buildingant. + For installing see docs/index.html#installing. Licensing diff --git a/bootstrap.sh b/bootstrap.sh index 3090be30b..2b7ac80b6 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,12 +19,19 @@ else CLASSPATH=$LOCALCLASSPATH fi -if test -f $JAVA_HOME/lib/tools.jar ; then - CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar -fi - -if test -f $JAVA_HOME/lib/classes.zip ; then - CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip +if [ "$JAVA_HOME" != "" ] ; then + if test -f $JAVA_HOME/lib/tools.jar ; then + CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar + fi + + if test -f $JAVA_HOME/lib/classes.zip ; then + CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip + fi +else + echo "Warning: JAVA_HOME environment variable not set." + echo " If build fails because sun.* classes could not be found" + echo " you will need to set the JAVA_HOME environment variable" + echo " to the installation directory of java." fi TOOLS=src/main/org/apache/tools diff --git a/build.xml b/build.xml index c2b4b2855..936aae8a7 100644 --- a/build.xml +++ b/build.xml @@ -268,6 +268,7 @@ + diff --git a/docs/index.html b/docs/index.html index 9273245d5..d6b0ecbd1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
  • Dave Walend (dwalend@cs.tufts.edu)
  • -

    Version 1.2 - 2000/07/27

    +

    Version 1.2 - 2000/07/28


    Table of Contents

    @@ -585,6 +585,7 @@ If you do not want these default excludes applied, you may disable them with the
  • Taskdef
  • Touch
  • Tstamp
  • +
  • Sql
  • Style
  • Unjar
  • Untar
  • diff --git a/docs/sql.html b/docs/sql.html new file mode 100644 index 000000000..34fefc376 --- /dev/null +++ b/docs/sql.html @@ -0,0 +1,99 @@ + + + + + +

    Sql

    +

    Description

    +

    Executes a series of sql statement via JDBC to a database. Statements can either be read in from a text file using the src attribute or from between the enclosing sql tags.

    + +

    Multiple statements can be set and each statement is delimited from the next use a semi-colon. Individual lines within the statements can be commented using either -- or // at the start of the line.

    + +

    The auto-commit attribute specifies whether auto commit should be turned on or off whilst executing the statements. If auto-commit is turned on each statement will be executed and commited. If it is turned off the statements will all be executed as one transaction.

    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescriptionRequired
    driverClass name of the jdbc driverYes
    urlDatabase connection urlYes
    useridDatabase user nameYes
    passwordDatabase passwordYes
    srcFile containing sql statementsYes, unless statements enclosed within tags
    autocommitAuto commit flag for database connection (default false)No, default "false"
    + +

    Examples

    +
    <sql + driver="org.database.jdbcDriver" + url="jdbc:database-url" + userid="sa" + password="pass" + src="data.sql" +/> +
    + +

    Connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the sql statements contained within the file data.sql

    + +
    <sql
    +    driver="org.database.jdbcDriver"
    +    url="jdbc:database-url"
    +    userid="sa"
    +    password="pass"
    +    >
    +insert
    +into table some_table
    +values(1,2,3,4);
    +
    +truncate table some_other_table;
    +</sql>
    +
    + +

    Connects to the database given in url as the sa user using the org.database.jdbcDriver and executes the two sql statements inserting data into some_table and truncating some_other_table

    + +

    Note that you may want to enclose your statements in +<![CDATA[ ... ]]> sections so you don't +need to escape <, > & +or other special characters. For exampe:

    + +
    <sql
    +    driver="org.database.jdbcDriver"
    +    url="jdbc:database-url"
    +    userid="sa"
    +    password="pass"
    +    ><![CDATA[
    +
    +update some_table set column1 = column1 + 1 where column2 < 42;
    +
    +]]></sql>
    +
    + + + + diff --git a/src/bin/ant b/src/bin/ant index 5c173016e..385d77fe6 100644 --- a/src/bin/ant +++ b/src/bin/ant @@ -51,6 +51,11 @@ if [ "$JAVA_HOME" != "" ] ; then if test -f $JAVA_HOME/lib/classes.zip ; then LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip fi +else + echo "Warning: JAVA_HOME environment variable not set." + echo " If build fails because sun.* classes could not be found" + echo " you will need to set the JAVA_HOME environment variable" + echo " to the installation directory of java." fi $JAVACMD -classpath $LOCALCLASSPATH -Dant.home=${ANT_HOME} $ANT_OPTS org.apache.tools.ant.Main $@