tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: Some Prilim questions
Date Wed, 24 Sep 2008 13:02:34 GMT
>
> 1)       Which is faster JNDI Based Connection pool / ordinary JDBC based connection
/ close ?

JNDI based connection pool.  The connections are potentially already
formed and ready for use when you call for one.  Ordinary JDBC would
explicitly create a new connection everytime you need one with all the
costs associated with that.

> conn.close() --> What does this code do ? (return connection to pool or close the
connection )

It's essentially pool implementation specific, but in most db pools, the
connection is simply returned to the pool and made available to the next
request for a connection.

--David

karthikn wrote:
> Hi
>
> Spec:
> O/s :  Unix HP 11i
> Tomcat : 6.0.18
> J2sdk : 1.6
> DB : Oracle 10g
>
> Question
>
> 1)       Which is faster JNDI Based Connection pool / ordinary JDBC based connection
/ close ?
>
> 2)       In JNDI / context based  Connection pool  for the code given below
>
>        InitialContext ic = new InitialContext();
>        DataSource ODS =(javax.sql.DataSource)ic.lookup("java:comp/env/jdbc/MYSCEMA");
>        Connection conn = ODS.getConnection()
>
>        // Insert /Update /Delete/...
>
>        conn.close() --> What does this code do ? (return connection to pool or close
the connection )
>
>     Googled /yahooed but non correct answers ....
>
> Please advice
> Karthik
>
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message