dbms
Class DBMSSocket

java.lang.Object
  extended by dbms.DBMSSocket

public class DBMSSocket
extends java.lang.Object

This is a public interface socket for accesing the services of the DBMS package


Field Summary
private static DBMSBase conn
           
private static DBMSDrivers drivers
           
 
Constructor Summary
DBMSSocket()
           
 
Method Summary
static void getCatalogs(java.util.ArrayList<java.lang.String> catalogs)
          Updates an arraylist you provide to contain all the catalogs (databases) in the currently connected DBMS
static boolean getConnection(java.lang.String hostname, int vendor, java.lang.String user, java.lang.String password)
          Gets a database connection from supplied information
static void getTables(java.util.ArrayList<java.lang.String> tables, java.lang.String catalog)
          This method allows access to storing inormation on a database.
static java.lang.String[] getVendors()
          An array of vendor names.
static void sendDataToDBMS(java.lang.String database, java.lang.String tableName, java.util.ArrayList<java.lang.Object> columnNames, java.util.ArrayList<java.lang.Object> columnTypes, java.util.List<java.util.List<java.lang.Object>> data)
          This method allows access to storing information on a database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

private static DBMSBase conn

drivers

private static DBMSDrivers drivers
Constructor Detail

DBMSSocket

public DBMSSocket()
Method Detail

getVendors

public static java.lang.String[] getVendors()
                                     throws java.lang.Exception
An array of vendor names. Use the String Array's ordinals for selecting a vendor when using 'getConnection();

Returns:
A String array of vendor names.
Throws:
java.lang.Exception

getConnection

public static boolean getConnection(java.lang.String hostname,
                                    int vendor,
                                    java.lang.String user,
                                    java.lang.String password)
                             throws java.lang.ClassNotFoundException,
                                    java.lang.Exception
Gets a database connection from supplied information

Parameters:
hostname -
vendor -
user -
password -
Returns:
Boolean if connection successful
Throws:
java.lang.ClassNotFoundException
java.lang.Exception

sendDataToDBMS

public static void sendDataToDBMS(java.lang.String database,
                                  java.lang.String tableName,
                                  java.util.ArrayList<java.lang.Object> columnNames,
                                  java.util.ArrayList<java.lang.Object> columnTypes,
                                  java.util.List<java.util.List<java.lang.Object>> data)
                           throws java.lang.Exception
This method allows access to storing information on a database.

Parameters:
database -
tableName -
columnNames -
columnTypes -
data -
Throws:
java.lang.Exception

getTables

public static void getTables(java.util.ArrayList<java.lang.String> tables,
                             java.lang.String catalog)
                      throws java.sql.SQLException
This method allows access to storing inormation on a database.

Parameters:
tables -
catalog -
Throws:
java.sql.SQLException

getCatalogs

public static void getCatalogs(java.util.ArrayList<java.lang.String> catalogs)
                        throws java.sql.SQLException
Updates an arraylist you provide to contain all the catalogs (databases) in the currently connected DBMS

Parameters:
catalogs -
Throws:
java.sql.SQLException