Working with SQL
This recipe focuses on the interaction between Orchestrator and a SQL database. 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 vcoapp
.
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.
Creating a JDBC connection URL
To connect to a SQL database, Orchestrator uses Java...