tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kotsiras, Alexandros" <>
Subject RE: Database Connectivity, JDBC2 and Tomcat
Date Fri, 28 Jul 2000 00:31:26 GMT
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: Database Connectivity, JDBC2 and Tomcat</TITLE>

<P><FONT SIZE=2>According to my experience Binding Connections to user sessions
is a special case</FONT>
<BR><FONT SIZE=2>(for example it is a good approach for a Web based DB Admin tool,
or maybe for a shopping cart,</FONT>
<BR><FONT SIZE=2>in general when you need authentication-session tracking, and
have a small number of users)</FONT>
<BR><FONT SIZE=2>but in general it is easier and safer to have a pool of connections
and reuse them</FONT>
<BR><FONT SIZE=2>for every user request.</FONT>

<P><FONT SIZE=2>In any case crerating/closing a new connection per request is
almost &quot;unacceptable&quot; approach.</FONT>

<P><FONT SIZE=2>I am using&nbsp; the connection pool from
with great success. It has a couple</FONT>
<BR><FONT SIZE=2>of examples that clearly show how to use it.</FONT>
<BR><FONT SIZE=2>For mapping tables to objects and avoiding EJBs or a lot of trivial
JDBC lines of code, have a look at SQL2Java (They also have their own
Connection pool).</FONT></P>

<P><FONT SIZE=2>Finally in order to use JDBC2.0 it has to be supported by the
RDBMS not just the driver.</FONT>
<BR><FONT SIZE=2>For example you can use the Oracle JDBC2.0 driver (
file) with Oracle8.1.5 which does not</FONT>
<BR><FONT SIZE=2>support JDBC2.0 but you won't be able to use the JDBC2.0 functionality
(Connection pool, SCrollable ResultSets etc)</FONT>
<BR><FONT SIZE=2>You need Oracle8.1.6 or later to utilize the driver's 2.0 functionality.</FONT>

<P><FONT SIZE=2>Alex.</FONT>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Ed Yu [<A HREF=""></A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, July 27, 2000 8:07 PM</FONT>
<BR><FONT SIZE=2>To: ''</FONT>
<BR><FONT SIZE=2>Subject: RE: Database Connectivity, JDBC2 and Tomcat</FONT>

<P><FONT SIZE=2>It actually works! I have to admit that the application I'm working
on is</FONT>
<BR><FONT SIZE=2>not the regular type application which does not require much
<BR><FONT SIZE=2>One of the design of my app is to keep track of which database
user is</FONT>
<BR><FONT SIZE=2>logged on and the app will not have such a huge number of client
request as</FONT>
<BR><FONT SIZE=2>regular web app will.</FONT>

<P><FONT SIZE=2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=2>&gt; From: David Brunkow []</FONT>
<BR><FONT SIZE=2>&gt; Sent: Thursday, July 27, 2000 7:38 PM</FONT>
<BR><FONT SIZE=2>&gt; To:&nbsp;&nbsp; ''</FONT>
<BR><FONT SIZE=2>&gt; Subject:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RE: Database Connectivity, JDBC2 and Tomcat</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; The problem here is using tomcat and not having access
to enterprise</FONT>
<BR><FONT SIZE=2>&gt; beans.</FONT>
<BR><FONT SIZE=2>&gt; He's talking about saving the db connection in the user/servlet
<BR><FONT SIZE=2>&gt; which I don't quite agree with. Having a db connection
per user is &quot;not</FONT>
<BR><FONT SIZE=2>&gt; optimal&quot;, although I appreciate the response.
My understanding was that</FONT>
<BR><FONT SIZE=2>&gt; JDBC2 required pooling under the covers which allows
me as a user in the</FONT>
<BR><FONT SIZE=2>&gt; servlet to get a connection much faster than in the
JDBC1.X world.&nbsp; Two of</FONT>
<BR><FONT SIZE=2>&gt; my questions are, &quot;are people using that&quot;
and &quot;does it actually work&quot;.</FONT>
<BR><FONT SIZE=2>&gt; This</FONT>
<BR><FONT SIZE=2>&gt; is a big deal with tomcat since I can't use an enterprise
bean.&nbsp; I have to</FONT>
<BR><FONT SIZE=2>&gt; use java beans(simple classes/non enterprise beans)
and inside those</FONT>
<BR><FONT SIZE=2>&gt; classes</FONT>
<BR><FONT SIZE=2>&gt; I want to abstract data tables.&nbsp; Anybody else
facing such issues?</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; Correct me if I'm wrong or mistaken on any of this.</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; dvb</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=2>&gt; From: John Daniels [<A HREF=""></A>]</FONT>
<BR><FONT SIZE=2>&gt; Sent: Thursday, July 27, 2000 4:26 PM</FONT>
<BR><FONT SIZE=2>&gt; To:</FONT>
<BR><FONT SIZE=2>&gt; Subject: RE: Database Connectivity, JDBC2 and Tomcat</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; By &quot;session object,&quot; do you mean session
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt;</FONT>
<BR><FONT SIZE=2>&gt; &gt;You can use the session object to cache the
JDBC connection throughout</FONT>
<BR><FONT SIZE=2>&gt; your</FONT>
<BR><FONT SIZE=2>&gt; &gt;JSPs and Servlets. This way you are connected
once and can reuse the</FONT>
<BR><FONT SIZE=2>&gt; &gt;connection. Also you can close the connection
on session expiration.</FONT>
<BR><FONT SIZE=2>&gt; Well,</FONT>
<BR><FONT SIZE=2>&gt; &gt;about the JDBC pooling, that is totally depends
on the implementation of</FONT>
<BR><FONT SIZE=2>&gt; &gt;the</FONT>
<BR><FONT SIZE=2>&gt; &gt;JDBC driver.</FONT>
<BR><FONT SIZE=2>&gt; &gt;</FONT>
<BR><FONT SIZE=2>&gt; ________________________________________________________________________</FONT>
<BR><FONT SIZE=2>&gt; Get Your Private, Free E-mail from MSN Hotmail at <A
HREF="" TARGET="_blank"></A></FONT>


View raw message