public class TerminalAuthenticator extends Object implements JDBCAuthenticator
System.in
.Constructor and Description |
---|
TerminalAuthenticator()
Constructs a new authenticator which uses System.err for prompting.
|
TerminalAuthenticator(PrintStream promptStrm)
Constructs a new authenticator with a given stream to use for
writing prompts.
|
Modifier and Type | Method and Description |
---|---|
String[] |
authenticate()
Obtains username and password.
|
String |
readPassword()
Prompts to the prompt stream and reads the password from standard
input.
|
String |
readUser()
Prompts to the prompt stream and reads the user name from standard
input.
|
public TerminalAuthenticator(PrintStream promptStrm)
promptStrm
- output stream for promptingpublic TerminalAuthenticator()
public String[] authenticate() throws IOException
JDBCAuthenticator
null
.authenticate
in interface JDBCAuthenticator
String[]{username,password}
IOException
- if there is some errorpublic String readUser() throws IOException
IOException
public String readPassword() throws IOException
IOException
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.