After creating conntinpool in weblogic
how to write the code in programe where i can use that pool
object in the programe connecting to the database
and how to debug programe withou eclipse




Answers were Sorted based on User's Feedback



After creating conntinpool in weblogic how to write the code in programe where i can use that pool..

Answer / penchala

import java.sql.*;
import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

class WLConnection
{


public static void main(String arg[]){
Context ctx = null;
java.util.Hashtable ht = new Hashtable();

ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");

Connection conn = null;

try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource)
ctx.lookup ("jdbc/sample");
conn = ds.getConnection();


}
catch (Exception e) {
// a failure occurred

}
}
}

Is This Answer Correct ?    1 Yes 0 No

After creating conntinpool in weblogic how to write the code in programe where i can use that pool..

Answer / sriram

simple answer........by using web-application compilatiom by
server running

Is This Answer Correct ?    0 Yes 0 No

Post New Answer




More JDBC Interview Questions

How can I retrieve a String or other object type without creating a new object each time?

0 Answers  


Why can't I invoke the ResultSet methods afterLast and beforeFirst when the method next works?

0 Answers  


What is the difference between client and server database cursors?

0 Answers  


Explain what should be done when a SQL exception is raised?

0 Answers  


wa is connection pooling? how do u create connection pooling?wat is use connection pooling?

1 Answers   Covansys,






Statement, PrepareStatement and Callable all these are interfaces. Thought it is a interface how come we are creating objects and calling methods("preparestatement()") in it. In which class this method is defined. Please let me know. Thanks in advance. example: PreparedStatement pre = con.prepareStatement( "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ?");

2 Answers  


JDBC Drivers properties?

1 Answers   Infosys,


How to execute bulk number of queries at once?

3 Answers   Wipro,


Why do I get UnsatisfiedLinkError when I try to use my JDBC driver?

0 Answers  


What does it mean to "materialize" data?

0 Answers  


I have getting problem to calling stored procedure from Mysql through JSP. Please help me.

1 Answers  


In JDBC, All the API?s are interfaces? Where is the actual implementation?

3 Answers   HCL,






Categories