Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 16768 invoked from network); 14 Jun 2004 09:52:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Jun 2004 09:52:13 -0000 Received: (qmail 45453 invoked by uid 500); 14 Jun 2004 09:51:36 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 45414 invoked by uid 500); 14 Jun 2004 09:51:35 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 45384 invoked by uid 99); 14 Jun 2004 09:51:34 -0000 Received: from [193.212.163.1] (HELO mail.flyspesialisten.no) (193.212.163.1) by apache.org (qpsmtpd/0.27.1) with ESMTP; Mon, 14 Jun 2004 02:51:34 -0700 Received: from mail.flyspesialisten.no (unverified [127.0.0.1]) by mail.flyspesialisten.no (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Mon, 14 Jun 2004 11:40:38 +0200 Received: from ntflskje.via.no ([172.20.200.15]) by mail.flyspesialisten.no with Microsoft SMTPSVC (5.0.2195.6713); Mon, 14 Jun 2004 11:40:38 +0200 Received: by ntflskje.via.no with Internet Mail Service (5.5.2653.19) id ; Mon, 14 Jun 2004 11:40:37 +0200 Message-ID: <44BE7B96C73B3F4A90A290E3336F67960170A7DF@ntvgrex2.via.no> From: =?ISO-8859-1?Q?Trond_Hersl=F8v?= To: "'tomcat-user@jakarta.apache.org'" Subject: MySQL-connection pool Date: Mon, 14 Jun 2004 11:40:35 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C451F3.A4C986F0" X-OriginalArrivalTime: 14 Jun 2004 09:40:38.0164 (UTC) FILETIME=[A644B540:01C451F3] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C451F3.A4C986F0 Content-Type: text/plain; charset="ISO-8859-1" Hi ! I have installed MySQL and is able to access it in a servlet like this: Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/demo?user=tomcat&passwor d=.tomcat."); This creates a new connection to the DB every time, and I therefore want to use a connection pool. I tried to set up a connection pool in the tomcat-admin interface, but it seems like I can't get it right. I'm also not quit sure how to get a connection from the pool even if it is set up right. I assume something like this would be correct: Connection conn = DriverManager.getConnection("mysql"), where mysql is the jndi name of my pool. The Tomcat documentation referrs to a non existing link ( http://jakarta.apache.org/commons/dbcp/api/index.html ). Do I have to install any extra classes to make the connection pool work correctly? Here is my current system config Linux 2.4.20 Apache webserver: 2.0.49 jk2: 2.0.4 Tomcat: 5.0.24 MySql: 4.0.20 MySQL-connector: 3.0.12 J2SDK 1.4.2_04 Who can give me an example of how to set up and get a connection from a pool with connections to a MySQL database? Thanks, Trond ********************************************************************** This email message has been swept by MIMEsweeper for the presence of computer viruses. ********************************************************************** ------_=_NextPart_001_01C451F3.A4C986F0--