Subject | Re: Firebird 2.0 and UNICODE |
---|---|
Author | mailmur |
Post date | 2007-02-24T09:01:16Z |
FYI,
You use "charSet" connection property, but I have always used
"encoding" attribute. Wiki page says:
* When only encoding property specified, driver uses the default
mapping between server and Java encodings. When encoding property is
not set or set to "NONE", the default JVM encoding is used to
interpret bytes coming from the server.
* When only charSet property is specified, driver uses the reverse
mapping to specify the connection encoding for the server and
interprets byte stream according to the value of the property.
Do anyone know which one is the best url properties in java
environment and database use UTF8 default charset?
1) UnicodeReader
http://koti.mbnet.fi/akini/java/unicodereader/
http://koti.mbnet.fi/akini/java/java_utf8_xml/
See my unicode reader/inputstream implementations. Various open-source
and few commercials have asked me to use it. I give everyone full
grants to use it as he/she please.
It makes your life easier to read unicode files, especially those
nasty UTF-8withBOM files where Java sux a lot. Helper classes
recognize all bom markers and skip it at the start of files.
2) Firebird unicode test
http://koti.mbnet.fi/akini/fb/
http://koti.mbnet.fi/akini/fb/testdbs.zip
http://www.flamerobin.org/
http://jaybirdwiki.firebirdsql.org/jaybird/doku.php?id=tip:charset
See my FB unicode test application and example.
I use Flamerobin admin tool and it can display unicode characters if
you choose an unicode font. I use windows "MS Arial Unicode" which
have found the best unicode font available in any OS system.
Standalone jdbc connection driver and url. I use this driver and
Tomcat DBCP connection pool configuration. Its more transparent if
must change the database system later.
org.firebirdsql.jdbc.FBDriver
jdbc:firebirdsql:localhost/3050:c:/db/testutf8.fdb?encoding=UTF8&user=myid&password=mypwd
Creating a UTF8 default database:
1: Create test database using isql.exe tool
* Run "{fb}\bin\isql.exe" commandline util to create a database
SQL> CREATE DATABASE 'c:\db\testutf8.fdb'
user 'sysdba' password 'masterkey' DEFAULT CHARACTER UTF8;
SQL> SELECT * FROM rdb$database;
SQL> QUIT;
2: Create test database using Flamerobin admin
* Database/Create new Database command and select UTF8 charset
thx
You use "charSet" connection property, but I have always used
"encoding" attribute. Wiki page says:
* When only encoding property specified, driver uses the default
mapping between server and Java encodings. When encoding property is
not set or set to "NONE", the default JVM encoding is used to
interpret bytes coming from the server.
* When only charSet property is specified, driver uses the reverse
mapping to specify the connection encoding for the server and
interprets byte stream according to the value of the property.
Do anyone know which one is the best url properties in java
environment and database use UTF8 default charset?
1) UnicodeReader
http://koti.mbnet.fi/akini/java/unicodereader/
http://koti.mbnet.fi/akini/java/java_utf8_xml/
See my unicode reader/inputstream implementations. Various open-source
and few commercials have asked me to use it. I give everyone full
grants to use it as he/she please.
It makes your life easier to read unicode files, especially those
nasty UTF-8withBOM files where Java sux a lot. Helper classes
recognize all bom markers and skip it at the start of files.
2) Firebird unicode test
http://koti.mbnet.fi/akini/fb/
http://koti.mbnet.fi/akini/fb/testdbs.zip
http://www.flamerobin.org/
http://jaybirdwiki.firebirdsql.org/jaybird/doku.php?id=tip:charset
See my FB unicode test application and example.
I use Flamerobin admin tool and it can display unicode characters if
you choose an unicode font. I use windows "MS Arial Unicode" which
have found the best unicode font available in any OS system.
Standalone jdbc connection driver and url. I use this driver and
Tomcat DBCP connection pool configuration. Its more transparent if
must change the database system later.
org.firebirdsql.jdbc.FBDriver
jdbc:firebirdsql:localhost/3050:c:/db/testutf8.fdb?encoding=UTF8&user=myid&password=mypwd
Creating a UTF8 default database:
1: Create test database using isql.exe tool
* Run "{fb}\bin\isql.exe" commandline util to create a database
SQL> CREATE DATABASE 'c:\db\testutf8.fdb'
user 'sysdba' password 'masterkey' DEFAULT CHARACTER UTF8;
SQL> SELECT * FROM rdb$database;
SQL> QUIT;
2: Create test database using Flamerobin admin
* Database/Create new Database command and select UTF8 charset
thx
--- In Firebird-Java@yahoogroups.com, "gsantosgo" <gsantosgo@...> wrote:
> Hello.
>
> My problem is SOLVED. The problem was, I am using SQL Hammer (now it
> is called BlazeTOP), when i am doing SQL query on Firebird Database
> with this software, the returned result doesn't know to display
> Unicode Characters.
>
> Then i used, a software is called JDBCTOOL (it is written in Java),
> and i did the same SQL query and the result displays well Unicode
> Characters. Then FIREBIRD 2.0 is working perfectly with Unicode
> Characters.
>
> I put this in my code:
>
> 1. How is it Configuration Connection?
> Driver driver = new org.firebirdsql.jdbc.FBDriver();
> // Conexion a Base Datos
> java.util.Properties connectionProperties = new java.util.Properties();
> connectionProperties.put("user", "sysdba");
> connectionProperties.put("password", "masterkey");
> connectionProperties.put("charSet", "UTF-8");
> //connectionProperties.put("encoding","UTF8");
> Connection connection = driver.connect(databaseURL,
connectionProperties)
>
> 2. How is it reading encoded UTF8 files in Java?
>
> bufferedReader = new BufferedReader(new InputStreamReader(new
> FileInputStream(absolutePath),"UTF-8"));
>
>
> Thank you for everything.
> Guillermo