Subject | Re: Problem with connections and Tomcat JNDI |
---|---|
Author | bradenw2 |
Post date | 2002-04-02T21:25:15Z |
Oops. I pasted the wrong version of the server.xml file. Those
"jdbc/KatanaDB" should read "java:/KatanaDB".
BW
"jdbc/KatanaDB" should read "java:/KatanaDB".
BW
--- In Firebird-Java@y..., "bradenw2" <braden.walters@s...> wrote:
> (Hopefully THIS post will go through ... sheesh!)
>
> Hello all,
>
> I have been working with the JCA-JDBC in a Tomcat 4 environment, and
> am making some progress. However, currently when I try to get a
> database connection, I get a ResourceException with the message that
> "No ManagedConnections Available!".
>
> Here is my server.xml file (relevant portions anyway):
>
> <Context path="/katana" docBase="katana" >
> <Resource name="jdbc/KatanaDB" auth="Container"
> type="org.firebirdsql.FBDataSourceObjectFactory" />
> <ResourceParams name="jdbc/KatanaDB" >
> <parameter>
> <name>factory</name><value>org.firebirdsql.FBDat
> aSourceObjectFactory</value>
> </parameter>
> <parameter>
> <name>User</name><value>SKK</value>
> </parameter>
> <parameter>
> <name>Password</name><value>skk1</value>
> </parameter>
> <parameter>
>
> <name>DatabaseName</name><value>localhost/3050:/ex
> port/home/katana/katana.gdb</value>
> </parameter>
> </ResourceParams>
> </Context>
>
> ... and here's the accessing code ...
>
> try
> {
> Context initCtx = (Context) new InitialContext();
> Context ctx = (Context) initCtx.lookup("java:comp/env");
> DataSource ds = (DataSource) ctx.lookup("java:/KatanaDB");
>
> conn = ds.getConnection();
> }
> catch(NamingException ne)
> {
> ne.printStackTrace();
> }
> catch(SQLException sqle)
> {
> sqle.printStackTrace();
> }
>
> ... and finally the relevant portion of the web.xml file ...
>
> <resource-ref>
> <description>
> Object Factory Reference to the registration DataSource.
> </description>
> <res-ref-name>
> java:/KatanaDB
> </res-ref-name>
> <res-type>
> javax.sql.DataSource
> </res-type>
> <res-auth>
> Container
> </res-auth>
> </resource-ref>
>
> Any idea what I am missing?
> Thanks in advance!
>
> Braden Walters