Place
the cursor over this icon to load and view all the screenshots for this tutorial.
(Caution: Because this action loads all screenshots simultaneously, response
time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor
over each individual icon in the following steps to load and view only the screenshot
associated with that step.
The screenshots are provided to give you an idea of how to configure and administer specific
functionality in Oracle WebLogic Server and may not reflect the specific environment
that you are using.
Overview
A data source object enables a Java Database Connectivity (JDBC) client to obtain a DBMS connection from a JDBC pool. The connection pool within a JDBC data source contains a group of JDBC connections that applications reserve, use, and then release to the pool. The connection pool and the connections within it are created when the connection pool is registered. The connections pool is usually registered when starting up WebLogic Server or when deploying the data source to a new target.
In this OBE you will create a dizzyworldDS data source to connect to an Oracle Database .
You are an application server administrator in the Dizzyworld
Corporation. You have installed and configured Oracle WebLogic Server for your
enterprise. For information on how to install and configure Oracle WebLogic Server, please refer to these OBEs:
The system architects at Dizzyworld have decided to create dizzyworldDS data source object to connect to HRDATA in an Oracle Database. The data sources and their connection pools provide better connection management and help to keep the system running with better performance.
Prerequisites
Before you start the tasks, make sure that your system environment
meets the following requirements:
Prerequisite Tutorials:
Before starting this tutorial, you should complete the following
prerequisite tutorials:
The system should have installed the following products:
Oracle WebLogic Server
Oracle Database 10g or higher
Download Required Files
Download the necessary Conf_JDBC_OBE.zip and save it on your machine where you would be performing the tasks. Extract the content into your local drive. In this sample, the files are extracted into the /home/oracle/labs/wls103/testds folder. The extract contains three files:
File Name
Description
1.
testds_oracle.sql
A SQL script file to configure the required schema in Oracle Database.
2.
testds.war
A simple Web application file used for testing the configured data source.
3.
deploy_testds.py
A WLST script used for deploying the Web application.
Login to the system as the user that started the Oracle Database. Invoke a shell window and navigate to the location where you have downloaded the script:
$ cd /home/oracle/labs/wls103/testds
2.
Set up the database environment variables using the the following export shell command .
Then run the testds_oracle.sql script to create the necessary schema. This creates a schema named PBPUBLIC with three tables and populates the tables with a few rows.
The basic domain in this case consists of an Administration Server and a
Managed Server (dizzy1). To start the two servers, perform
the following steps:
1.
Invoke a new shell window and navigate to the bin subfolder under the folder where you have configured the domain For example:
$ cd /u01/app/oracle/product/Middleware/user_projects/domains/dizzyworld/bin .
2.
Run the startWebLogic.sh script to start the Administration Server.
3.
When prompted :with “Enter username to boot WebLogic server”, enter the administrative user name you have setup when you created the domain. In this case user name “admin” is shown. Then enter the password for admin user when prompted with “Enter password to boot WebLogic server”.
4.
This will start the Administration Server. Leave this shell window running.
5.
To start the Managed Server (dizzy1) in the domain, invoke another shell window.
6.
Navigate to bin subfolder in your domain and execute the following command: to start the managed server.
When prompted :with “Enter username to boot WebLogic server”, enter the administrative user name you have setup when you created the domain. In this case user name “admin” is shown. Then enter the password for admin user when prompted with “Enter password to boot WebLogic server”.
8.
This would start up the Managed Server. Again, leave this window as it is..
Testing JDBC Data Source Using Simple Web Application
1.
Open a new shell window, navigate to the folder where you have the testds.war application (for example: /home/labs/wls103/testds folder).
2.
Set the WL_HOME environment variable to point to the location where you have installed WLS 10.3..
3.
Run WL_HOME/server/bin/setWLSEnv.sh script to set up the environment variables.
4.
Run the command java weblogic.WLST deploy_testds.py to deploy the testds.war application..
5.
Open a Web browser and navigate to http://localhost:7003/testds/testdatasource.jsp to test the data source. Enter the administrative username and the corresponding password and click Test Data Source.