Top Description Fields Constructors Methods
org.apache.derby.impl.tools.ij

public Class Main

extends Object
Class Inheritance
Imports
org.apache.derby.tools.JDBCDisplayUtil, org.apache.derby.iapi.tools.i18n.LocalizedResource, .LocalizedInput, .LocalizedOutput, java.io.FileInputStream, .BufferedInputStream, .BufferedReader, .FileOutputStream, .FileNotFoundException, .InputStream, .Reader, .PrintStream, .UnsupportedEncodingException, .IOException, java.sql.Connection, .SQLException, java.util.*

This is the controller for ij. It uses two parsers: one to grab the next statement, and another to see if it is an ij command, and if so execute it. If it is not an ij command, it is treated as a JSQL statement and executed against the current connection. ijParser controls the current connection, and so contains all of the state information for executing JSQL statements.

This was written to facilitate a test harness for language functionality tests.

Field Summary

Modifier and TypeField and Description
private utilMain

Constructor Summary

AccessConstructor and Description
public
Main()

create an ij tool waiting to be given input and output streams.

public
public
Main(boolean trash)

This constructor is only used so that we can get to the right Main based on the JDBC version.

Method Summary

Modifier and TypeMethod and Description
public Main

Returns:

The right main (according to the JDBC version).
getMain
(LocalizedOutput out)

Get the right Main (according to the JDBC version.

public utilMain

Returns:

The right utilMain (according to the JDBC version).
getutilMain
(int numConnections, LocalizedOutput out)

Get the right utilMain (according to the JDBC version.

public utilMain

Returns:

The right utilMain (according to the JDBC version).
getutilMain
(int numConnections, LocalizedOutput out, boolean loadSystemProperties)

Get the right utilMain (according to the JDBC version.

private void
go(LocalizedInput in, LocalizedOutput out)

Give a shortcut to go on the utilInstance so we don't expose utilMain.

private void
public static void
main(String[]
allows 1 file name to be specified, from which input will be read; if not specified, stdin is used.
args
)

ij can be used directly on a shell command line through its main program.

public static void
mainCore(String[] args, Main main)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

utilInstanceback to summary
private utilMain utilInstance

Constructor Detail

Mainback to summary
public Main()

create an ij tool waiting to be given input and output streams.

Mainback to summary
public Main(LocalizedOutput out)
Mainback to summary
public Main(boolean trash)

This constructor is only used so that we can get to the right Main based on the JDBC version. We don't do any work in this constructor and we only use this object to get to the right Main via getMain().

Method Detail

getMainback to summary
public Main getMain(LocalizedOutput out)

Get the right Main (according to the JDBC version.

Returns:Main

The right main (according to the JDBC version).

getutilMainback to summary
public utilMain getutilMain(int numConnections, LocalizedOutput out)

Get the right utilMain (according to the JDBC version.

Returns:utilMain

The right utilMain (according to the JDBC version).

getutilMainback to summary
public utilMain getutilMain(int numConnections, LocalizedOutput out, boolean loadSystemProperties)

Get the right utilMain (according to the JDBC version. This overload allows the choice of whether the system properties will be used or not.

Returns:utilMain

The right utilMain (according to the JDBC version).

goback to summary
private void go(LocalizedInput in, LocalizedOutput out)

Give a shortcut to go on the utilInstance so we don't expose utilMain.

initAppUIback to summary
private void initAppUI()
mainback to summary
public static void main(String[] args) throws IOException

ij can be used directly on a shell command line through its main program.

Parameters
args:String[]

allows 1 file name to be specified, from which input will be read; if not specified, stdin is used.

mainCoreback to summary
public static void mainCore(String[] args, Main main) throws IOException