Sun. Oct 24th, 2021

Requirement: Create a JDBC generic data sources in Oracle WebLogic Server.

Information: In WebLogic Server, we configure database connectivity by adding JDBC data sources to our WebLogic domain. A data source is a J2EE standard method of configuring connectivity to a database. Each WebLogic data source contains a pool of database connections. Applications look up the data source on the JNDI tree or in the local application context and then reserve a database connection with the getConnection method. Data sources and their connection pools provide connection management processes that help keep our system running efficiently.

Solution: We will use the COUNTRIES table of Oracle database XE present in the HR schema. For solution of the above requirement follow the below steps:

Step 1: Create an Oracle ADF Fusion Web Application.

Step 2: Create an ADF Business Components from tables. The ADF Business Components should contain: AppModule, CountriesEO, and CountriesVO as shown below:

Step 3: Create a demo.jsf page in the ViewController project of our application. Go to Data Control Window > ExpandAppModuledataControl > Drag and drop the CountriesVO1 collection from the Data Control to the demo.jsf page as a table as shown below:

Select the default properties in the Create table popup while creating the table as shown below and click OK.

Step 4: Start Server Instance (IntegratedWeblogicServer). To start go to Run > Click Start Server Instance (IntegratedWeblogicServer).

Step 5: Once the Server Instance starts (running) open any browser and type

http://localhost:7101/console.

Thus, it loads the log in screen of the Oracle Weblogic Server as shown below:

Step 6: Give the Username and Password to login. Thus, on successful login we will get the below page.

Step 7: Click on Data Sources of the above image of Step 6. The area is highlighted in red color. Thus, we will get the below screen:

Step 8: Click on New > Select Generic Data Source. Thus, we will get the below screen:

Step 9: Give the Name as HR and JNDI name as jdbc/HR and click Next as shown below:

Step 10: Select the Database Driver as “Oracle’s Driver (Thin) for Application Continuity; Versions:Any” and click Next as shown below:

Step 11: Again, click Next. Give the Database Name, Host Name, Port, Database Username, Password, and Confirm Password as shown below. Then click Next. Click Test Configuration. Click Next.

Step 12: Check the Servers as Default Server as shown below.

Step 13: Click Finish.

Step 14: Now go to the application and open AppModule. Click Configurations. Edit AppModuleLocal and AppModuleShared. Set the Datasource Name as jdbc/HR for both AppModuleLocal and AppModuleShared as shown below:

Step 15: Go to Application Resources. Expand Connections > Database > Delete HR connection as shown below.

Step 16: Save and run the application.

Hence, the solution to our requirement.

If you like the post please comment, share, and do join me on Facebook. Please subscribe to my YouTube Channel for video tutorials.

Thanks & Regards,
Susanto Paul

 550 total views,  3 views today

By Susanto Paul

Susanto is an Oracle ACE, a qualified MCA, MBA, and a highly-skilled Senior Oracle Specialist. He is an enthusiastic Blogger and YouTuber who helps learners to solve their complex problems more efficiently. He has 9+ years of experience in multiple technologies like AWS, Oracle ADF, Oracle APEX, Oracle JET, Oracle VBCS, Oracle IDCS, Oracle PL/SQL, Oracle Integration Cloud, Java, JDBC, Servlets, JSP, Spring, Hibernate, HTML5, CSS3, JavaScript, TypeScript, NodesJS, Angular, MySQL, Oracle WebLogic Server, JUnit, JMeter, Selenium Web Driver, etc. He is a certified: Oracle Certified Professional Java SE 6 Programmer, Oracle ADF 11g Certified Implementation Specialist, Oracle Cloud Platform Application Integration 2020 Certified Specialist, Oracle Cloud Infrastructure Foundations 2020 Certified Associate, and Oracle Cloud Infrastructure Developer 2020 Certified Associate

One thought on “Create a JDBC Generic Data Source in Oracle WebLogic Server”

Leave a Reply

Your email address will not be published. Required fields are marked *

satta king chart