While developing business processes in TIBCO BW using designer, you can connect to different types of database systems like Oracle, MS SQL, MySQL etc. to perform different types of operations in database.
In this step by step tutorial, I will explain how you can connect to MySql database in TIBCO to query data from a mysql table.
Step 1: Create MySql database table and insert Data:
We need to have some data in our MySql database table which we will query later in subsequent steps in this tutorial. I have already created a database in MySQL with the name db_test with a table tbl_employees. I have also added two records in this table as shown below:
Step 2: Configure JDBC Connection for MySQL in TIBCO BW Project:
Once we have our MySQL database up and running, we need to configure JDBC connection in our TIBCO project for MySQL database.
You need to select following values in JDBC configuration while connecting to MySQL database in TIBCO:
1. Connection Type: JDBC
2. JDBC Driver: com.mysql.jdbc.Driver
3. Database URL: Here you need to specify the Host and Port at which your MySQL database server is listening. In my case, Host is Localhost and port is 3306. We also specify database name in our database url string here.
4. User Name: MySQL database user name
5. Password: MySQL database password
Please note that you should have MySQL JDBC Connector Jar file present in the path tibco\tra\5.x\lib in order to connect your TIBCO application with MySQL database.
In my case, you can see in below screenshot that MySQL JDBC connector JAR file is present in this lib path:
Below screenshot shows all the fields populated for connecting to MySQL database in TIBCO:
Step 3: Create TIBCO Process to query data from MySQL database:
Now we have data available in our MySQL database table and we have also successfully configured our MySQL JDBC connection, we are now good to go for developing a BW process in designer to query data from this table.
Below is a simple process for querying data from MySQL database. We are simply querying employee names (emp_name) from MySQL table using the connection that we configured in step 2 of this tutorial:
Step 4: Test process for Querying data from MySQL database in TIBCO:
After validating the process successfully, we now load the process in Designer Tester and see if it successfully connects and fetches data from MySQL database table.
As you can see below, code has run successfully and data base been queried from the MySQL table.