Subject | Re: jdbc type 4 and DataSource with Resin work fine |
---|---|
Author | jwcanada@yahoo.com |
Post date | 2001-10-30T13:37:55Z |
Dmitry,
Here is a sample code.
In resin.conf file to add your database
<resource-ref>
<res-ref-name>jdbc/myFirebirdSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="org.firebirdsql.jdbc.FBDriver"/>
<init-param
url="jdbc:firebirdsql:localhost:d:/db/YourDatabase.gdb"/>
<init-param user="SYSDBA"/>
<init-param password="masterkey"/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
To get Connection, use
Context env = (Context) new InitialContext().lookup("java:comp/env");
dataSource = (DataSource) env.lookup("jdbc/myFirebirdSource");
conn = dataSource.getConnection();
It works fine for me.
jw
--- "Dmitry S. Kolobaev" <dk@...> wrote:
Here is a sample code.
In resin.conf file to add your database
<resource-ref>
<res-ref-name>jdbc/myFirebirdSource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="org.firebirdsql.jdbc.FBDriver"/>
<init-param
url="jdbc:firebirdsql:localhost:d:/db/YourDatabase.gdb"/>
<init-param user="SYSDBA"/>
<init-param password="masterkey"/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
To get Connection, use
Context env = (Context) new InitialContext().lookup("java:comp/env");
dataSource = (DataSource) env.lookup("jdbc/myFirebirdSource");
conn = dataSource.getConnection();
It works fine for me.
jw
--- "Dmitry S. Kolobaev" <dk@...> wrote:
> Hi,
> You wrote in egroups.ib-java at Sat, 27 Oct 2001
> 16:12:51 +0000 (UTC):
>
> Can you help me to get JDBC type 4 driver for
> FB/IB? I have a problem
> with InterServer and look for alternative solution
> for use FB from java
> applications. My web-applications work at Resin
> Servlet Container, and I
> think, you can show me way to resolve my problem ;-)
>
>
> ---
> Best regards,
> Dmitry