java.lang.Object
dev.lydtech.component.framework.client.database.MariaDbClient

public class MariaDbClient extends Object
  • Method Details

    • getInstance

      public static MariaDbClient getInstance()
    • getConnection

      public static Connection getConnection() throws Exception
      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

      public static void close(Connection connection) throws Exception
      Close the MariaDB connection.
      Throws:
      Exception
    • getDbHostAndPortUrl

      public static String 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.