|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpl.mipl.util.jqi
The jqi (Java Query Inferface) class contains database utility functions
for use with the MIPL database system. The main methods of interest
are the getSybaseUrl()
, getUserName()
, and
getPassword()
methods.
The getSybaseUrl()
method returns a string
containing the Sybase JDBC URL.
The getUserName()
method returns the user's database
username.
The getPassword()
method returns the user's password.
All of this info is contained in the jqi()
class.
It is stored internally in a Properties
hashtable, which is
not visible to the caller.
The necessary info
is entered by the user when the jqi constructor is called.
Example:
// create a jqi object
jqi miplDb = new jqi();
// create a database connection using the JDBC DriverManager
Connection conn = DriverManager.getConnection(
 miplDb.getSybaseUrl(),miplDb.getUserName(),
 miplDb.getPassword());
Note: Although the set methods of this class are public, it is not necessary to call them. The constructor will set the class variables at creation time.
Change Log:
6/3/02 Tina Pavlicek modified and added code by Alice Stanboli to try
to retrieve the password using the password server before asking the user
directly for the password.
6/14/02 Tina Pavlicek modified and added code by Elais Sayfi to retrieve
the password through a GUI if the password server did not provide one
8/24/02 Tina Pavlicek disallowed setting of password in setProps method
which stops users from directly sending a password retrieved from a
command line. The password can now be set with the sendProps method and
the onus is on the jqi user to retrieve that password securely.
9/17/2002 Tina Pavlicek moved the new JFrame and JDialog calls into the createGUI method to prevent machines running the program from trying to create a display when not necessary. 9/18/2002 Tina Pavlicek made a minor change so that jqi would work with a new version of pwdclient. 11/25/2002 Tina Pavlicek removed a command line prompt for user name to eliminate conflicts with scripts calling programs that use jqi
Constructor Summary | |
jqi()
Construct a jqi object. |
Method Summary | |
String |
getDatabase()
Returns the database string. |
String |
getDbmsType()
Returns the DbmsType string. |
String |
getOs()
Returns the Operating System (OS) string. |
String |
getPassword()
Returns the password string. |
String |
getSelCat()
Returns the VICAR $SELCAT Unix environment variable. |
String |
getServer()
Returns the server string. |
String |
getServerName()
Returns the server name string. |
String |
getSybaseUrl()
Returns a string containing the Sybase JDBC URL for the current database. |
String |
getUserName()
Returns the username string. |
static void |
main(String[] args)
A small test program. |
String |
parseServerString(String serverName)
Returns the server string given the server name. |
void |
queryProps()
|
void |
sendProps(String userN,
String passW,
String dataB,
String dbmsT,
String serverN)
|
void |
setDatabase(String database)
Sets the database string. |
void |
setDbmsType(String dbms)
Sets the DbmsType string. |
void |
setPassword(String password)
Sets the password string. |
void |
setProps(String[] args)
|
void |
setServerName(String serverName)
Sets the server name string. |
void |
setUserName(String user)
Sets the user name string. |
void |
windowDeiconified(WindowEvent e)
|
void |
windowIconified(WindowEvent e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public jqi()
1. Reading a user preferences file (if it exists) called ".jqi",
stored in the user's home
directory.
2. Querying the user via the command line for the various
required information.
3. Reading/parsing of the $SYBASE/interfaces
file.
Method Detail |
public void windowDeiconified(WindowEvent e)
public void windowIconified(WindowEvent e)
public void setProps(String[] args)
public void sendProps(String userN, String passW, String dataB, String dbmsT, String serverN)
public void queryProps()
public String getUserName()
public void setUserName(String user)
user
- A string containing the user name.public String getPassword()
public void setPassword(String password)
password
- A string containing the password.public String getServer()
public String getDatabase()
public void setDatabase(String database)
database
- A string containing the database name.public String getDbmsType()
public void setDbmsType(String dbms)
dbms
- A string containing the DBMS type.public String getOs()
public String getServerName()
public void setServerName(String serverName)
serverName
- A string containing the server name.public String getSybaseUrl()
public String parseServerString(String serverName)
serverName
- A string containing the name of
the server.
public String getSelCat()
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |