Class StudioDBScriptRunnerImpl

java.lang.Object
org.craftercms.studio.impl.v2.dal.StudioDBScriptRunnerImpl
All Implemented Interfaces:
StudioDBScriptRunner

public class StudioDBScriptRunnerImpl extends Object implements StudioDBScriptRunner
  • Field Details

    • dataSource

      protected DataSource dataSource
    • scriptLinesBufferSize

      protected int scriptLinesBufferSize
    • connection

      protected Connection connection
    • autoCommit

      protected boolean autoCommit
  • Constructor Details

    • StudioDBScriptRunnerImpl

      protected StudioDBScriptRunnerImpl(DataSource dataSource, int scriptLinesBufferSize)
  • Method Details

    • openConnection

      protected void openConnection()
    • closeConnection

      protected void closeConnection()
    • execute

      public void execute(Path sqlScriptPath, boolean sendFullFile) throws SQLException, IOException
      Description copied from interface: StudioDBScriptRunner
      Execute the given SQL script file.
      Specified by:
      execute in interface StudioDBScriptRunner
      Parameters:
      sqlScriptPath - Path to the SQL script file to execute
      sendFullFile - if true, the whole script will be sent to the DB, otherwise it will be partitioned into chunks
      Throws:
      SQLException - if an error occurs while executing the script
      IOException - if an error occurs while reading the script file