Hi,
Caroline is referring to my 'openConnection()' method which is missing a
'return' statement.
see below
regards,
Luke
> Your class opens and gets a 'conn' object from the
> connection pool. Where in your code "returns" the
> 'conn' object for use? Should there be a statemenet
> like:
>
>
Hi,
You are right!
that statement should be there!
kind regards,
Luke
On Tue, 2004-09-14 at 06:08, Caroline Jen wrote:
> I saw your Tomcat connection pool class.
>
> Your class opens and gets a 'conn' object from the
> connection pool. Where in your code "returns" the
> 'conn' object for use?
PROTECTED]
Subject: RE: [OFF-TOPIC]Yoav --> RE: Some pretty basic Tomcat
ConnectionPooling Questions
I saw your Tomcat connection pool class.
Your class opens and gets a 'conn' object from the
connection pool. Where in your code "returns" the
'conn' object for use?
I saw your Tomcat connection pool class.
Your class opens and gets a 'conn' object from the
connection pool. Where in your code "returns" the
'conn' object for use? Should there be a statemenet
like:
return conn;
somewhere?
1. Declaration of private global variables:
private Context
September 2004 14:03
> To: Tomcat Users List
> Subject: RE: [OFF-TOPIC]Yoav --> RE: Some pretty basic Tomcat
> ConnectionPooling Questions
>
>
>
> Hi,
> It's inefficient to do the DataSource lookup (an expensive operation)
> every time you need a connection.
advice on this basic design issue
;)
Yoav Shapira
Millennium Research Informatics
>-Original Message-
>From: Caroline Jen [mailto:[EMAIL PROTECTED]
>Sent: Saturday, September 11, 2004 12:43 AM
>To: Tomcat Users List; [EMAIL PROTECTED]
>Subject: RE: [OFF-TOPIC]Yoav --
This is what I do and would like to have feedbacks:
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class DBConnection
{
public static Connection getDBConnection() throws
SQL
Hi Yoav and all,
Thanks for your reply,
> But you went a bit too far: the DataSource lookup is potentially
> expensive. That you can do in the init() method and keep a reference to
> the DataSource, because keeping that reference doesn't use a connection
> resource.
> Then in your servlet method
Hi,
I'd say your new version is much better designed and significantly more
scalable than the old, yeah.
But you went a bit too far: the DataSource lookup is potentially
expensive. That you can do in the init() method and keep a reference to
the DataSource, because keeping that reference doesn't