1 | /* |
2 | |
3 | Derby - Class org.apache.derby.impl.tools.ij.Main14 |
4 | |
5 | Copyright 2002, 2004 The Apache Software Foundation or its licensors, as applicable. |
6 | |
7 | Licensed under the Apache License, Version 2.0 (the "License"); |
8 | you may not use this file except in compliance with the License. |
9 | You may obtain a copy of the License at |
10 | |
11 | http://www.apache.org/licenses/LICENSE-2.0 |
12 | |
13 | Unless required by applicable law or agreed to in writing, software |
14 | distributed under the License is distributed on an "AS IS" BASIS, |
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | See the License for the specific language governing permissions and |
17 | limitations under the License. |
18 | |
19 | */ |
20 | |
21 | package org.apache.derby.impl.tools.ij; |
22 | |
23 | import org.apache.derby.tools.JDBCDisplayUtil; |
24 | |
25 | |
26 | import java.io.BufferedInputStream; |
27 | import java.io.FileOutputStream; |
28 | import java.io.FileNotFoundException; |
29 | import java.io.InputStream; |
30 | import java.io.PrintStream; |
31 | import java.io.IOException; |
32 | |
33 | import java.sql.Connection; |
34 | import java.sql.SQLException; |
35 | |
36 | import org.apache.derby.iapi.tools.i18n.LocalizedOutput; |
37 | /** |
38 | * This is the controller for the JDBC3.0 version |
39 | * of ij. |
40 | * <p> |
41 | * This was written to facilitate a test harness for the |
42 | * holding cursors over commit functionality in JDBC3.0. |
43 | * |
44 | */ |
45 | public class Main14 extends Main |
46 | { |
47 | /** |
48 | * ij can be used directly on a shell command line through |
49 | * its main program. |
50 | * @param args allows 1 file name to be specified, from which |
51 | * input will be read; if not specified, stdin is used. |
52 | */ |
53 | public static void main(String[] args) throws IOException |
54 | { |
55 | Main.mainCore(args, new Main14(true)); |
56 | } |
57 | |
58 | /** |
59 | * create an ij tool waiting to be given input and output streams. |
60 | */ |
61 | public Main14() |
62 | { |
63 | this(null); |
64 | } |
65 | |
66 | public Main14(LocalizedOutput out) |
67 | { |
68 | super(out); |
69 | } |
70 | |
71 | /** |
72 | * This constructor is only used so that we |
73 | * can get to the right Main based on the |
74 | * JDBC version. We don't do any work in |
75 | * this constructor and we only use this |
76 | * object to get to the right Main via |
77 | * getMain(). |
78 | */ |
79 | public Main14(boolean trash) |
80 | { |
81 | super(trash); |
82 | } |
83 | /** |
84 | * Get the right Main (according to |
85 | * the JDBC version. |
86 | * |
87 | * @return The right Main (according to the JDBC version). |
88 | */ |
89 | public Main getMain(LocalizedOutput out) |
90 | { |
91 | return new Main14(out); |
92 | } |
93 | |
94 | /** |
95 | * Get the right utilMain (according to |
96 | * the JDBC version. |
97 | * |
98 | * @return The right utilMain (according to the JDBC version). |
99 | */ |
100 | public utilMain getutilMain(int numConnections, LocalizedOutput out) |
101 | { |
102 | return new utilMain14(numConnections, out); |
103 | } |
104 | |
105 | } |