Subject Re: [Firebird-Java] Re: FB Driver, Tomcat Resource, JSP and charset
Author Danilo Luiz Rheinheimer
m> I have the same problem

Me too.
Some days ago I talk with Roman Rokytskyy about this.
It show me a possible way of implement it. I do not had time to
do it but as I need it I will. If someone want/need to this this before
this is his message :

------------ Roman Rokytskyy message begin -------------------

> I am with the same problem. I need to use Firebird with JBoss.

In general, JBoss should be much more easier to configure, because David
Jencks, one of the driver developers is main developer at JBoss.org.

> I try to use this but it do not had support to it. I think it is
> easy implement this on the current driver.
>
> <config-property>
> <config-property-name>lc_ctype</config-property-name>
> <config-property-type>java.lang.String</config-
> property-type>
> <config-property-value>ISO8859_1</config-property-
> value>
> </config-property>

I just checked implementation, you cannot use this. However, contact David
Jencks, he can easily add the feature you need.

If you want to do this yourself, here's an idea:

In FBManagedConnectionFactory.java add the following method:

public void setCharSet(String charset) {
hashCode = 0;
defaultCri.setProperty(GDS.isc_tpb_lc_ctype, charset);
}

This should do the trick.

> > But if you cannot, you can
> > try URL-encoded parameters:
> >
> > jdbc:firebirdsql:localhost/3050:/var/.../TOPSPORT.GDB?
> > lc_ctype=UNICODE_FSS&user=sysdba&password=masterkey
> >

This is a feature of org.firebirdsql.jdbc.FBDriver class only. JBoss uses
JCA features of this driver, param in URLs are not supported.

------------ Roman Rokytskyy message end -------------------

>>
>> I dont know how to specify charset for DB in tomcat resouce
m> specification.
>>
>> In server.xml is:
>> <Resource name="jdbc/icdiakonis" auth="Container"
>> type="javax.sql.DataSource" />
>> <ResourceParams name="jdbc/icdiakonis" >
>> <parameter>
>>
m> <name>driverClassName</name><value>org.firebirdsql.jdbc.FBDriver</valu
e>>
>> </parameter>
>> <parameter> <name>user</name><value>sysdba</value> </parameter>
>> <parameter> <name>password</name><value>masterkey</value>
m> </parameter>
>> <parameter> <name>lc_ctype</name><value>UNICODE_FSS</value>
m> </parameter>
>> <parameter>
>>
m> <name>driverName</name><value>jdbc:firebirdsql:localhost/3050:/databas
m> e/idum
>> 2.gdb</value> </parameter>
>> </ResourceParams>
>>
>> Specification of "lc_ctype" did not work, when I accessed to non-
m> english
>> characters, then I got some error from server and/or driver . But
m> when I
>> read from "english" tables (RDB$RELATIONS) , it worked OK.
>>
>> I tested also change driverName to
>> "?lc_ctype=UNICODE_FSS&user=sysdba&password=masterkey".
>> This crash Tomcat on start (reading config).
>> And when use "?
m> lc_ctype=UNICODE_FSS&user=sysdba&password=masterkey"
>> then I cannot connect to server.
>>
>> Could you help me?
>> Thanks.
>> Leos



m> To unsubscribe from this group, send an email to:
m> Firebird-Java-unsubscribe@yahoogroups.com



m> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





--
Best regards,
Danilo mailto:danilo@...