Advertisement
Guest User

Untitled

a guest
Apr 16th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. ds.setURL(jdbcUrl);if(conn == null) {
  2. // Display a message to get the password from the user
  3. JLabel label = new JLabel("Oracle Username: ");
  4. JTextField jtf = new JTextField();
  5. JLabel label2 = new JLabel("Oracle Password:");
  6. JPasswordField jpf = new JPasswordField();
  7. JOptionPane.showConfirmDialog(null,new Object[]{label, jtf, label2, jpf}, "Password:",
  8. JOptionPane.OK_CANCEL_OPTION);
  9. String password = String.valueOf(jpf.getPassword());
  10. conn = ds.getConnection(jtf.getText(), password );
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement