bass.db
Class DBObject

java.lang.Object
  extended by bass.db.DBObject

public class DBObject
extends java.lang.Object

DB Connection class

Version:
0.1
Author:
Schiefer, Fabian Winkhardt, Thomas Klein

Field Summary
private  int currentMode
           
static int EMBEDDED_DB
          the embedded derby DB
static int LOCAL_DB
          a maxdb running at localhost
private static java.lang.String propfile
           
static int SERVER_DB
          the DB server at search engine lab
 
Constructor Summary
DBObject()
          Deprecated. plz don't use this for safety reasons ... use the DBObject(int) constructor
DBObject(int db)
          generates a db object for the specified DB
 
Method Summary
 java.sql.Connection get_connection()
          Generates a DB Connection from information @ properties/db.properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propfile

private static java.lang.String propfile

EMBEDDED_DB

public static final int EMBEDDED_DB
the embedded derby DB

See Also:
Constant Field Values

SERVER_DB

public static final int SERVER_DB
the DB server at search engine lab

See Also:
Constant Field Values

LOCAL_DB

public static final int LOCAL_DB
a maxdb running at localhost

See Also:
Constant Field Values

currentMode

private int currentMode
Constructor Detail

DBObject

public DBObject()
Deprecated. plz don't use this for safety reasons ... use the DBObject(int) constructor

base constructor, uses the information in /properties/db.properties for the connection


DBObject

public DBObject(int db)
generates a db object for the specified DB

Parameters:
db - can be EMBEDDED_DB, SERVER_DB or LOCAL_DB (constants from this class)
Method Detail

get_connection

public java.sql.Connection get_connection()
                                   throws java.sql.SQLException
Generates a DB Connection from information @ properties/db.properties

Returns:
a Connection object
Throws:
java.sql.SQLException - if method can't connect to db or db doesn't exist