pedviz.loader
Class MultiDatabase

java.lang.Object
  extended by pedviz.loader.MultiDatabase
All Implemented Interfaces:
Database

public class MultiDatabase
extends java.lang.Object
implements Database

This class allows the DatabaseGraphLoader to load data from the database defined in the given property file.

Author:
lukas forer

Constructor Summary
MultiDatabase(java.lang.String filename)
          Creates a new Database object with the properties stored in the given file.
MultiDatabase(java.lang.String user, java.lang.String password, java.lang.String host, java.lang.String driver)
          Creates a new Database object with the given username, password, host and driver.
 
Method Summary
 void close()
          Closes the db connection.
 boolean connect()
          Connects to the db with the given
 boolean connect(java.lang.String user, java.lang.String passord, java.lang.String host)
          Connects to the db with the given username, password and host.
 java.sql.ResultSet executeQuerie(java.lang.String querie)
          Executes the given Querie.
 java.util.Vector<java.lang.String> getColumns(java.lang.String table)
          Returns a collection of all columns defined in the given table.
 java.sql.Connection getConnection()
          Returns the connection.
 java.lang.String getInfo()
          Returns some informations about the db.
 java.lang.String getLabel()
          Returns the description od the database.
 java.util.Vector<java.lang.String> getTables()
          Returns a collection of all tables in this database.
 boolean isConnected()
          Returns true, if the db is connected.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiDatabase

public MultiDatabase(java.lang.String user,
                     java.lang.String password,
                     java.lang.String host,
                     java.lang.String driver)
Creates a new Database object with the given username, password, host and driver.

Parameters:
user - username.
password - passsword.
host - hostname.
driver - drivername.

MultiDatabase

public MultiDatabase(java.lang.String filename)
Creates a new Database object with the properties stored in the given file.

Parameters:
filename - filename of the property file.
Method Detail

connect

public boolean connect(java.lang.String user,
                       java.lang.String passord,
                       java.lang.String host)
Description copied from interface: Database
Connects to the db with the given username, password and host.

Specified by:
connect in interface Database
Returns:
true, if the connection is ok.

connect

public boolean connect()
Connects to the db with the given

Returns:
true, if the connection is ok.

close

public void close()
Description copied from interface: Database
Closes the db connection.

Specified by:
close in interface Database

isConnected

public boolean isConnected()
Description copied from interface: Database
Returns true, if the db is connected.

Specified by:
isConnected in interface Database
Returns:
true, if the db is connected.

getInfo

public java.lang.String getInfo()
Description copied from interface: Database
Returns some informations about the db.

Specified by:
getInfo in interface Database
Returns:
some informations about the db.

executeQuerie

public java.sql.ResultSet executeQuerie(java.lang.String querie)
Description copied from interface: Database
Executes the given Querie.

Specified by:
executeQuerie in interface Database
Returns:
result

getTables

public java.util.Vector<java.lang.String> getTables()
Returns a collection of all tables in this database.

Returns:
a collection of all tables in this database.

getColumns

public java.util.Vector<java.lang.String> getColumns(java.lang.String table)
Returns a collection of all columns defined in the given table.

Parameters:
table - tablename.
Returns:
a collection of all columns defined in the given table.

getConnection

public java.sql.Connection getConnection()
Description copied from interface: Database
Returns the connection.

Specified by:
getConnection in interface Database
Returns:
connection

getLabel

public java.lang.String getLabel()
Returns the description od the database.

Returns:
the description od the database.