Class msql.Msql
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class msql.Msql

java.lang.Object
   |
   +----msql.Msql

public class Msql
extends Object
Msql Class - implements a connection to a remote server and a JAVA variant of the Msql API as defined by David Hughes

Variable Index

 o CHAR
 o INT
 o REAL

Constructor Index

 o Msql()
Constructor
 o Msql(String)
Msql Constructor - establishes connection to named host

Method Index

 o _ListFields(String)
List Fields in a given table.
 o Close()
Close - close the connection to the server.
 o Connect(String)
Connect - establishes connection to named host
 o Connect(String, int)
Connect - connect using a specified port
 o Connect(String, String)
Connect - establishes connection to named host
 o Connect(String, String, int)
Connect - connect using a specified port
 o CreateDB(String)
Create a new database.
 o DropDB(String)
Drop a database.
 o ListDBs()
List Databases available on server.
 o ListFields(String)
List Fields in a given table.
 o ListTables()
List tables in the selected database.
 o Query(String)
Send an SQL Query to the server.
 o ReloadACL(String)
Reload access control list.
 o SelectDB(String)
SelectDB - Select the database to work with
 o Shutdown()
Shutdown server.

Variables

 o INT
  public final static int INT
 o CHAR
  public final static int CHAR
 o REAL
  public final static int REAL

Constructors

 o Msql
  public Msql()
Constructor
 o Msql
  public Msql(String msqlServer) throws MsqlException
Msql Constructor - establishes connection to named host
Parameters:
msqlServer - the name of the msql server.

Methods

 o Connect
  public synchronized void Connect(String msqlServer,
                                   String userName) throws MsqlException
Connect - establishes connection to named host
Parameters:
msqlServer - the name of the msql server.
userName - user name the applet will assume.
Throws: MsqlException
1. Open socket. 2. Establish IO Streams on socket. 3. Obtain version info. 4. Supply user name. 5. Retrieve status.
 o Connect
  public void Connect(String msqlServer,
                      String userName,
                      int tcpPort) throws MsqlException
Connect - connect using a specified port
Parameters:
msqlServer - the name of the msql server.
userName - user name the applet will assume.
tcpPort - port for msql connections
Throws: MsqlException
as above.
 o Connect
  public void Connect(String msqlServer) throws MsqlException
Connect - establishes connection to named host
Parameters:
msqlServer - the name of the msql server.
Throws: MsqlException
as above.
 o Connect
  public void Connect(String msqlServer,
                      int tcpPort) throws MsqlException
Connect - connect using a specified port
Parameters:
msqlServer - the name of the msql server.
tcpPort - port for msql connections
Throws: MsqlException
as above.
 o Close
  public synchronized void Close() throws MsqlException
Close - close the connection to the server.
 o SelectDB
  public synchronized void SelectDB(String db) throws MsqlException
SelectDB - Select the database to work with
Parameters:
db - the name of the database to select.
Throws: MsqlException
if select fails.
 o Query
  public synchronized MsqlResult Query(String s) throws MsqlException
Send an SQL Query to the server.
Parameters:
s - the Query string.
Returns:
null when used with INSERT/UPDATE or similar queries which do not return data
Throws: MsqlException
when query or communication fails.
 o ListDBs
  public synchronized String[] ListDBs() throws MsqlException
List Databases available on server.
Returns:
array of String cointaining names of databases.
Throws: MsqlException
if ListDB or communication fails.
 o ListTables
  public synchronized String[] ListTables() throws MsqlException
List tables in the selected database.
Returns:
array of String conttaining names of tables.
Throws: MsqlException
if ListTables or communication fails.
 o _ListFields
  public synchronized MsqlData _ListFields(String s) throws MsqlException
List Fields in a given table.
Parameters:
s - name of the table for which information requested.
Returns:
MsqlData structure containing field information.
Throws: MsqlException
if ListTables or communication fails.
 o ListFields
  public synchronized MsqlFieldDesc[] ListFields(String s) throws MsqlException
List Fields in a given table.
Parameters:
s - name of the table for which information requested.
Returns:
array of MsqlFieldDesc containing field information.
Throws: MsqlException
if ListTables or communication fails.
 o CreateDB
  public synchronized void CreateDB(String s) throws MsqlException
Create a new database. Included for completeness only since command can only be executed if issued from UNIX domain socket.
 o DropDB
  public synchronized void DropDB(String s) throws MsqlException
Drop a database. Included for completeness only since command can only be executed if issued from UNIX domain socket.
 o ReloadACL
  public synchronized void ReloadACL(String s) throws MsqlException
Reload access control list. Included for completeness only since command can only be executed if issued from UNIX domain socket.
 o Shutdown
  public synchronized void Shutdown() throws MsqlException
Shutdown server. Included for completeness only since command can only be executed if issued from UNIX domain socket.

All Packages  Class Hierarchy  This Package  Previous  Next  Index