bodewig 2003/04/09 06:15:31
Modified: . WHATSNEW
docs/manual/CoreTasks sql.html
src/main/org/apache/tools/ant/taskdefs SQLExec.java
Log:
Provide user control over Statement's escape processing.
PR: 18822
Revision Changes Path
1.391 +2 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.390
retrieving revision 1.391
diff -u -r1.390 -r1.391
--- WHATSNEW 9 Apr 2003 12:47:41 -0000 1.390
+++ WHATSNEW 9 Apr 2003 13:15:31 -0000 1.391
@@ -223,6 +223,8 @@
* <javacc> and <jjtree> will now autodetect JavaCC 3.x and can use it.
+* <sql> has a new attribute to control escape processing.
+
Changes from Ant 1.5.2 to Ant 1.5.3
===================================
1.20 +10 -0 ant/docs/manual/CoreTasks/sql.html
Index: sql.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/sql.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- sql.html 4 Apr 2003 08:50:07 -0000 1.19
+++ sql.html 9 Apr 2003 13:15:31 -0000 1.20
@@ -139,6 +139,16 @@
<td width="10%" valign="top">No (defaul=false)</td>
</tr>
+<tr>
+ <td width="12%" valign="top">escapeprocessing</td>
+ <td width="78%" valign="top">Control whether the Java statement
+ object will perform escape substitution.<br>
+ See <a
+
href="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#setEscapeProcessing(boolean)">Statement's
+ API docs</a> for details. <em>since Ant 1.6</em>.
+ <td width="10%" valign="top">No (defaul=true)</td>
+</tr>
+
</table>
<h3>Parameters specified as nested elements</h3>
1.53 +17 -1 ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
Index: SQLExec.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- SQLExec.java 4 Apr 2003 13:51:11 -0000 1.52
+++ SQLExec.java 9 Apr 2003 13:15:31 -0000 1.53
@@ -210,6 +210,13 @@
private boolean keepformat = false;
/**
+ * Argument to Statement.setEscapeProcessing
+ *
+ * @since Ant 1.6
+ */
+ private boolean escapeProcessing = true;
+
+ /**
* Set the name of the SQL file to be run.
* Required unless statements are enclosed in the build file
*/
@@ -328,6 +335,15 @@
}
/**
+ * Set escape processing for statements.
+ *
+ * @since Ant 1.6
+ */
+ public void setEscapeProcessing(boolean enable) {
+ escapeProcessing = enable;
+ }
+
+ /**
* Load the sql file and then execute it
*/
public void execute() throws BuildException {
@@ -375,7 +391,7 @@
}
try {
statement = conn.createStatement();
-
+ statement.setEscapeProcessing(escapeProcessing);
PrintStream out = System.out;
try {