Class SQLLoader


public class SQLLoader extends Object
Used for executing SQL statements
   java com.softwaremining.jcl.SQLLoader -file=filename.sql
   java com.softwaremining.jcl.SQLLoader SQL-Statement  [e.g. java com.softwaremining.jcl.SQLLoader DELETE * FROM TABLE-1
  • the system will pick up the database credentials from file
  • when using the file=filename.sql option, the system will look for file in class path ( DATA_DIR is ignored)
  • when executing an SQL Select statement - the results will be writing to console (System.out.print) it is upto the JCL script to redirect to SYSPRNT or other files .
  • when using the file=filename.sql option, the file may contain several SQL statements, each separated by ";" e.g.
             SELECT * FROM TABLE-1;
             DELETE FROM TABLE-1;
             INSERT into table-1 (COLUMN1, COLUMN2) values ('A' , 'B') ;
             INSERT into table-1 (COLUMN1, COLUMN2) values ('C' , 'D') ;
  • unless has assigned auto-commit=true, the system "commits" after executing every SQL statement
  • Field Details

    • baseObject

      protected com.softwaremining.jcl.SQLLoader.ESQLTest baseObject
    • sqlProcessor

      protected ESQLProcessor sqlProcessor
  • Method Details

    • getInstance

      public static SQLLoader getInstance()
    • setDBUrl

      public void setDBUrl(String dbUri)
    • executeSQLStatement

      public void executeSQLStatement(String sql)
    • executeSQLFile

      public void executeSQLFile(String fileAndPathName)
    • main

      public static void main(String[] args)