public class ExternalDatabase extends AbstractDatabase
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.Modifier and Type | Field and Description |
---|---|
static String |
DB_PASSWORD_PROP
System property/environment variable that defines the database password.
|
static String |
DB_URL_PROP
System property/environment variable that defines the database URL.
|
static String |
DB_USER_PROP
System property/environment variable that defines the database user.
|
Constructor and Description |
---|
ExternalDatabase() |
Modifier and Type | Method and Description |
---|---|
void |
doStart()
To be implemented by subclasses to start the database.
|
void |
doStop()
To be implemented by subclasses to stop the database.
|
String |
getExternalJdbcUrl()
Gets the external Jdbc URL to connect to this database from other JVMs.
|
String |
getJdbcUrl()
Gets the Jdbc Url to connect to this database.
|
String |
getPassword()
Gets the password to connect to the database.
|
String |
getUsername()
Gets the username to connect to the database.
|
createDataSource, getActiveConnections, getProperty, start, stop
public static final String DB_URL_PROP
public static final String DB_USER_PROP
public static final String DB_PASSWORD_PROP
public String getExternalJdbcUrl()
Database
public String getJdbcUrl()
Database
public String getPassword()
Database
public String getUsername()
Database
public void doStart()
AbstractDatabase
doStart
in class AbstractDatabase
public void doStop()
AbstractDatabase
doStop
in class AbstractDatabase
Copyright © 2022. All rights reserved.