dbms
Class DBConnection

java.lang.Object
  extended by dbms.DBConnection

public class DBConnection
extends java.lang.Object

Methods to establish a connection to a database


Field Summary
private  java.sql.DatabaseMetaData dbm
           
private  java.sql.Statement statement
           
 
Constructor Summary
DBConnection(java.lang.String url, java.lang.String driver, java.lang.String user, java.lang.String password)
          Constructor
 
Method Summary
 java.sql.DatabaseMetaData getDatabaseMetaData()
          returns the current database meta data object
 java.sql.Statement getStatement()
          returns the current statement object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statement

private java.sql.Statement statement

dbm

private java.sql.DatabaseMetaData dbm
Constructor Detail

DBConnection

public DBConnection(java.lang.String url,
                    java.lang.String driver,
                    java.lang.String user,
                    java.lang.String password)
             throws java.lang.ClassNotFoundException,
                    java.sql.SQLException
Constructor

Parameters:
url - A url connection address (localhost)
driver - A driver location
user - A username for the dbms
password - a password for the dbms
Throws:
java.lang.ClassNotFoundException
java.sql.SQLException
Method Detail

getStatement

public java.sql.Statement getStatement()
returns the current statement object

Returns:
database statement object

getDatabaseMetaData

public java.sql.DatabaseMetaData getDatabaseMetaData()
returns the current database meta data object

Returns:
DatabaseMetaDataObject