de.esprit.appsuite.database.dbase.tools

## Class DBExecute

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

- All Implemented Interfaces:
    ApplicationObject<ApplicationContext>, SimpleLogSupport, Dumpable, Executable

      public class DBExecute
      extends AbstractDBTool

  This is a general purpose tool for executing SQL statements in a database. You may execute a single SQL command or an SQL script or just write values into particular fields in a database table.

  Examples for usage (-credfile option must always be present):
  -set our_user.firstname='Harry' -cond user_id=1
  -set our_user.firstname=null -cond user_id=1
  -sql "update our_user set firstname = 'Harry' where user_id = 1"
  -script C:/databases/traindb/sql/test.sql

  Author:
    Rainer Buesch
  See Also:
    `DBSelect`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBExecute(Credential cred)`
    `DBExecute(de.esprit.appsuite.database.dbase.tools.DBExecuteCLP clp)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected de.esprit.appsuite.database.dbase.tools.DBExecuteCLP` | `getDBToolCLP()`
    `static void` | `main(java.lang.String[] args)`
    `protected void` | `performDatabaseOperation(java.sql.Connection dbConn)`
    `void` | `setArgScriptFile(java.io.File scriptFile)`
    `void` | `setArgSqlStatement(java.lang.String sql)`

    - ### Methods inherited from class de.esprit.appsuite.database.dbase.tools.AbstractDBTool

      `execute, executeCommand, executeCommandScript, executeQuery, executeQueryScript, getDelimiter, getPrintStream, hasHeader, isSkipErrors, setArgSkipErrors`

    - ### 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

    - #### DBExecute

          public DBExecute(de.esprit.appsuite.database.dbase.tools.DBExecuteCLP clp)

    - #### DBExecute

          public DBExecute(Credential cred)

  - ### Method Detail

    - #### setArgScriptFile

          public void setArgScriptFile(java.io.File scriptFile)

    - #### setArgSqlStatement

          public void setArgSqlStatement(java.lang.String sql)

    - #### getDBToolCLP

          protected de.esprit.appsuite.database.dbase.tools.DBExecuteCLP getDBToolCLP()

      Overrides:
        `getDBToolCLP` in class `AbstractDBTool`

    - #### performDatabaseOperation

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

      Specified by:
        `performDatabaseOperation` in class `AbstractDBTool`
      Throws:
        `java.lang.Exception`

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.