|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.database.adapter.Database
public abstract class Database
Database
is an abstract class that encapsulates the database related information. It is used to simply add new databases to the tool.
A new database class has to extend Database
. Additionally, the JDBC library for that database has to be added.
Constructor Summary | |
---|---|
Database(DBInfo dbInfo)
Initializes the database instance members and loads the settings provided by the parameter dbInfo . |
|
Database(InputStream iStream)
Initializes the database using the passed InputStream . |
|
Database(Properties prop)
Initializes the database using the passed Properties . |
Method Summary | |
---|---|
Connection |
createConnection()
Returns a Connection object, which represents a new connection to the database. |
boolean |
equals(Database other)
Checks whether two Database instances have the same information stored. |
abstract String |
getDatabaseDriverName()
Returns the Driver 's name used for loading the Driver class. |
String |
getDatabaseName()
Returns the name of the database. |
String |
getHost()
Returns the host information of the underlying database system. |
abstract String |
getJDBCString()
Returns the JDBC String which can be used for representing a connection to this database. |
int |
getPort()
Returns the port of the underlying database system. |
String |
getSQLSchema()
Returns the schema, which is used by this database connection. |
void |
loadDatabaseInformation(InputStream iStream)
Loads the data from the InputStream . |
void |
loadDatabaseInformation(Properties prop)
Loads the data from a Properties instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Database(DBInfo dbInfo)
dbInfo
.
dbInfo
- Information needed for establishing a connection to this database.public Database(InputStream iStream)
InputStream
. The information provided by this stream has to convertible into a
Properties
instance.
iStream
- The InputStream
that provides the connection information.public Database(Properties prop)
Properties
.
prop
- The Properties
instance that provides the connection information.Method Detail |
---|
public void loadDatabaseInformation(InputStream iStream)
InputStream
.
iStream
- The stream from which the database information are read.public void loadDatabaseInformation(Properties prop)
Properties
instance.
prop
- The properties from which the database information are read.public String getSQLSchema()
public String getHost()
public int getPort()
public String getDatabaseName()
public Connection createConnection() throws SQLException, ClassNotFoundException
Connection
object, which represents a new connection to the database.
Connection
object used for this database.
SQLException
- If the connection could not be established.
ClassNotFoundException
- If the Driver class could not be loaded.public boolean equals(Database other)
Database
instances have the same information stored.
other
- The other Database
instance.
true
, if all the information is the same; otherwise false
.public abstract String getJDBCString()
public abstract String getDatabaseDriverName()
Driver
's name used for loading the Driver class. The corresponding library has to be added to the build path.
Driver
class name which is used for the database connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |