public class TerminalAuthenticator extends java.lang.Object implements JDBCAuthenticator
System.in.| Constructor and Description |
|---|
TerminalAuthenticator()
Constructs a new authenticator which uses System.err for prompting.
|
TerminalAuthenticator(java.io.PrintStream promptStrm)
Constructs a new authenticator with a given stream to use for
writing prompts.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
authenticate()
Obtains username and password.
|
java.lang.String |
readPassword()
Prompts to the prompt stream and reads the password from standard
input.
|
java.lang.String |
readUser()
Prompts to the prompt stream and reads the user name from standard
input.
|
public TerminalAuthenticator(java.io.PrintStream promptStrm)
promptStrm - output stream for promptingpublic TerminalAuthenticator()
public java.lang.String[] authenticate()
throws java.io.IOException
JDBCAuthenticatornull.authenticate in interface JDBCAuthenticatorString[]{username,password}java.io.IOException - if there is some errorpublic java.lang.String readUser()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readPassword()
throws java.io.IOException
java.io.IOException