Today I’m going to go through on how to create the Database Connection Pool and JNDI on OC4J. If you’re not sure about the Database Connection Pool and JNDI please check the previous post.
I’ll use Oracle database as a data source and Oracle Enterprise Manager (EM) that comes with OC4J as a tool to create the Database Connection Pool and JNDI.
Access to Enterprise Manager (EM)
First you need to create a Connection Pool and then you can create a JNDI Data Source mapping to the Connection Pool. You can do such by using the EM so first let’s login to the EM. Here is the URL for the EM for the OC4J.
If you installed OC4J as part of your BI EE or BI Publisher installation then the port number is the same for your BI Publisher application, such as ‘9704’.
e.g. http://knishida-pc:9704/em
Once you have logged in to your EM you should see the window like the below.
Login to Oracle Enterprise Manager (OC4J Admin Console)
Create Database Connection Pool
Now let’s create a Database Connection Pool. You need a JDBC connection information for your database for this task.
1. Click on the ‘Administration’ tab
2. Click ‘Go To Task’ link of ‘JDBC Resources’
3. Click ‘Create’ under Connection Pool
4. Click on the ‘Continue’ button (Leave all the fields as default)
5. Enter the following information
Name | Financial |
Connection Factory Class | oracle.jdbc.pool.OracleDataSource |
JDBC URL | jdbc:oracle:thin:@<hostname>:<port_number>:<sid> |
Username | <database_schema_name> |
Use Cleartext Password | Check |
Password | <Password for the database_schema) |
6. Click 'Test Connection' button, which is located under URL section
7. Click ‘Test’ button
If you get an error message make sure all the values entered at the above steps are correct.
8. Click on the ‘Finish’ button
Now you have created one Database Connection Pool at your OC4J server. Now you need to register it with JNDI.
Create Data Source (Register with JNDI)
Now you are going to create a ‘Data Source’, which is basically that you’re registering the previously created Database Connection Pool with JNDI so that you can access to the connection pool through the JNDI. This example will create a Financial JNDI data source.
1. Click on the ‘Create’ button under Data Sources
2. Click on the ‘Continue’ button (Leave all the fields as default)
3. Enter the following information
Name | Financial |
Connection Factory Class | jdbc/FIN |
Transaction Level | Leave as default |
Connection Pool | Financial |
You can enter any name for the JNDI location, but this will later be referenced as a JNDI data source so you want to a standard naming rule such as jdbc/<database_name> or something like that.
4. Click ‘Finish’ button
You can click the ‘Test Connection’ icon for the Data Source you have just created to make sure that it works. If it works fine that means now you have created one JNDI connection for your database!
I’ll talk about how to register the JNDI connection in BI Publisher tomorrow, so stay tuned!
Hi Kan Nishida,
ReplyDeleteThanks for the wonderful posts.
Is it possible for you to post on - Setting up connection pool in tomcat 5.5 and configuring it in BI Publisher 10g.
Thanks.