Top Description Constructors Methods
org.apache.derby.tools

public Class ij

extends Object
Class Inheritance
Imports
org.apache.derby.iapi.tools.i18n.LocalizedInput, .LocalizedOutput, .LocalizedResource, org.apache.derby.impl.tools.ij.Main, .utilMain, java.io.IOException, .InputStream, .OutputStream, .PrintStream, .UnsupportedEncodingException, java.sql.Connection, java.util.Properties

ij is Derby's interactive JDBC scripting tool. It is a simple utility for running scripts against a Derby database. You can also use it interactively to run ad hoc queries. ij provides several commands for ease in accessing a variety of JDBC features.

To run from the command line enter the following:

java [options] org.apache.derby.tools.ij [arguments]

ij is can also be used with any database server that supports a JDBC driver.

Constructor Summary

AccessConstructor and Description
private
ij()

Method Summary

Modifier and TypeMethod and Description
public static String
getArg(String param, String[] args)

public static void
public static void
main(String[] args)

public static int

Returns:

Number of SQLExceptions thrown during the execution, -1 if not known.
runScript
(Connection
Connection to be used as the script's default connection.
conn
,
InputStream
InputStream for the script.
sqlIn
,
String
Encoding of the script.
inputEncoding
,
OutputStream
OutputStream for the script's output
sqlOut
,
String
Output encoding to use.
outputEncoding
)

Run a SQL script from an InputStream and write the resulting output to the provided PrintStream.

public static int

Returns:

Number of SQLExceptions thrown during the execution, -1 if not known.
runScript
(Connection
Connection to be used as the script's default connection.
conn
,
InputStream
InputStream for the script.
sqlIn
,
String
Encoding of the script.
inputEncoding
,
OutputStream
OutputStream for the script's output
sqlOut
,
String
Output encoding to use.
outputEncoding
,
boolean
Whether to use the system properties.
loadSystemProperties
)

Run a SQL script from an InputStream and write the resulting output to the provided PrintStream.

public static Connection
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ijback to summary
private ij()

Method Detail

getArgback to summary
public static String getArg(String param, String[] args)
getPropertyArgback to summary
public static void getPropertyArg(String[] args) throws IOException
mainback to summary
public static void main(String[] args) throws IOException
Exceptions
IOException:
thrown if cannot access input or output files.
runScriptback to summary
public static int runScript(Connection conn, InputStream sqlIn, String inputEncoding, OutputStream sqlOut, String outputEncoding) throws UnsupportedEncodingException

Run a SQL script from an InputStream and write the resulting output to the provided PrintStream. SQL commands are separated by a semi-colon ';' character.

Parameters
conn:Connection

Connection to be used as the script's default connection.

sqlIn:InputStream

InputStream for the script.

inputEncoding:String

Encoding of the script.

sqlOut:OutputStream

OutputStream for the script's output

outputEncoding:String

Output encoding to use.

Returns:int

Number of SQLExceptions thrown during the execution, -1 if not known.

runScriptback to summary
public static int runScript(Connection conn, InputStream sqlIn, String inputEncoding, OutputStream sqlOut, String outputEncoding, boolean loadSystemProperties) throws UnsupportedEncodingException

Run a SQL script from an InputStream and write the resulting output to the provided PrintStream. SQL commands are separated by a semi-colon ';' character.

Parameters
conn:Connection

Connection to be used as the script's default connection.

sqlIn:InputStream

InputStream for the script.

inputEncoding:String

Encoding of the script.

sqlOut:OutputStream

OutputStream for the script's output

outputEncoding:String

Output encoding to use.

loadSystemProperties:boolean

Whether to use the system properties.

Returns:int

Number of SQLExceptions thrown during the execution, -1 if not known.

startJBMSback to summary
public static Connection startJBMS() throws SQLException, IllegalAccessException, ClassNotFoundException, InstantiationException, NoSuchMethodException, InvocationTargetException