tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <rey...@hugsmidjan.is>
Subject RE: JDBC Problems....(third posting)
Date Tue, 16 Oct 2001 08:28:50 GMT
ok well...
obviously you are trying to look up Datasource connection object from
the InitialContext, but it seems to be keept there with the key
"jdbc/prash1".
The context has a hireachial setup, so under jdbc you could be haveing
many keys.

So this might mean, that some thread, servlet or something has put the
DataSource object into the context before this code is executed. 

but on the other hand, I would recomend to you to check out other
connection pools, such as POOLMAN or bitmechanic jdbc-pool.
(www.bitmechanic.com)
Those are both free and opensource and have been tested in some hundreds
of applications so they must have some reliability by now.

hope it helps,
-r




-----Original Message-----
From: Vara Prashanth [mailto:prash_mail_lists@yahoo.com]
Sent: 15. október 2001 20:28
To: tomcat-user@jakarta.apache.org
Subject: JDBC Problems....(third posting)


My third posting of the same message...can someone please answer it? I
will
be happy if someone can point me to some website atlease.....
Thanks

Hello all:

I am trying to implement connection pooling in my applications and need
some
help.

I started off by studying the small piece of code......

.............
		Connection con = null;
		Statement stmt = null;
		try {
			Context ctx = new InitialContext();
			DataSource ds =
(DataSource)ctx.lookup("jdbc/prash1");
			con = ds.getConnection("login", "pwd");

		} catch(java.lang.Exception e) {
			System.err.print(e.getClass().getName());
			System.err.println(e.getMessage());
		}
.............

The basic question I had is what "jdbc/prash1" means? I used to use the
normal DriverManager class to get connected to a database. In that case,
we
create a new System DSN mapping to the database. But now I am confused
if it
the same in case of datasource too. If it is then what does "jdbc/"
mean? Do
I have to map it someplace in web.xml/server.xml of tomcat? Can someone
please take some time to explain how I should be using datasource (if it
has
anything to with tomcat)

Thanks
Prashanth


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message