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

can we create a own jdbc driver? how can we create?

1 Answers   HCL,


dear friends I have made connection with SQLSERVER where the following code is compiling properly but giving error at the runtime . I think error in this line where i am sending the value through string Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); import java.sql.*; //import mssqlserver.*; public class TestSQLCON { public TestSQLCON() throws Exception { // Get connection DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); System.out.println(); System.out.println("Successfully connected one"); System.out.println(); Connection connection = DriverManager.getConnection ( "jdbc:microsoft:sqlserver://localhost:1433","sa",""); if (connection != null) { System.out.println(); System.out.println("Successfully connected"); System.out.println(); // Meta data DatabaseMetaData meta = connection.getMetaData(); System.out.println("\nDriver Information"); System.out.println("Driver Name: " + meta.getDriverName()); System.out.println("Driver Version: " + meta.getDriverVersion()); System.out.println("\nDatabase Information "); System.out.println("Database Name: " + meta.getDatabaseProductName()); System.out.println("Database Version: "+ meta.getDatabaseProductVersion()); } } public static void main (String args[]) throws Exception { TestSQLCON test = new TestSQLCON(); } } so please help me

2 Answers  


what is the current version of JDBC? and explain its features?

3 Answers  


Define preparedstatement.

0 Answers  


What are the different types of classes in the api component?

0 Answers  






In which ways is driver class is registered with drive manager?

0 Answers  


How can you sort dates?

1 Answers  


What is an SQL Locator?

0 Answers  


What does jdbc do?

0 Answers  


What is Apache DBCP API?

0 Answers  


Explain the locking system in jdbc & its types?

0 Answers  


What are the different types of lockings in jdbc?

0 Answers  


Categories