You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by do...@apache.org on 2013/10/08 11:18:48 UTC

svn commit: r1530199 - /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java

Author: doebele
Date: Tue Oct  8 09:18:47 2013
New Revision: 1530199

URL: http://svn.apache.org/r1530199
Log:
EMPIREDB-194
new method insertStmt()

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java?rev=1530199&r1=1530198&r2=1530199&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java (original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java Tue Oct  8 09:18:47 2013
@@ -116,6 +116,21 @@ public class DBSQLScript implements Iter
     }
     
     /**
+     * Inserts an entry in the list
+     * @param i index of the statement to replace
+     * @param stmt the new statement for this index, or NULL to remove the statement
+     */
+    public void insertStmt(int i, String stmt)
+    {
+        if (stmt==null)
+            throw new InvalidArgumentException("stmt", stmt);
+        if (i<0 || i>sqlCmdList.size())
+            throw new InvalidArgumentException("index", i);
+        // replace or remove statement
+        sqlCmdList.add(i, stmt);
+    }
+    
+    /**
      * Clears the script by removing all statements
      */
     public void clear()