On Wed, Apr 18, 2001 at 12:08:29PM +0800, Russell wrote:
>
> Hi all , i am using RedHat6.1 ,jdk1.3,postgresql7.0.1 and jboss2.1.
Hi. Good to see you have the hang of the Linux/RedHat naming thing, now :-)
Oh, BTW, please upgrade to JBoss 2.2 at your earliest convenience.
> I need some advice regarding the code below which in stateless session
> bean :
> My question is that if the connection below created are pooled ???
> Thanks wt.
>
>
...
> private Connection getConnection() throws SQLException{
> DataSource ds = null;
> try{
> Context ctx = new InitialContext();
> ds = (DataSource)ctx.lookup("java:comp/env/jdbc/PostgresDS");
> }
> catch(NamingException ne){
> ne.printStackTrace();
> }
> return ds.getConnection();
> }
Yes, this is the correct way to obtain a connection from a pool. Whether
or not pooling is actually happening depends on the specific implementation
of DataSource that you obtain from JNDI. If you have bound in a Minerva
connection pool, then you have connection pooling.
Toby.
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user