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 21:00:13 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>I have never worked with the JDBC2.0 features since i am using
Oracle8.1.5 which does not supoport them.</FONT>
<BR><FONT SIZE=2>You probably don't need the connection pool library if you can
use the built-in which comes with the driver.</FONT>
<BR><FONT SIZE=2>But &quot;using your connection pool&quot; after it has
been instantiated should be the same as described </FONT>
<BR><FONT SIZE=2>from Bill Pfeiffer (it's a typical way ).</FONT>
<BR><FONT SIZE=2>Also you may want to have a look at the CachedRowSet API at the
Sun/java/JDBC site. </FONT>
<BR><FONT SIZE=2>It's a very nice library that makes you JDBC1.22 ResultSet object
scrollable without the need of JDBC2.0 support </FONT>
<BR><FONT SIZE=2>from the RDBMS.</FONT>

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

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: David Brunkow [<A HREF=""></A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, July 28, 2000 1:06 PM</FONT>
<BR><FONT SIZE=2>To: ''</FONT>
<BR><FONT SIZE=2>Subject: RE: Database Connectivity, JDBC2 and Tomcat</FONT>

<P><FONT SIZE=2>Is all of that necessary, if JDBC2.0(and the correct driver and
<BR><FONT SIZE=2>thanks Alexandros)works as advertised?</FONT>

<P><FONT SIZE=2>dvb</FONT>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Bill Pfeiffer [<A HREF=""></A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, July 27, 2000 6:45 PM</FONT>
<BR><FONT SIZE=2>Subject: RE: Database Connectivity, JDBC2 and Tomcat</FONT>

<P><FONT SIZE=2>AFAIK, the proper way to do what you want is to:</FONT>

<P><FONT SIZE=2>1. Create a &quot;load&quot; servlet that will initialize
a connection pooling object</FONT>
<BR><FONT SIZE=2>when the containter (Tomcat) starts up.&nbsp; There are several
<BR><FONT SIZE=2>pooling offerings out there for free.</FONT>

<P><FONT SIZE=2>2. Have the &quot;load&quot; servlet load on container

<P><FONT SIZE=2>3. Have the &quot;load&quot; servlet store the connection
pooling object in the</FONT>
<BR><FONT SIZE=2>ServletContext object.&nbsp; This will make the pool available
to ALL sessions.</FONT>

<P><FONT SIZE=2>4. Have the individual servlet (or jsp's) get the connection pooling
<BR><FONT SIZE=2>from the ServletContext.&nbsp; Get the individual connections
from the connection</FONT>
<BR><FONT SIZE=2>pooling object and hold the connection for only as long as you
need it, then</FONT>
<BR><FONT SIZE=2>return it immediatly to the pool.&nbsp; Usually this time
period is specified by</FONT>
<BR><FONT SIZE=2>the amount of work done within a logical transaction.</FONT>

<P><FONT SIZE=2>You may want to have a controlling object to:</FONT>

<P><FONT SIZE=2>&nbsp; * obtain the connection,</FONT>
<BR><FONT SIZE=2>&nbsp; * begin the transaction,</FONT>
<BR><FONT SIZE=2>&nbsp; * pass the connection to the individual beans to do
<BR><FONT SIZE=2>&nbsp; * commit or rollback the transaction as appropriate
at the end of the work</FONT>
<BR><FONT SIZE=2>&nbsp; * return the connection</FONT>

<P><FONT SIZE=2>I have used an abbreviated version of this in all my current servlet/jsp</FONT>
<BR><FONT SIZE=2>work.&nbsp; I don't really do any updates just yet, so I
don't have any</FONT>
<BR><FONT SIZE=2>transactions to worry about, just read only data javabeans.</FONT>

<P><FONT SIZE=2>I do plan to integrate with jBoss to do my transactional type
work when I</FONT>
<BR><FONT SIZE=2>get to it.&nbsp; Why re-invent the EJB wheel with regular
javabeans when there</FONT>
<BR><FONT SIZE=2>are good open source EJB solutions that will integrate with Tomcat?</FONT>

<P><FONT SIZE=2>My $.02,</FONT>

<P><FONT SIZE=2>Bill Pfeiffer</FONT>
<BR><FONT SIZE=2>Arbitration Forums, Inc</FONT>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Daniel Le Berre [<A HREF=""></A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, July 27, 2000 8:51 PM</FONT>
<BR><FONT SIZE=2>Subject: Re: Database Connectivity, JDBC2 and Tomcat</FONT>

<P><FONT SIZE=2>&gt; &quot;Kotsiras, Alexandros&quot; wrote:</FONT>

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

<P><FONT SIZE=2>To do the same JOB (table-&gt;Java), I use TableGen, which
is not bad:</FONT>

<P><FONT SIZE=2>The pooling used is Ewin Connection Pool:</FONT>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>Daniel</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Daniel Le
<A HREF="" TARGET="_blank"></A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Research Associate,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A HREF=""></A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; School Of
Management, S123, University of Newcastle, NSW 2308</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Australia&nbsp;&nbsp;
Tel: (02) 4921 {5009(Off), 7055(Lab.), 6911(Fax)}</FONT>


View raw message