1 21 22 package org.apache.derby.tools; 23 24 import org.apache.derby.iapi.services.info.JVMInfo; 25 import org.apache.derby.iapi.tools.i18n.LocalizedInput; 26 import org.apache.derby.iapi.tools.i18n.LocalizedOutput; 27 import org.apache.derby.iapi.tools.i18n.LocalizedResource; 28 29 import org.apache.derby.impl.tools.ij.Main; 30 import org.apache.derby.impl.tools.ij.utilMain; 31 32 import java.io.IOException ; 33 import java.io.InputStream ; 34 import java.io.OutputStream ; 35 import java.io.PrintStream ; 36 import java.io.UnsupportedEncodingException ; 37 import java.sql.Connection ; 38 import java.util.Properties ; 39 40 54 public class ij { 55 56 59 static public void main(String [] args) throws IOException { 60 61 65 if (JVMInfo.JDK_ID == JVMInfo.J2SE_13) 66 { 67 Main.main(args); 68 } 69 else 70 { 71 org.apache.derby.impl.tools.ij.Main14.main(args); 72 } 73 } 74 75 88 public static int runScript( 89 Connection conn, 90 InputStream sqlIn, 91 String inputEncoding, 92 OutputStream sqlOut, 93 String outputEncoding) 94 throws UnsupportedEncodingException 95 { 96 LocalizedOutput lo = 97 outputEncoding == null ? 98 LocalizedResource.getInstance(). 99 getNewOutput(sqlOut) 100 : 101 LocalizedResource.getInstance(). 102 getNewEncodedOutput(sqlOut, outputEncoding); 103 104 Main ijE; 105 if (JVMInfo.JDK_ID == JVMInfo.J2SE_13) 106 { 107 ijE = new Main(false); 108 } 109 else 110 { 111 ijE = new Main(false); 117 } 118 119 LocalizedInput li = LocalizedResource.getInstance(). 120 getNewEncodedInput(sqlIn, inputEncoding); 121 122 utilMain um = ijE.getutilMain(1, lo); 123 124 return um.goScript(conn, li); 125 } 126 127 private ij() { } 129 130 public static String getArg(String param, String [] args) 131 { 132 return org.apache.derby.impl.tools.ij.util.getArg(param, args); 133 } 134 135 public static void getPropertyArg(String [] args) throws IOException 136 { 137 org.apache.derby.impl.tools.ij.util.getPropertyArg(args); 138 } 139 140 public static java.sql.Connection startJBMS() 141 throws java.sql.SQLException , IllegalAccessException , ClassNotFoundException , InstantiationException 142 { 143 return org.apache.derby.impl.tools.ij.util.startJBMS(); 144 } 145 } 146 | Popular Tags |