Working with SQL (JDBC)
This recipe focuses on the interaction between Orchestrator and an SQL database using the Java database connector (JDBC). You will learn how to send SQL queries as well as commands to a database.
Getting ready
Obviously, we need a database. This database can be PostgreSQL, MS SQL, Oracle, or MySQL. For testing, you can use the PostgreSQL database that is implemented in the appliance (refer to the Tuning the appliance recipe in Chapter 2, Optimizing Orchestrator Configuration). Also, take a look at the There's more... section of this recipe.
We will use a Microsoft SQL 2008 R2 database in this example; however, the steps are the same for all databases. The database we will be using is called testDB
.
You will need an existing database and a user who is able to create/drop tables as well as insert/delete information, for example, the DBO role.
How to do it...
This recipe has multiple parts that will cover all aspects of working with a database.