Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1609

Add a runScript method to ij that takes a script as an InputStream and returns the output to a stream.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 10.2.1.6, 10.3.1.4
    • Tools
    • None
    • Normal

    Description

      Useful for running ij SQL scripts as part of JUnit tests and for applications to use instead of the awkward way to use ij from a program today.

      /**

      • Run a SQL script from an input stream and write
      • the resulting output to the provided OutputStream.
      • @param conn Connection to be used as the script's default connection.
      • @param sqlIn InputStream for the script.
      • @param inputEncoding Encoding of the script.
      • @param sqlOut OutputStream for the script's output
      • @param outputEncoding Output encoding to use.
      • @return Number of SQLExceptions thrown during the execution, -1 if not known.
      • @throws UnsupportedEncodingException
        */
        public static int runScript(
        Connection conn,
        InputStream sqlIn,
        String inputEncoding,
        PrintStream sqlOut,
        String outputEncoding)
        throws UnsupportedEncodingException

      Attachments

        Activity

          People

            djd Daniel John Debrunner
            djd Daniel John Debrunner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: