1 | /* |
2 | |
3 | Derby - Class org.apache.derby.tools.ij |
4 | |
5 | Copyright 1998, 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.tools; |
22 | |
23 | import org.apache.derby.iapi.services.info.JVMInfo; |
24 | |
25 | import org.apache.derby.impl.tools.ij.Main; |
26 | |
27 | import java.io.IOException; |
28 | |
29 | /** |
30 | |
31 | ij is Derby's interactive JDBC scripting tool. |
32 | It is a simple utility for running scripts against a Derby database. |
33 | You can also use it interactively to run ad hoc queries. |
34 | ij provides several commands for ease in accessing a variety of JDBC features. |
35 | <P> |
36 | |
37 | To run from the command line enter the following: |
38 | <p> |
39 | java [options] org.apache.derby.tools.ij [arguments] |
40 | <P> |
41 | ij is can also be used with any database server that supports a JDBC driver. |
42 | */ |
43 | public class ij { |
44 | |
45 | /** |
46 | @exception IOException thrown if cannot access input or output files. |
47 | */ |
48 | static public void main(String[] args) throws IOException { |
49 | |
50 | /* We decide which verion of ij (2.0 or 4.0) to |
51 | * load based on the same criteria that the JDBC driver |
52 | * uses. |
53 | */ |
54 | if (JVMInfo.JDK_ID == JVMInfo.J2SE_13) |
55 | { |
56 | Main.main(args); |
57 | } |
58 | else |
59 | { |
60 | org.apache.derby.impl.tools.ij.Main14.main(args); |
61 | } |
62 | } |
63 | |
64 | private ij() { // no instances allowed |
65 | } |
66 | |
67 | public static String getArg(String param, String[] args) |
68 | { |
69 | return org.apache.derby.impl.tools.ij.util.getArg(param, args); |
70 | } |
71 | |
72 | public static void getPropertyArg(String[] args) throws IOException |
73 | { |
74 | org.apache.derby.impl.tools.ij.util.getPropertyArg(args); |
75 | } |
76 | |
77 | public static java.sql.Connection startJBMS() |
78 | throws java.sql.SQLException, IllegalAccessException, ClassNotFoundException, InstantiationException |
79 | { |
80 | return org.apache.derby.impl.tools.ij.util.startJBMS(); |
81 | } |
82 | } |