Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264

    Question Unanswered: JDBC password mask

    I am just getting started with Oracle and JDBC, I have the following snipit of code that gets the username/password, which is then used for the connection.

    Code:
     String dbUser = "";
    String dbPassword = "";
    try {
    	 InputStreamReader inReader = new InputStreamReader(System.in);
    	 BufferedReader bReader = new BufferedReader( inReader );
    	 System.out.print("Enter your user id: ");
    	 dbUser = bReader.readLine();
    	 System.out.print("Enter your password :");
    	 dbPassword = bReader.readLine();
    }
    The code is functional and it connects me to my database, however, the password is displayed as it is typed and since this is a console ran application, the password remains displayed as long as that console window is open.

    What is the simpliest way to allow a password to be entered without displaying it on the screen?

    Thanks.
    Steve.

    (Application is ran on a Solaris box)

    Steve

  2. #2
    Join Date
    Jan 2004
    Posts
    370
    This is not an Oracle problem - it is an issue with Java.

    However, the following link may help: http://java.sun.com/developer/techni...ity/pwordmask/

    It would be best to post Java related issues on a Java forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •