Class ExperimentAdditionalTableLoader


  • public class ExperimentAdditionalTableLoader
    extends java.lang.Object
    Class that creates additional tables before an experiment is started.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void executeStatementsFromDirectory​(java.lang.String folder, ai.libs.jaicore.basic.SQLAdapter adapter)
      Goes through all the files in the given directory, loads their contents and tries to execute them as SQL statements.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • executeStatementsFromDirectory

        public static void executeStatementsFromDirectory​(java.lang.String folder,
                                                          ai.libs.jaicore.basic.SQLAdapter adapter)
                                                   throws java.io.IOException
        Goes through all the files in the given directory, loads their contents and tries to execute them as SQL statements. Assumes UTF-8 Encoding of the files. Assumes that there either is only a CREATE TABLE statement or a CREATE TABLE statement and a INSERT INTO statement present in the file, no other statements, changing of the mode, setting of the time etc. Tests for the INSERT VALUES statement by String occurrence, so including the String "INSERT INTO" in the CREATE TABLE statement in any way will lead to bad behavior.
        Parameters:
        folder - the directory from which the files containing sql statements are loaded
        adapter - the sql connection to use for executing the statements
        Throws:
        java.io.IOException - if the given folder cannot be read (does not exist, no rights, not a directory, ...)