try this:
   Context ctx = new InitialContext(); 
   Context env = (Context) ctx.lookup("java:comp/env/jdbc/EmployeeDB")   // add this 
line also your ejb-jar.xml have 
                                                                                       
                      // <res-ref-name>jdbc/EmployeeDB</res-ref-name>
   ConnectionPoolDataSource ds = 
(ConnectionPoolDataSource)env.lookup("jdbc/EmployeeDB"); //changes ctx to env.






Albert Pi
Corp IS System Delivery
516-803-3762


>>> [EMAIL PROTECTED] 07/16/02 10:16AM >>>
Hello everybody,
I'm newbie,I have finised a servlet to display the saffters info to uses.
Database is MS sql server7.0 . I connected  database with generic Connection object.As 
thought of performance,I wanna connect database with "Connection Pool."
Follwing is an example  offered by Microsoft:
    Context ctx = new InitialContext(); 
    ConnectionPoolDataSource ds = 
(ConnectionPoolDataSource)ctx.lookup("jdbc/EmployeeDB"); 
    pooledConnection pcon = ds.getPooledConnection("scott", "tiger"); 

But now,I don't know from where the "jdbc/EmployeeDB" comes  and how to configure 
it.Maybe I don't master the concept of JNDI.Pls help me.Any help of you  would be 
appreciated!

Best Regards

Web Server BEA Weblogic 6.1 sp1
jdk version: 1.4.0
operating system : win2k server
jdbc :Microsoft jdbc2.0 of  type 4

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to