Subject | Re: jdbc driver and unicode |
---|---|
Author | rrokytskyy |
Post date | 2002-07-22T13:52:37Z |
Hi,
hardly can avoid using it. lc_ctype is a property that specifies what
encoding will be used when driver talks to database. it is necessary
for database server to perform translation between character encoding
used in driver into character encoding used in database. if there's
no chance to make such translation, exception is thrown.
by default driver and database server use encoding NONE, that
means "what you get is what was saved" (driver uses String.getBytes()
and new String(byte[]) methods to serialize/deserialize data,
database server does not perform any translation at all). this might
cause problems when data are stored by a JVM with default encoding A
and are read in another JVM with default encoding B. if you want to
get same result all the time, you better specify character set for
database and for driver using lc_ctype property.
note, when using org.firebirdsql.jdbc.FBDriver class, you can encode
connection properties (like lc_ctype) in database URL after '?' as in
HTTP:
jdbc:firebirdsql:localhost/3050:c:/database/my.gdb?
lc_ctype=UNICODE_FSS
Hope this helps.
Best regards,
Roman Rokytskyy
> i've searched the archives & just confused myself even more ;-)yes, it supports unicode. in java any string is unicode, so you
> does the current crop of jdbc drivers support unicode? if so, how
> do i specify that i want top use unicode? i guess i should note
> that i'm coming at this from cfmx (jdbc drivers) not purely java,
> so the adding lc_ctype is also a bit problematic as well.
hardly can avoid using it. lc_ctype is a property that specifies what
encoding will be used when driver talks to database. it is necessary
for database server to perform translation between character encoding
used in driver into character encoding used in database. if there's
no chance to make such translation, exception is thrown.
by default driver and database server use encoding NONE, that
means "what you get is what was saved" (driver uses String.getBytes()
and new String(byte[]) methods to serialize/deserialize data,
database server does not perform any translation at all). this might
cause problems when data are stored by a JVM with default encoding A
and are read in another JVM with default encoding B. if you want to
get same result all the time, you better specify character set for
database and for driver using lc_ctype property.
note, when using org.firebirdsql.jdbc.FBDriver class, you can encode
connection properties (like lc_ctype) in database URL after '?' as in
HTTP:
jdbc:firebirdsql:localhost/3050:c:/database/my.gdb?
lc_ctype=UNICODE_FSS
Hope this helps.
Best regards,
Roman Rokytskyy