Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 39989 invoked by uid 500); 13 Oct 2001 18:54:59 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 39972 invoked from network); 13 Oct 2001 18:54:58 -0000 X-Apparently-From: From: "Vara Prashanth" To: Subject: JDBC Problems Date: Sat, 13 Oct 2001 14:55:44 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello all: I am trying to implement connection pooling in my applications and need some help. I started off by studying the small piece of code...... ............. Connection con = null; Statement stmt = null; try { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup("jdbc/prash1"); con = ds.getConnection("login", "pwd"); } catch(java.lang.Exception e) { System.err.print(e.getClass().getName()); System.err.println(e.getMessage()); } ............. The basic question I had is what "jdbc/prash1" means? I used to use the normal DriverManager class to get connected to a database. In that case, we create a new System DSN mapping to the database. But now I am confused if it the same in case of datasource too. If it is then what does "jdbc/" mean? Do I have to map it someplace in web.xml/server.xml of tomcat? Can someone please take some time to explain how I should be using datasource (if it has anything to with tomcat) Thanks Prashanth _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com