Database Plugin - Prerequisites

To connect to a database and so to use database targets, an automation Squash TF project need an adequat JDBC driver (the driver depends on the database type : mysql, oracle…).

The driver is provided in the form of a maven artifact that we add in the automation project. To do so, we modify the ‘squash-ta-maven-plugin’ inside the pom.xml file :

<build>
    <plugins>
        <plugin>
            <groupId>org.squashtest.ta</groupId>
            <artifactId>squash-ta-maven-plugin</artifactId>
            <version>squash-ta-maven-plugin version</version>

            <dependencies>
                <dependency>
                    <groupId>JDBC driver groupId</groupId>
                    <artifactId>JDBC driver artifact ID</artifactId>
                    <version>JDBC driver version</version>
                </dependency>
            <dependencies>

Example of JDBC Driver for MySql :

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.17</version>
</dependency>

Project’s POM File :

../../_images/database-pom.png

.properties File to connect to database :

../../_images/database-properties.png

For more information, please check this section.