From b9421dc80af485591a9c50cc8921f912e0def11e Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 23 Oct 2015 10:05:40 -0700 Subject: Removing sources to replace with download links instead. Change-Id: Ie28789a725051aec0d1b04dd291b7690a7898668 Signed-off-by: Ashlee Young --- .../src/ant/apache-ant-1.9.6/manual/Tasks/sql.html | 511 --------------------- 1 file changed, 511 deletions(-) delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Tasks/sql.html (limited to 'framework/src/ant/apache-ant-1.9.6/manual/Tasks/sql.html') diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Tasks/sql.html b/framework/src/ant/apache-ant-1.9.6/manual/Tasks/sql.html deleted file mode 100644 index e5f4db83..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Tasks/sql.html +++ /dev/null @@ -1,511 +0,0 @@ - - - - - -SQL Task - - - -

Sql

-

Description

-

Executes a series of SQL statements 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 provided, separated by semicolons (or the -defined delimiter). Individual lines within the statements can be -commented using either --, // or REM at the start of the line.

- -

The autocommit 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 committed. If it is turned off the -statements will all be executed as one transaction.

- -

The onerror attribute specifies how to proceed when an error occurs -during the execution of one of the statements. -The possible values are: continue execution, only show the error; -stop execution, log the error but don't fail the task -and abort execution and transaction and fail task.

- -

-Proxies. Some JDBC drivers (including the Oracle thin driver), - use the JVM's proxy settings to route their JDBC operations to the database. - Since Apache Ant1.7, Ant running on Java1.5 or later defaults to - using - the proxy settings of the operating system. - Accordingly, the OS proxy settings need to be valid, or Ant's proxy - support disabled with -noproxy option. -

- -

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
encodingThe encoding of the files containing SQL statementsNo - defaults to default JVM encoding
outputencodingThe encoding of the files holding - results. since 1.9.4 - No - defaults to default JVM encoding
delimiterString that separates SQL statementsNo, default ";"
autocommitAuto commit flag for database connection (default false)No, default "false"
printPrint result sets from the statements (default false)No, default "false"
showheadersPrint headers for result sets from the statements (default true)No, default "true"
showtrailersPrint trailer for number of rows affected (default true)No, default "true"
outputOutput file for result sets (defaults to System.out) - Since Ant 1.8 can specify any Resource that supports output (see - note). - No (print to System.out by default)
appendwhether output should be appended to or overwrite - an existing file. Defaults to false.No, ignored if output does not - specify a filesystem destination.
classpathClasspath used to load driverNo (use system classpath)
classpathrefThe classpath to use, given as a reference to a path defined elsewhere.No (use system classpath)
onerrorAction to perform when statement fails: continue, stop, abortNo, default "abort"
rdbmsExecute task only if this rdbmsNo (no restriction)
versionExecute task only if rdbms version matchNo (no restriction)
cachingShould the task cache loaders and the driver?No (default=true)
delimitertypeControl whether the delimiter will only be recognized on a line by itself.
- Can be "normal" -anywhere on the line, or "row", meaning it must be on a line by itself
No (default:normal)
keepformatControl whether the format of the sql will be preserved.
- Useful when loading packages and procedures. -
No (default=false)
escapeprocessingControl whether the Java statement - object will perform escape substitution.
- See Statement's - API docs for details. Since Ant 1.6. -
No (default=true)
expandpropertiesSet to true to turn on property expansion in - nested SQL, inline in the task or nested transactions. Since Ant 1.7. - No (default=true)
rawblobsIf true, will write raw streams rather than hex encoding when - printing BLOB results. Since Ant 1.7.1.No, default false
failOnConnectionErrorIf false, will only print a warning - message and not execute any statement if the task fails to connect - to the database. Since Ant 1.8.0.No, default true
strictDelimiterMatchingIf false, delimiters will be searched - for in a case-insensitive manner (i.e. delimiter="go" matches "GO") - and surrounding whitespace will be ignored (delimiter="go" matches - "GO "). Since Ant 1.8.0.No, default true
showWarningsIf true, SQLWarnings will be logged at - the WARN level. Since Ant 1.8.0.
- Note: even if the attribute is set to false, warnings that - apply to the connection will be logged at the verbose level.
No, default false
treatWarningsAsErrorsIf true, SQLWarnings will be treated - like errors - and the logic selected via the onError attribute - applies. - Since Ant 1.8.0.No, default false
csvColumnSeparatorThe column separator used when printing - the results. - Since Ant 1.8.0.No, default ','
csvQuoteCharacterThe character used to quote column - values.
- If set, columns that contain either the column separator or the - quote character itself will be surrounded by the quote character. - The quote character itself will be doubled if it appears inside of - the column's value.
- Note: BLOB values will never be quoted. - Since Ant 1.8.0.
No, default is not set (i.e. no quoting - ever occurs)
errorpropertyThe name of a property to set in the event of an - error. Since Ant 1.8.0No
warningpropertyThe name of a property to set in the event of an - warning. Since Ant 1.8.0No
rowcountpropertyThe name of a property to set to the number of rows - updated by the first statement/transaction that actually returned - a row count. Since Ant 1.8.0No
- -

Parameters specified as nested elements

-

transaction

-

Use nested <transaction> -elements to specify multiple blocks of commands to the executed -executed in the same connection but different transactions. This -is particularly useful when there are multiple files to execute -on the same schema.

- - - - - - - - - - - -
AttributeDescriptionRequired
srcFile containing SQL statementsYes, unless statements enclosed within tags
-

The <transaction> element supports any resource or single element -resource collection as nested element to specify the resource -containing the SQL statements.

- -

any resource or resource -collection

- -

You can specify multiple sources via nested resource collection -elements. Each resource of the collection will be run in a -transaction of its own. Prior to Ant 1.7 only filesets were -supported. Use a sort resource collection to get a predictable order -of transactions.

- -

classpath

-

Sql's classpath attribute is a PATH like structure and can also be set via a nested -classpath element. It is used to load the JDBC classes.

- -

connectionProperty

-

Since Ant 1.8.0

-

Use nested <connectionProperty> elements to - specify additional JDBC properties that need to be set when - connecting to the database.

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
nameName of the propertyYes
valueValue of the propertyYes
- -

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"
-    src="data.sql">
-  <connectionProperty name="internal_logon" value="SYSDBA">
-</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. Also sets the -property internal_logon to the value SYSDBA.

- -
<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. Ant Properties - in the nested text will not be expanded.

- -

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

- -
<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>
-
- -The following command turns property expansion in nested text on (it is off purely for backwards -compatibility), then creates a new user in the HSQLDB database using Ant properties. - -
<sql
-    driver="org.hsqldb.jdbcDriver";
-    url="jdbc:hsqldb:file:${database.dir}"
-    userid="sa"
-    password=""
-    expandProperties="true"
-    >
-  <transaction>
-    CREATE USER ${newuser} PASSWORD ${newpassword}
-  </transaction>
-</sql>
-
- - -

The following connects to the database given in url as the sa user using -the org.database.jdbcDriver and executes the SQL statements contained within -the files data1.sql, data2.sql and data3.sql and then executes the truncate -operation on some_other_table.

- -
<sql
-    driver="org.database.jdbcDriver"
-    url="jdbc:database-url"
-    userid="sa"
-    password="pass" >
-  <transaction  src="data1.sql"/>
-  <transaction  src="data2.sql"/>
-  <transaction  src="data3.sql"/>
-  <transaction>
-    truncate table some_other_table;
-  </transaction>
-</sql>
-
- -

The following example does the same as (and may execute additional -SQL files if there are more files matching the pattern -data*.sql) but doesn't guarantee that data1.sql will be -run before data2.sql.

- -
<sql
-    driver="org.database.jdbcDriver"
-    url="jdbc:database-url"
-    userid="sa"
-    password="pass">
-  <path>
-    <fileset dir=".">
-      <include name="data*.sql"/>
-    </fileset>
-  </path>
-  <transaction>
-    truncate table some_other_table;
-  </transaction>
-</sql>
-
- -

The following 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, with output piped to outputfile.txt, searching /some/jdbc.jar -as well as the system classpath for the driver class.

- -
<sql
-    driver="org.database.jdbcDriver"
-    url="jdbc:database-url"
-    userid="sa"
-    password="pass"
-    src="data.sql"
-    print="yes"
-    output="outputfile.txt"
-    >
-<classpath>
-	<pathelement location="/some/jdbc.jar"/>
-</classpath>
-</sql>
-
- -

The following will only execute if the RDBMS is "oracle" and the version -starts with "8.1."

- -
<sql
-    driver="org.database.jdbcDriver"
-    url="jdbc:database-url"
-    userid="sa"
-    password="pass"
-    src="data.sql"
-    rdbms="oracle"
-    version="8.1."
-    >
-insert
-into table some_table
-values(1,2,3,4);
-
-truncate table some_other_table;
-</sql>
-
- - - - -- cgit 1.2.3-korg