tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kotsiras, Alexandros" <AKotsi...@mediaondemand.com>
Subject RE: Database Connectivity, JDBC2 and Tomcat
Date Fri, 28 Jul 2000 21:00:13 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<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>
</HEAD>
<BODY>

<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>

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

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: David Brunkow [<A HREF="mailto:dbrunkow@userinterface.com">mailto:dbrunkow@userinterface.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, July 28, 2000 1:06 PM</FONT>
<BR><FONT SIZE=2>To: 'tomcat-user@jakarta.apache.org'</FONT>
<BR><FONT SIZE=2>Subject: RE: Database Connectivity, JDBC2 and Tomcat</FONT>
</P>
<BR>

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

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

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Bill Pfeiffer [<A HREF="mailto:wsplist1@tampabay.rr.com">mailto:wsplist1@tampabay.rr.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, July 27, 2000 6:45 PM</FONT>
<BR><FONT SIZE=2>To: tomcat-user@jakarta.apache.org</FONT>
<BR><FONT SIZE=2>Subject: RE: Database Connectivity, JDBC2 and Tomcat</FONT>
</P>
<BR>

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

<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
connection</FONT>
<BR><FONT SIZE=2>pooling offerings out there for free.</FONT>
</P>

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

<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>

<P><FONT SIZE=2>4. Have the individual servlet (or jsp's) get the connection pooling
object</FONT>
<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>

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

<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
work,</FONT>
<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>

<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>

<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>

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

<P><FONT SIZE=2>Bill Pfeiffer</FONT>
<BR><FONT SIZE=2>Arbitration Forums, Inc</FONT>
<BR><FONT SIZE=2>wpfeiffe@arbfile.org</FONT>
<BR><FONT SIZE=2>pfeiffer@gte.net</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Daniel Le Berre [<A HREF="mailto:daniel@cafe.newcastle.edu.au">mailto:daniel@cafe.newcastle.edu.au</A>]</FONT>
<BR><FONT SIZE=2>Sent: Thursday, July 27, 2000 8:51 PM</FONT>
<BR><FONT SIZE=2>To: tomcat-user@jakarta.apache.org</FONT>
<BR><FONT SIZE=2>Subject: Re: Database Connectivity, JDBC2 and Tomcat</FONT>
</P>
<BR>
<BR>
<BR>

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

<P><FONT SIZE=2>&gt; I am using&nbsp; the connection pool from www.javaexchange.com
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 www.bitmechanic.com
(They</FONT>
<BR><FONT SIZE=2>&gt; also have their own Connection pool).</FONT>
</P>

<P><FONT SIZE=2>To do the same JOB (table-&gt;Java), I use TableGen, which
is not bad:</FONT>
<BR><FONT SIZE=2><A HREF="http://freespace.virgin.net/joe.carter/TableGen/index.html"
TARGET="_blank">http://freespace.virgin.net/joe.carter/TableGen/index.html</A></FONT>
</P>

<P><FONT SIZE=2>The pooling used is Ewin Connection Pool:</FONT>
<BR><FONT SIZE=2><A HREF="http://www.ewin.org/~bret/java/connectionPool/index.html"
TARGET="_blank">http://www.ewin.org/~bret/java/connectionPool/index.html</A></FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>Daniel</FONT>
<BR><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Daniel Le
Berre&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A HREF="http://cafe.newcastle.edu.au/daniel/" TARGET="_blank">http://cafe.newcastle.edu.au/daniel/</A></FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Research Associate,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A HREF="mailto:daniel@cafe.newcastle.edu.au">mailto:daniel@cafe.newcastle.edu.au</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>
</P>

</BODY>
</HTML>

Mime
View raw message