Configuring Datasource on Weblogic Server

Precondition: We will create a Data Source using PostgresSQL. In order to test it you will have to install Postgres  and keep and instance running on port-5460. We also need to keep the Postgres-driver in the domain/lib folder.

Steps to Create a Data Source:

Step 1: Expand Services link Domain Structure, the Data Sources link will be displayed as given below:

Step1

 

Step 2: Click on the Data Sources link. the Summary for JDBC Data Sources page will be displayed. Click on new button, it will list down the different options. Select Generic Data Source from the dropdown menu as given below:

Step2

 

 

 

Step 3:  Create a new JDBC Data Source page is displayed. Enter the following details:

Name: DS1
JNDI Name: DS1
Database Type: PostgresSQL

Step3

 

 

 

 

Click on next button.

Step 4:   Select Database Driver: Other.

Step4

Click on next button.

Step 5:  The following page is displayed:

Step5

Click on next button.

Step 6: Enter the following details:

Database Name: postgres
Host Name: localhost
port: 5460
Database User Name: postgres
Password: saky
Confirm Password: saky

Step6

Click on next button.

Step 7:  Enter the following details:

Driver Class Name: org.postgresql.Driver
URL: jdbc:postgresql://postgres:5460/postgres
Database User Name: postgres
Password: saky
Confirm Password:saky
Properties: user=postgres
Step7

Click on next button.

Step 8:  Click on Test Configuration button. The following message should be displayed:

“Connection test succeeded.”

Click on next button.

Step 9: Select AdminServer as given below:

Step8

 

Step 10:  The Data source DS1 created appears in the Summary of JDBC Data Sources page as given below:

Step9

Step 11: Click on DS1 on the the Summary of JDBC Data Sources page. Click on Connection Pool link.

Step12

Expand Advanced section and check the field Test Connections On Reserve as given below:

Step13

 

Click on Save button.

Step 12: To test the connection:

Click on  Monitoring -> Testing

Step10

Step 13: Select the AdminServer .

Step11

Step 14: Click on Test data source. The following message is displayed:

“Test of DS1 on server AdminServer was successful.”

Note: You can also test by deploying a basic application on Weblogic Server and using the datasource created by the above steps.