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

Explain about the Try Block?

0 Answers  


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

3 Answers   HCL,


List the advantages of using datasource?

0 Answers  


How data can be inserted into long row column of database?

0 Answers  


Difference between Generic Servlet and HTTP Servlet?

13 Answers  






What is the difference between jdbc and odbc?

0 Answers  


When do we use execute method in java jdbc?

0 Answers  


how many JDBC drivers ?name them?

6 Answers   Idea, CTS,


What is JDBC RowSet? What are different types of RowSet?

0 Answers  


What is a Connection?

1 Answers  


Can we make a database connection from HTML ?

6 Answers   Aptech, Wipro, Cap Gemini, BOB Technologies,


How do you determine the sensitivity of the ResultSet object?

0 Answers  






Categories