tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vara Prashanth" <>
Subject JDBC Problems....
Date Mon, 15 Oct 2001 15:38:39 GMT
Hello all:

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

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) {

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)


Do You Yahoo!?
Get your free address at

View raw message