Class SqlScriptRunner

java.lang.Object
org.mybatis.generator.maven.SqlScriptRunner

public class SqlScriptRunner extends Object
This class is used to execute an SQL script before a code generation run if necessary. Note that this class mainly exists to support the MyBatis Generator build. It is intentionally not documented and not supported.
  • Field Details

    • driver

      private String driver
    • url

      private String url
    • userid

      private String userid
    • password

      private String password
    • sourceFile

      private String sourceFile
    • log

      private org.apache.maven.plugin.logging.Log log
  • Constructor Details

    • SqlScriptRunner

      public SqlScriptRunner(String sourceFile, String driver, String url, String userId, String password) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
  • Method Details

    • executeScript

      public void executeScript() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getDriver

      public String getDriver()
    • setDriver

      public void setDriver(String driver)
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
    • closeConnection

      private void closeConnection(Connection connection)
    • closeStatement

      private void closeStatement(Statement statement)
    • readStatement

      private String readStatement(BufferedReader br) throws IOException
      Throws:
      IOException
    • setLog

      public void setLog(org.apache.maven.plugin.logging.Log log)
    • getScriptReader

      private BufferedReader getScriptReader() throws org.apache.maven.plugin.MojoExecutionException, IOException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      IOException