de.esprit.appsuite.database.dbase.tools

## Class AbstractDBTool

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<ApplicationContext>
    - - de.esprit.appsuite.database.dbase.tools.AbstractDBTool

- All Implemented Interfaces:
    ApplicationObject<ApplicationContext>, SimpleLogSupport, Dumpable, Executable
  Direct Known Subclasses:
    DBExecute, DBSelect

      public abstract class AbstractDBTool
      extends AbstractApplicationObject<ApplicationContext>
      implements Executable

  This is the base class for all database related command line tools.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractDBTool(Credential cred)`
    `AbstractDBTool(DBToolCommandLineParser clp)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute()` Contains the code to be executed.
    `protected void` | `executeCommand(java.lang.String sqlCmd)`
    `protected void` | `executeCommandScript(java.io.File sqlScriptFile)`
    `protected void` | `executeQuery(java.lang.String sqlSelect)`
    `protected void` | `executeQueryScript(java.io.File sqlScriptFile)`
    `protected DBToolCommandLineParser` | `getDBToolCLP()`
    `protected java.lang.String` | `getDelimiter()`
    `protected java.io.PrintStream` | `getPrintStream()`
    `protected boolean` | `hasHeader()`
    `protected boolean` | `isSkipErrors()`
    `protected abstract void` | `performDatabaseOperation(java.sql.Connection dbConn)`
    `void` | `setArgSkipErrors(boolean skipErrors)`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractDBTool

          public AbstractDBTool(DBToolCommandLineParser clp)

    - #### AbstractDBTool

          public AbstractDBTool(Credential cred)

  - ### Method Detail

    - #### getDBToolCLP

          protected DBToolCommandLineParser getDBToolCLP()

    - #### setArgSkipErrors

          public void setArgSkipErrors(boolean skipErrors)

    - #### execute

          public final void execute()
                             throws java.lang.Exception

      Description copied from interface: `Executable`
      Contains the code to be executed. This method is to be called in order to execute the code synchronously. In this case no other execution thread is involved.
      Specified by:
        `execute` in interface `Executable`
      Throws:
        `java.lang.Exception`

    - #### performDatabaseOperation

          protected abstract void performDatabaseOperation(java.sql.Connection dbConn)
                                                    throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### executeQuery

          protected void executeQuery(java.lang.String sqlSelect)
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getPrintStream

          protected java.io.PrintStream getPrintStream()
                                                throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getDelimiter

          protected java.lang.String getDelimiter()

    - #### hasHeader

          protected boolean hasHeader()

    - #### isSkipErrors

          protected final boolean isSkipErrors()

    - #### executeCommand

          protected void executeCommand(java.lang.String sqlCmd)
                                 throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### executeQueryScript

          protected final void executeQueryScript(java.io.File sqlScriptFile)
                                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### executeCommandScript

          protected final void executeCommandScript(java.io.File sqlScriptFile)
                                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.