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

Does hashset allow duplicates in java?

811


What does provide mean construction?

811


What is the covariant return type?

773


How do you convert an int to a string in java?

798


What is the purpose of object oriented programming?

718


What are the five major types of reference sources?

737


Can we compare two strings in java?

766


What are the advantages of exception handling?

793


What’s the difference between the methods sleep() and wait()?

770


What is an empty list in java?

719


What does 0 mean in boolean?

744


What are the important features of Java 8 release?

807


What does nullpointerexception mean?

855


What is java ceil?

780


What is local variable and instance variable?

810