KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > tools > ij > Main14


1 /*
2
3    Derby - Class org.apache.derby.impl.tools.ij.Main14
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.tools.ij;
23
24 import org.apache.derby.tools.JDBCDisplayUtil;
25
26
27 import java.io.BufferedInputStream JavaDoc;
28 import java.io.FileOutputStream JavaDoc;
29 import java.io.FileNotFoundException JavaDoc;
30 import java.io.InputStream JavaDoc;
31 import java.io.PrintStream JavaDoc;
32 import java.io.IOException JavaDoc;
33
34 import java.sql.Connection JavaDoc;
35 import java.sql.SQLException JavaDoc;
36
37 import org.apache.derby.iapi.tools.i18n.LocalizedOutput;
38 /**
39  * This is the controller for the JDBC3.0 version
40  * of ij.
41  * <p>
42  * This was written to facilitate a test harness for the
43  * holding cursors over commit functionality in JDBC3.0.
44  *
45  */

46 public class Main14 extends Main
47 {
48     /**
49      * ij can be used directly on a shell command line through
50      * its main program.
51      * @param args allows 1 file name to be specified, from which
52      * input will be read; if not specified, stdin is used.
53      */

54     public static void main(String JavaDoc[] args) throws IOException JavaDoc
55     {
56         Main.mainCore(args, new Main14(true));
57     }
58
59     /**
60      * create an ij tool waiting to be given input and output streams.
61      */

62     public Main14()
63     {
64         this(null);
65     }
66
67     public Main14(LocalizedOutput out)
68     {
69         super(out);
70     }
71
72     /**
73      * This constructor is only used so that we
74      * can get to the right Main based on the
75      * JDBC version. We don't do any work in
76      * this constructor and we only use this
77      * object to get to the right Main via
78      * getMain().
79      */

80     public Main14(boolean trash)
81     {
82         super(trash);
83     }
84     /**
85      * Get the right Main (according to
86      * the JDBC version.
87      *
88      * @return The right Main (according to the JDBC version).
89      */

90     public Main getMain(LocalizedOutput out)
91     {
92         return new Main14(out);
93     }
94
95     /**
96      * Get the right utilMain (according to
97      * the JDBC version.
98      *
99      * @return The right utilMain (according to the JDBC version).
100      */

101     public utilMain getutilMain(int numConnections, LocalizedOutput out)
102     {
103         return new utilMain14(numConnections, out);
104     }
105
106 }
107
Popular Tags