de.esprit.appsuite.database.dbase.tools

## Class DBSelect

- 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.DBSelect

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

      public class DBSelect
      extends AbstractDBTool

  This is a general purpose tool for running SQL queries in any database. You may execute a single SELECT command or a set of SELECT statements from a scriptfile. The output may be redirected to a file.

  Examples for usage (-credfile option must always be present):
  -sql "select * from course where course_id = 1"
  -sql "select * from trainer" -outfile C:/temp/out.unl -delim ";"
  -script C:/databases/traindb/sql/querytest.sql -skiperrors -header

  Author:
    Rainer Buesch
  See Also:
    `DBExecute`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBSelect(Credential cred)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `de.esprit.appsuite.database.dbase.tools.DBSelect.MyDBSelectCLP` | `getDBToolCLP()`
    `protected java.lang.String` | `getDelimiter()`
    `protected java.io.PrintStream` | `getPrintStream()`
    `protected boolean` | `hasHeader()`
    `static void` | `main(java.lang.String[] args)`
    `protected void` | `performDatabaseOperation(java.sql.Connection dbConn)`
    `void` | `setArgDelimiter(java.lang.String argDelim)`
    `void` | `setArgHeader(boolean argHeader)`
    `void` | `setArgOutputFile(java.io.File argOutFile)`
    `void` | `setArgScriptFile(java.io.File argScriptFile)`
    `void` | `setArgSelectStatement(java.lang.String argSelectStmt)`

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

      `execute, executeCommand, executeCommandScript, executeQuery, executeQueryScript, 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

    - #### DBSelect

          public DBSelect(Credential cred)

  - ### Method Detail

    - #### setArgDelimiter

          public void setArgDelimiter(java.lang.String argDelim)

    - #### setArgHeader

          public void setArgHeader(boolean argHeader)

    - #### setArgOutputFile

          public void setArgOutputFile(java.io.File argOutFile)

    - #### setArgScriptFile

          public void setArgScriptFile(java.io.File argScriptFile)

    - #### setArgSelectStatement

          public void setArgSelectStatement(java.lang.String argSelectStmt)

    - #### performDatabaseOperation

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

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

    - #### getDBToolCLP

          public de.esprit.appsuite.database.dbase.tools.DBSelect.MyDBSelectCLP getDBToolCLP()

      Overrides:
        `getDBToolCLP` in class `AbstractDBTool`

    - #### getDelimiter

          protected java.lang.String getDelimiter()

      Overrides:
        `getDelimiter` in class `AbstractDBTool`

    - #### hasHeader

          protected boolean hasHeader()

      Overrides:
        `hasHeader` in class `AbstractDBTool`

    - #### getPrintStream

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

      Overrides:
        `getPrintStream` 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.