4 messages in com.mysql.lists.mysqlRE: Problems with getString() of SQLC...| From | Sent On | Attachments |
|---|---|---|
| Palm Kevin | 13 May 2003 09:13 | |
| Mark Matthews | 14 May 2003 14:08 | |
| Palm Kevin | 15 May 2003 02:16 | |
| Mark Matthews | 15 May 2003 04:53 |
| Subject: | RE: Problems with getString() of SQLConnector 3.0.7. ??![]() |
|---|---|
| From: | Palm Kevin (kp...@infores.be) |
| Date: | 05/15/2003 02:16:27 AM |
| List: | com.mysql.lists.mysql |
I assume you mean Connector/J 3.0.7 : Yes
I've checked that the character set of my MySQL server is the same as my Java Virtual machine (ISO-8859-1). That means that each character is interpreted as to be encoded in one byte!!! So, there is no reason for converting a character into another!?! I really don't understand this, because with older versions of the mysql-driver it worked very well.
Regards, Kevin
-----Original Message----- From: Mark Matthews [mailto:ma...@mysql.com] Sent: 14 May 2003 23:09 To: Palm Kevin Cc: mys...@lists.mysql.com Subject: Re: Problems with getString() of SQLConnector 3.0.7. ??
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Palm Kevin wrote:
Hello,
My name is Palm Kevin and I found a strange behaviour with
SQLConnector 3.0.7.
I assume you mean Connector/J 3.0.7?
I've a DB-table that contains a field with an Object ID ( char(6) ).
This String may contain, among other characters, the character with the hexadecimalcode "7F".
When I used the mySQL driver 2.0.4. everything went right. I could select this String from the DB (resultSet.getString(1)) Example of a query : "SELECT ObjectID FROM MYTABLE WHERE LABEL = 'HELLO' " The result is the following String : "?J" ( The fourth character has the hexa-code "7F")
But now I passed to your new driver (SQLConnector 3.0.7). And here, the following problem occurs : When I do the same select as above I receive a different String :
The
character "7F" has been replaced by the character "00" (control character DELETE) !!!!
In most character sets, character 0x7F is 'delete'. What character set is your MySQL server set to? If you don't want the driver to translate _any_ characters, you should use getBytes(), not getString(). getString() will take any binary data you have, and translate it according to the character set you have configured.
-Mark
- -- For technical support contracts, visit https://order.mysql.com/?ref=mmma
__ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mark Matthews <ma...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, SW Dev. Manager - J2EE/Windows /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA <___/ www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+wrB7tvXNTca6JD8RAllsAJ9z6aEYVdCVquIf/z2ukrvKymKvNwCgqazM 8AnQ3jjjCt3SokuX8YkgJmY= =U4qg -----END PGP SIGNATURE-----
---
Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003
---
Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003




