001: /*
002:
003: Derby - Class org.apache.derby.impl.tools.ij.Main14
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to You under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derby.impl.tools.ij;
023:
024: import org.apache.derby.tools.JDBCDisplayUtil;
025:
026: import java.io.BufferedInputStream;
027: import java.io.FileOutputStream;
028: import java.io.FileNotFoundException;
029: import java.io.InputStream;
030: import java.io.PrintStream;
031: import java.io.IOException;
032:
033: import java.sql.Connection;
034: import java.sql.SQLException;
035:
036: import org.apache.derby.iapi.tools.i18n.LocalizedOutput;
037:
038: /**
039: * This is the controller for the JDBC3.0 version
040: * of ij.
041: * <p>
042: * This was written to facilitate a test harness for the
043: * holding cursors over commit functionality in JDBC3.0.
044: *
045: */
046: public class Main14 extends Main {
047: /**
048: * ij can be used directly on a shell command line through
049: * its main program.
050: * @param args allows 1 file name to be specified, from which
051: * input will be read; if not specified, stdin is used.
052: */
053: public static void main(String[] args) throws IOException {
054: Main.mainCore(args, new Main14(true));
055: }
056:
057: /**
058: * create an ij tool waiting to be given input and output streams.
059: */
060: public Main14() {
061: this (null);
062: }
063:
064: public Main14(LocalizedOutput out) {
065: super (out);
066: }
067:
068: /**
069: * This constructor is only used so that we
070: * can get to the right Main based on the
071: * JDBC version. We don't do any work in
072: * this constructor and we only use this
073: * object to get to the right Main via
074: * getMain().
075: */
076: public Main14(boolean trash) {
077: super (trash);
078: }
079:
080: /**
081: * Get the right Main (according to
082: * the JDBC version.
083: *
084: * @return The right Main (according to the JDBC version).
085: */
086: public Main getMain(LocalizedOutput out) {
087: return new Main14(out);
088: }
089:
090: /**
091: * Get the right utilMain (according to
092: * the JDBC version.
093: *
094: * @return The right utilMain (according to the JDBC version).
095: */
096: public utilMain getutilMain(int numConnections, LocalizedOutput out) {
097: return new utilMain14(numConnections, out);
098: }
099:
100: }
|