Subject | Firebird 1.5 with Resin 3.0.5 |
---|---|
Author | dcabbar |
Post date | 2004-01-17T09:36:55Z |
Hi,
I am using Resin 3.0.5 with Firebird 1.5 (Jaybird 1.5 beta driver),
and I want to setup a simple jdbc connection pool.
I tried to follow directions on Jaybird FAQ and Resin manuals, but
having a bit of problems!
What I want is really simplu: request a connection from a jsp using
the following code:
try {
Context context = (Context) (new
InitialContext().lookup("java:comp/env"));
ds = (DataSource) context.lookup("MyPool");
} catch (NamingException e) {
return false;
}
try {
Connection conn = ds.getConnection();
} catch (SQLException sqe) {
sqe.printStackTrace(System.out);
}
And, my web.xml has the following:
<database>
<jndi-name>MyPool</jndi-name>
<driver>
<type>org.firebirdsql.pool.FBConnectionPoolDataSource</type>
<url>jdbc:firebirdsql:localhost/3050:c:/db/my.gdb</url>
<user>mydb</>
<password>mydb</password>
</driver>
</database>
First of all, when I hit this jsp it gives the following error:
WEB-INF/web.xml:8: `url' is an unknown property of
`org.firebirdsql.pool.FBConnectionPoolDataSource'.
When I change "url" to "database", then I get the same error for
"user", then I change the "user" to "userName", this time server hangs
forever! Also, I get the following error on resin STDOUT:
So I end up with a web.xml as:
[00:42:34.093] `java:comp/env/MyPool' is a conflicting JNDI resource
for `DBPool[MyPool]'
One more thing is that, when I try to instantiate a connection via
regular means, i.e. through the DriverManager, it works fine with url
and user/pass combination.
So, my final web.xml has the following:
<database>
<jndi-name>MyPool</jndi-name>
<driver>
<type>org.firebirdsql.pool.FBConnectionPoolDataSource</type>
<database>jdbc:firebirdsql:localhost/3050:c:/db/my.gdb</database>
<userName>EFIKIR</userName>
<password>password</password>
</driver>
</database>
Any ideas, thought? Help is appreciated...
Thanks,
Cabbar.
I am using Resin 3.0.5 with Firebird 1.5 (Jaybird 1.5 beta driver),
and I want to setup a simple jdbc connection pool.
I tried to follow directions on Jaybird FAQ and Resin manuals, but
having a bit of problems!
What I want is really simplu: request a connection from a jsp using
the following code:
try {
Context context = (Context) (new
InitialContext().lookup("java:comp/env"));
ds = (DataSource) context.lookup("MyPool");
} catch (NamingException e) {
return false;
}
try {
Connection conn = ds.getConnection();
} catch (SQLException sqe) {
sqe.printStackTrace(System.out);
}
And, my web.xml has the following:
<database>
<jndi-name>MyPool</jndi-name>
<driver>
<type>org.firebirdsql.pool.FBConnectionPoolDataSource</type>
<url>jdbc:firebirdsql:localhost/3050:c:/db/my.gdb</url>
<user>mydb</>
<password>mydb</password>
</driver>
</database>
First of all, when I hit this jsp it gives the following error:
WEB-INF/web.xml:8: `url' is an unknown property of
`org.firebirdsql.pool.FBConnectionPoolDataSource'.
When I change "url" to "database", then I get the same error for
"user", then I change the "user" to "userName", this time server hangs
forever! Also, I get the following error on resin STDOUT:
So I end up with a web.xml as:
[00:42:34.093] `java:comp/env/MyPool' is a conflicting JNDI resource
for `DBPool[MyPool]'
One more thing is that, when I try to instantiate a connection via
regular means, i.e. through the DriverManager, it works fine with url
and user/pass combination.
So, my final web.xml has the following:
<database>
<jndi-name>MyPool</jndi-name>
<driver>
<type>org.firebirdsql.pool.FBConnectionPoolDataSource</type>
<database>jdbc:firebirdsql:localhost/3050:c:/db/my.gdb</database>
<userName>EFIKIR</userName>
<password>password</password>
</driver>
</database>
Any ideas, thought? Help is appreciated...
Thanks,
Cabbar.