R
Ron de Waard
Hello,
What I want to have is a single place for defining my database
specification. I'm using tomcat 4.1.24 for our web application, however I
also have some stand-alone applications using the same database.
Preferrably, I want to use the tomcat admin tool for defining the datasource
and use it in servlets/JSP but also in the stand-alone applications. I don't
want to use a full JNDI server (LDAP or whatever), because it all runs on
the same machine and I don't want extra overhead/servers.
I have looked at FSContext and managed to create and lookup a JNDI context
and datasource within. However, tomcat uses java:comp/env as a predefined
context and I can't find anywhere how to create a similar context; I got
stuck with the java: part of it. Without that I get it all working but then
there is a difference the way tomcat defines a datasource and the way I can
create it stand-alone, and I want to have it as transparant as possible.
Preferrably, I want to read the datasource from tomcat directly within a
stand-alone application, but I don't know if that is possible.
What I want to have is a single place for defining my database
specification. I'm using tomcat 4.1.24 for our web application, however I
also have some stand-alone applications using the same database.
Preferrably, I want to use the tomcat admin tool for defining the datasource
and use it in servlets/JSP but also in the stand-alone applications. I don't
want to use a full JNDI server (LDAP or whatever), because it all runs on
the same machine and I don't want extra overhead/servers.
I have looked at FSContext and managed to create and lookup a JNDI context
and datasource within. However, tomcat uses java:comp/env as a predefined
context and I can't find anywhere how to create a similar context; I got
stuck with the java: part of it. Without that I get it all working but then
there is a difference the way tomcat defines a datasource and the way I can
create it stand-alone, and I want to have it as transparant as possible.
Preferrably, I want to read the datasource from tomcat directly within a
stand-alone application, but I don't know if that is possible.