uk.ac.starlink.table.jdbc
Class TerminalAuthenticator

java.lang.Object
  |
  +--uk.ac.starlink.table.jdbc.TerminalAuthenticator
All Implemented Interfaces:
JDBCAuthenticator

public class TerminalAuthenticator
extends Object
implements JDBCAuthenticator

Provides JDBC authentication using the terminal; assumes that someone is sitting at System.in/System.out.


Constructor Summary
TerminalAuthenticator()
           
 
Method Summary
 String[] authenticate()
          Obtains username and password.
static String readPassword()
           
static String readUser()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminalAuthenticator

public TerminalAuthenticator()
Method Detail

authenticate

public String[] authenticate()
                      throws IOException
Description copied from interface: JDBCAuthenticator
Obtains username and password. The return value is a two-element array containing the username and password to be used, in that order. Either or both of these may be null.

Specified by:
authenticate in interface JDBCAuthenticator
Returns:
String[]{username,password}
Throws:
IOException - if there is some error

readUser

public static String readUser()
                       throws IOException
IOException

readPassword

public static String readPassword()
                           throws IOException
IOException

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.