What are the steps to do connection pooling in weblogic?

Answer Posted / gajendra

We can implement connection pooling in weblogic as follows.
1. OPen weblogic console.on the top right hand side corner
of the window click on services tab.
2.Expand it and select JDBC.
3.Create a connection pool
4.Create a DataSource.
5.Create a JNDI.

In the programs make use of the following code to get the
connection from ConnectionPool

Context ic=null;
DataSource ds;
Connection con=null;
Hashtable ht=new Hashtable();
ht.put
(Context.INITIAL_CONTEXT_FACTORY,"Weblogic.jndi.WLInitialCon
textFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
ic=new InitialContext(ht);
ds=(DataSource)ic.lookup("jndi name given in weblogic");
con=ds.getConnection();

Is This Answer Correct ?    20 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is collection class in java? List down its methods and interfaces.

738


5 Coding best practices you learned in java?

836


Can we sort hashset in java?

875


Why is java called java?

809


How does the garbage collector works in java?

809


Can we overload the constructors?

765


What is meant by oops concept in java?

759


Explain naming conventions for packages?

788


When is the garbage collection used in Java?

912


What is final class?

798


Why local variables are stored in stack?

732


What is difference between final and immutable?

798


What is the program development process?

760


What two classes are used to read data only?

868


How to reverse a string in java?

792