In order to perform database testing, the most important part is to run sql queries.
This method uses JDBC driver to connect to the SQL database and execute a query. This returns data from SQL database and that can be used further for any assertion in database testing automation.
While writing the method we assumed that the query to be run will return a table with column “empid“. This is just a sample database connection and validation. You can change it to suite your requirement.