?? oracleconsole.java
字號:
package console.oracle;
import java.io.IOException;
import console.Operation;
/**
* @author Allan(劉新福)
* @version 1.0
*/
public class OracleConsole {
public static void main(String[] args) throws IOException {
if (args.length < 5) {
System.out
.println("Usage: java alan.sql.OracleSqlQuery <serverIP> <serverPort> <databaseName> <userName> <password> [isolation]");
System.exit(0);
}
Operation operation = null;
try {
if (args.length == 5) {
operation = new OracleOperation(args[0], args[1], args[2],
args[3], args[4]);
} else {
operation = new OracleOperation(args[0], args[1], args[2],
args[3], args[4], Integer.parseInt(args[5]));
}
} catch (Exception e) {
System.exit(0);
}
System.out
.println("Welcome to oracle console tools version1.0. Using isolation: "
+ operation.getTransactionIsolation());
System.out.println("Author:Allan Liu");
System.out.println("Contact: allanlxf@hotmail.com");
System.out.println("quit; or exit; to end program");
System.out.print("Oracle>");
StringBuffer sql = new StringBuffer();
while (true) {
char ch = ';';
while ((ch = (char) System.in.read()) != ';') {
sql.append(ch);
}
if (sql.toString().indexOf("quit") != -1
|| sql.toString().indexOf("exit") != -1) {
break;
} else {
try {
operation.execute(sql.toString());
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
sql.delete(0, sql.length());
System.out.print("Oracle>");
}
operation.release();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -