Subject | How config Tomcat and FBDataSourceObjectFactory |
---|---|
Author | Leos Urban |
Post date | 2002-06-24T06:19:54Z |
Hello,
please, help me.
I installed last weekend new Tomcat 4.0.4 and I wanted use Firebird JDBC
driver (version from 4/10/2002).
I used Firebird Superserver 1.0.
In my server.xml is:
<!-- SIMPLE WEBAPP -->
<Context path="/SimpleWebapp" docBase="SimpleWebapp" debug="0"
reloadable="true" crossContext="true">
<Resource name="java:/diakonis" auth="Container"
type="org.firebirdsql.FBDataSourceObjectFactory" />
<ResourceParams name="java:/diakonis" >
<parameter>
<name>factory</name><value>org.firebirdsql.FBDataSourceObjectFactory</value>
</parameter>
<parameter>
<name>User</name><value>sysdba</value>
</parameter>
<parameter>
<name>Password</name><value>masterkey</value>
</parameter>
<parameter>
<name>MinSize</name><value>0</value>
</parameter>
<parameter>
<name>MaxSize</name><value>20</value>
</parameter>
<parameter>
<name>DatabaseName</name><value>localhost/3050:/database/diakonis.gdb</value
</ResourceParams>
</Context>
In my web.xml is:
<resource-ref>
<description>JDBC pool</description>
<res-ref-name>java:/diakonis</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
And JSP is:
<%
Connection conn = null;
Context initCtx = (Context) new InitialContext();
Context ctx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) ctx.lookup("java:/diakonis");
conn = ds.getConnection();
try
{
Statement stm = conn.createStatement();
...etc...
}
finally
{
conn.close();
}
Returned error is:
javax.servlet.ServletException: Cannot create resource instance
In Tomcat/common/lib are all JAR files from distribution JDBC, also in
system CLASSPATH (without log4j-core).
With FBDriver, it works normally.
And second question - how to specify charset in Tomcat?
In classic JDBC connection (FBDriver) I can put lc_ctype to properties but
here?
Thanks
Leos
please, help me.
I installed last weekend new Tomcat 4.0.4 and I wanted use Firebird JDBC
driver (version from 4/10/2002).
I used Firebird Superserver 1.0.
In my server.xml is:
<!-- SIMPLE WEBAPP -->
<Context path="/SimpleWebapp" docBase="SimpleWebapp" debug="0"
reloadable="true" crossContext="true">
<Resource name="java:/diakonis" auth="Container"
type="org.firebirdsql.FBDataSourceObjectFactory" />
<ResourceParams name="java:/diakonis" >
<parameter>
<name>factory</name><value>org.firebirdsql.FBDataSourceObjectFactory</value>
</parameter>
<parameter>
<name>User</name><value>sysdba</value>
</parameter>
<parameter>
<name>Password</name><value>masterkey</value>
</parameter>
<parameter>
<name>MinSize</name><value>0</value>
</parameter>
<parameter>
<name>MaxSize</name><value>20</value>
</parameter>
<parameter>
<name>DatabaseName</name><value>localhost/3050:/database/diakonis.gdb</value
></parameter>
</ResourceParams>
</Context>
In my web.xml is:
<resource-ref>
<description>JDBC pool</description>
<res-ref-name>java:/diakonis</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
And JSP is:
<%
Connection conn = null;
Context initCtx = (Context) new InitialContext();
Context ctx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource) ctx.lookup("java:/diakonis");
conn = ds.getConnection();
try
{
Statement stm = conn.createStatement();
...etc...
}
finally
{
conn.close();
}
Returned error is:
javax.servlet.ServletException: Cannot create resource instance
In Tomcat/common/lib are all JAR files from distribution JDBC, also in
system CLASSPATH (without log4j-core).
With FBDriver, it works normally.
And second question - how to specify charset in Tomcat?
In classic JDBC connection (FBDriver) I can put lc_ctype to properties but
here?
Thanks
Leos