|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wamblee.support.persistence.AbstractDatabase
org.wamblee.support.persistence.ExternalDatabase
public class ExternalDatabase
Database that encapsulates connection to an external database. Database
connection details can be configured through system properties and
environment variables, see DB_URL_PROP, DB_USER_PROP, and
{@link #DB_PASSWORD_PROP|.
This class assumes modern database drivers that work together with
java.util.ServiceLoader so that explicitly doing a Class.forName() is not
necessary to load the database driver.
| Field Summary | |
|---|---|
static java.lang.String |
DB_PASSWORD_PROP
System property/environment variable that defines the database password. |
static java.lang.String |
DB_URL_PROP
System property/environment variable that defines the database URL. |
static java.lang.String |
DB_USER_PROP
System property/environment variable that defines the database user. |
| Constructor Summary | |
|---|---|
ExternalDatabase()
|
|
| Method Summary | |
|---|---|
void |
doStart()
|
void |
doStop()
|
java.lang.String |
getExternalJdbcUrl()
Gets the external Jdbc URL to connect to this database from other JVMs. |
java.lang.String |
getJdbcUrl()
Gets the Jdbc Url to connect to this database. |
java.lang.String |
getPassword()
Gets the password to connect to the database. |
java.lang.String |
getUsername()
Gets the username to connect to the database. |
| Methods inherited from class org.wamblee.support.persistence.AbstractDatabase |
|---|
createDataSource, getActiveConnections, getProperty, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DB_URL_PROP
public static final java.lang.String DB_USER_PROP
public static final java.lang.String DB_PASSWORD_PROP
| Constructor Detail |
|---|
public ExternalDatabase()
| Method Detail |
|---|
public java.lang.String getExternalJdbcUrl()
Database
public java.lang.String getJdbcUrl()
Database
public java.lang.String getPassword()
Database
public java.lang.String getUsername()
Database
public void doStart()
doStart in class AbstractDatabasepublic void doStop()
doStop in class AbstractDatabase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||