Class H2DatabaseFactory

    • Constructor Detail

      • H2DatabaseFactory

        public H2DatabaseFactory()
    • Method Detail

      • isDriverCompatible

        public boolean isDriverCompatible​(String driverClassName)
        Specified by:
        isDriverCompatible in interface DatabaseFactory
        Parameters:
        driverClassName - the driver class name
        Returns:
        true if this database factory is compatible with the given driver
      • runScript

        public static void runScript​(Database database,
                                     String scriptPath)
                              throws SQLException
        Runs the given script using the RunScript tool, with the default sysadmin username (sa) and default charset
        Parameters:
        database - the database
        scriptPath - the path to the script
        Throws:
        SQLException - in case of an exception
      • runScript

        public static void runScript​(Database database,
                                     String scriptPath,
                                     String username,
                                     String password,
                                     Charset scriptCharset)
                              throws SQLException
        Runs the given script using the RunScript tool
        Parameters:
        database - the database
        scriptPath - the path to the script
        username - the username to run the script under
        password - the password
        scriptCharset - the script character set
        Throws:
        SQLException - in case of an exception