代码语言:javascript复制
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
Properties conProps = new Properties();
conProps.put("user", "sys");
conProps.put("password", "root");
conProps.put("defaultRowPrefetch", "15");
conProps.put("internal_logon", "sysdba");
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@192.168.200.93:1521:orcl", conProps);
通过以上,我们可以用JDBC实现一个 conn as sysdba的目的。