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.

 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?

I originally posted this in Oracle by mistake, I am restating it here. I was provided with the following link, which I suppose would work, but I was hoping for a simplier solution and I don't need all of the extra safeguards those solutions add.


Any thoughts or should I just do it the involved way?

Thanks again.