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, stoppublic static final String DB_URL_PROP
public static final String DB_USER_PROP
public static final String DB_PASSWORD_PROP
public String getExternalJdbcUrl()
Databasepublic String getJdbcUrl()
Databasepublic String getPassword()
Databasepublic String getUsername()
Databasepublic void doStart()
AbstractDatabasedoStart in class AbstractDatabasepublic void doStop()
AbstractDatabasedoStop in class AbstractDatabaseCopyright © 2025. All rights reserved.