Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

CONTACT US

Weblogic Server
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new

Search Courses

 
 
Weblogic Data Sources :
1. In WebLogic Server, you configure database connectivity by adding data sources to your WebLogic domain. WebLogic JDBC data sources provide database access and database connection management.
2. Each data source contains a pool of database connections that are created when the data source is created and at server startup. Applications reserve a database connection from the data source by looking up the data source on the JNDI tree or in the local application context and then calling getConnection().
3. When finished with the connection, the application should call connection.close() as early as possible, which returns the database connection to the pool for other applications to use.
4. Data sources and their connection pools provide connection management processes that help keep your system running and performant.You can set options in the data source to suit your applications and your environment. Multi Data sources comprise of one or more data sources.If one data source fails it will connect to another data source. To utilize RAC it is recommended to use MULTI DS
 
Weblogic Connection Pool :
1.The connection pool within a JDBC data source contains a group of JDBC connections that applications reserve, use, and then return to the pool. The connection pool and the connections within it are created when the connection pool is registered, usually when starting up WebLogic Server or when deploying the data source to a new target.
 
Viewing Data sources :
In Web Logic Console Inside Domain Structure go to 
1--Services
2-- Data Source 
When you click on Data source you will able to see the list of Data Source. 
In our case we have already created Data Source named myds 
 
 
3-- You can see your DSN in JNDI directory of you Admin Server or Managed server depending upon where it is targetted. If your dsn is not shown in JNDI STRUCTURE you cannot use it 
4-- Connection Pool in JDBC data source contains a group of JDBC connection that application reserves, use and then return to the pool tab you will find the URL of the database to connect which can be edited. The format of the URL depends upon the JDBC driver
w5
 
Creating A Data Source : 
1-- In Web Logic Server Console Go to Domain Structure 
2-- Inside Domain Structure Click on Services 
3-- Click on Data Sources 
4-- Click on New Button and Select Generic Data Source (Multi Data Sources are recommended for RAC setup)
 
5-- Give the Name for Data source like (myds-2)
 -- Give the JNDI Name as myds-2
 -- Select The Database Type and Click on Next
  6-- Select Database driver depending from The list of drivers 
 -- We select Oracle's Driver (Thin XA ) for instance connections; Versions:9.0.1 (XA type of driver supports transaction (commit/rollback)
 -- Click on Next 
7-- In Transaction Options Click on Next 
8-- Fill in all the details for JDBC data source 
 -- Database Name :sid ( server identifier )
 -- Hostname :(Ip address of the database server) 192.168.1.28
 -- Port: 11501(Listener port )
 -- Database User Name : wlstrainer
 -- Password : oracle123
 -- Confirm Password : oracle123
 -- Click On Next 
9-- When you click on next following things will be created 
 -- Driver Class Name 
 -- URL  of the database to connect to 
 -- Click on Test Configuration 
 
10-- If the Data Source is configured properly It will say connection test succeeded
 -- Click on Next  
  
11-- Once you click on Configuration tab, it will give you 
   -- Initial Capacity, Maximum Capacity and Minimum Capacity of physical data connections that can be handled by the data source 
w15 ds2
 
12-- Click on Advance 
  -- Here you can test the connection before giving it to the application
w16 ds2
 
 
Understanding JDBC Client 
 1.Get a handle of the server IntialContext
Hashrable<String,String> h = new HashTable<String,String >();
h.put(Context.INITIAL_CONTEXT_FACTORY,
 "weblogic.jndi.WLInitialContextFactory ");
h.put(Context.PROVIDER_URL," HTTP://localhost:7001");
InitalContext ic = new IntialContext(h)
2. Looking up the required object from the JNDI tree using the server's InitiaContext:
DataSource ds = ct.lookup("mydsn");
3. Invoke the required methods on the returned object . 
SQLConnection myDBConnection= ds.getConnection();

Kashif Baksh

Add comment


Security code
Refresh

About the Author

Kashif Baksh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Apr 2024  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  1  2  3  4  5  6  7
  8  91011121314
15161718192021
22232425262728
2930     

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner