Executing SQL

The SQL Maven plugin sends SQL statements to the RDBMS of your choice.

In the example the data set required for running the Unit Test cases is created before the execution of the test phase.

<!-- execute SQL statements -->

                    <!-- specify the dependent jdbc driver here -->

                <!-- common configuration shared by all executions -->

                    <!-- Create unittest testdata -->

Few remarks:

  • 2 dependencies (Oracle and PostgreSQL drivers) are configured because my project was being tested with the 2 databases
  • configuration settings are defined in the profiles.xml file
  • the execution runs the sql contained in an external file (property ${sql-file})

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: