tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vara Prashanth" <prash_mail_li...@yahoo.com>
Subject JDBC Problems....(third posting)
Date Mon, 15 Oct 2001 20:27:54 GMT
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