JDBC Oracle sys 用户连接

Class.forName("oracle.jdbc.driver.OracleDriver");
            conn = DriverManager.getConnection(
                    "jdbc:oracle:thin:@127.0.0.1:1521:myoracle", "sys as sysdba",
                    "your sys's password");
            stmt = conn.createStatement();
            rs = stmt.executeQuery("select * from dba_tables");
            
            while (rs.next()) {
                System.out.println(rs.getString(1));
                System.out.println(rs.getString(2));
                System.out.println(rs.getString(3));
                System.out.println(rs.getString(4));
                
            }

 

你可能感兴趣的:(JDBC Oracle sys 用户连接)