public abstract class AbstractDbDriver extends Object
Constructor and Description |
---|
AbstractDbDriver() |
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Open a connection to the database.
|
Connection |
getConnection(Properties props)
Open a connection to the database.
|
Properties |
getConnectionProperties()
Get properties for a database connection.
|
abstract String |
getName()
Get the name of the database driver.
|
abstract String |
getUrl()
Get the JDBC-URL to the database.
|
String |
getUser() |
abstract void |
init()
Init the JDBC-driver before the first connection is established.
|
void |
setUser(String user,
String pass)
Setup user account for connecting the database server.
|
void |
shutdown()
Shutdown the database driver, before the application is closed.
|
public final Connection getConnection() throws SQLException
SQLException
public final Connection getConnection(Properties props) throws SQLException
props
- properties for the created connectionsSQLException
public final Properties getConnectionProperties()
public abstract String getName()
public abstract String getUrl()
public String getUser()
public abstract void init() throws ClassNotFoundException
ClassNotFoundException
- JDBC-driver is not foundpublic final void setUser(String user, String pass)
user
- usernamepass
- passwordpublic void shutdown()
Copyright © 2015 OpenEstate. All rights reserved.