From 48d010f5457affb14a8bad1b578415b561936a6d Mon Sep 17 00:00:00 2001
From: Peter Reilly
For example, set this to "go" and delimitertype to "ROW" for * Sybase ASE or MS SQL Server.
+ * @param delimiter the separator. */ public void setDelimiter(String delimiter) { this.delimiter = delimiter; @@ -239,6 +241,7 @@ public class SQLExec extends JDBCTask { * means that any occurrence of the delimiter terminate the SQL * command whereas with row, only a line containing just the * delimiter is recognized as the end of the command. + * @param delimiterType the type of delimiter - "normal" or "row". */ public void setDelimiterType(DelimiterType delimiterType) { this.delimiterType = delimiterType.getValue(); @@ -247,6 +250,7 @@ public class SQLExec extends JDBCTask { /** * Print result sets from the statements; * optional, default false + * @param print if true print result sets. */ public void setPrint(boolean print) { this.print = print; @@ -255,6 +259,7 @@ public class SQLExec extends JDBCTask { /** * Print headers for result sets from the * statements; optional, default true. + * @param showheaders if true print headers of result sets. */ public void setShowheaders(boolean showheaders) { this.showheaders = showheaders; @@ -263,6 +268,7 @@ public class SQLExec extends JDBCTask { /** * Set the output file; * optional, defaults to the Ant log. + * @param output the output file to use for logging messages. */ public void setOutput(File output) { this.output = output; @@ -273,6 +279,7 @@ public class SQLExec extends JDBCTask { * an existing file. Defaults to false. * * @since Ant 1.5 + * @param append if true append to an existing file. */ public void setAppend(boolean append) { this.append = append; @@ -282,6 +289,7 @@ public class SQLExec extends JDBCTask { /** * Action to perform when statement fails: continue, stop, or abort * optional; default "abort" + * @param action the action to perform on statement failure. */ public void setOnerror(OnError action) { this.onError = action.getValue(); @@ -299,7 +307,7 @@ public class SQLExec extends JDBCTask { /** * Set escape processing for statements. - * + * @param enable if true enable escape processing, default is true. * @since Ant 1.6 */ public void setEscapeProcessing(boolean enable) { @@ -308,6 +316,7 @@ public class SQLExec extends JDBCTask { /** * Load the sql file and then execute it + * @throws BuildException on error. */ public void execute() throws BuildException { Vector savedTransaction = (Vector) transactions.clone(); @@ -424,6 +433,10 @@ public class SQLExec extends JDBCTask { /** * read in lines and execute them + * @param reader the reader contains sql lines. + * @param out the place to output results. + * @throws SQLException on sql problems + * @throws IOException on io problems */ protected void runStatements(Reader reader, PrintStream out) throws SQLException, IOException { @@ -486,6 +499,9 @@ public class SQLExec extends JDBCTask { /** * Exec the sql statement. + * @param sql the SQL statement to execute + * @param out the place to put output + * @throws SQLException on SQL problems */ protected void execSQL(String sql, PrintStream out) throws SQLException { // Check and ignore empty statements @@ -546,8 +562,10 @@ public class SQLExec extends JDBCTask { /** * print any results in the statement. + * @param out the place to print results + * @throws SQLException on SQL problems. */ - protected void printResults(PrintStream out) throws java.sql.SQLException { + protected void printResults(PrintStream out) throws SQLException { ResultSet rs = null; rs = statement.getResultSet(); if (rs != null) { @@ -591,6 +609,7 @@ public class SQLExec extends JDBCTask { * one of "continue", "stop" and "abort" */ public static class OnError extends EnumeratedAttribute { + /** @return the enumerated values */ public String[] getValues() { return new String[] {"continue", "stop", "abort"}; } @@ -607,14 +626,16 @@ public class SQLExec extends JDBCTask { private String tSqlCommand = ""; /** - * + * Set the source file attribute. + * @param src the source file */ public void setSrc(File src) { this.tSrcFile = src; } /** - * + * Set inline text + * @param sql the inline text */ public void addText(String sql) { this.tSqlCommand += sql;