Class MariaDbClient
java.lang.Object
dev.lydtech.component.framework.client.database.MariaDbClient
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(Connection connection) Close the MariaDB connection.static ConnectionConnect to MariaDB with the database properties as set in System properties.static ConnectiongetConnection(String databaseName, String username, String password) Connect to MariaDB with the database properties passed in.static StringGet the URL of the database with the host and port.static MariaDbClient
-
Method Details
-
getInstance
-
getConnection
Connect to MariaDB with the database properties as set in System properties.- Throws:
Exception
-
getConnection
public static Connection getConnection(String databaseName, String username, String password) throws Exception Connect to MariaDB with the database properties passed in. This is useful when re-running component tests with the containers left up between runs and not wanting to set the system properties for each test run.- Throws:
Exception
-
close
Close the MariaDB connection.- Throws:
Exception
-
getDbHostAndPortUrl
Get the URL of the database with the host and port. The port is the mapped port of the docker container, such that this can be used to connect to from the tests.
-