Details
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