Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void withoutWallet(String DB_USER, String DB_PASSWORD) {
- String JDBC_URL = "jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.uk-london-1.oraclecloud.com))(connect_data=(service_name=gf5f9ffc50769d0_ppwe68m5dv8yenwc_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))";
- String SQL = "SELECT * FROM v$pdbs";
- Connection c = null;
- PreparedStatement ps = null;
- ResultSet rs = null;
- try {
- c = DriverManager.getConnection(JDBC_URL, DB_USER, DB_PASSWORD);
- ps = c.prepareStatement(SQL);
- rs = ps.executeQuery();
- rs.next();
- System.out.println(rs.getString("cloud_identity"));
- } catch (SQLException ex) {
- Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
- } finally {
- try{rs.close();}catch(SQLException e){;}
- try{ps.close();}catch(SQLException e){;}
- try{c.close();}catch(SQLException e){;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement