Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    127

    Unanswered: Character set configuration in MySQL connection URL?

    Hi,

    I connect to my MySQL server using the mysql-connector-java-3.0.16-ga-bin.jar driver jars with the following connection URL,

    jdbc:mysql://<HOST>:<PORT>/<DB>

    while inserting a table column of Varchar(50) type with a value of
    Code:
    '&#195;˜nrew'
    , but i find the value inserted is
    Code:
    '&#195;?nrew'
    . It seems the default character set does not include the " ˜ " character.

    could anyone let me know how to set a character set in MySQL connection URL.,

    Thanks ,
    Shefu
    Last edited by Shefu; 05-01-07 at 09:11.

  2. #2
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    You cannot set the character set in the connection itself. The character set has to be set in the DB (either by table or column in table)

  3. #3
    Join Date
    Apr 2005
    Posts
    127
    Thanks for the reply aschk, the problem is whenever I try to insert the string ''&#195;˜nrew'' to my varchar field, it is inserted as ''&#195;?nrew''.

    Does it means that the character set used in MySQL (the default Latin1 is used) not supports the character ''˜'' ? or

    the JDBC driver does not understand the above character and replaces it with the symbol '?' ?

    Kindly suggest me how to insert the above character..

    Sn
    Last edited by Shefu; 05-03-07 at 03:30.

  4. #4
    Join Date
    Apr 2005
    Posts
    127
    How to query the character set used in the MySQL?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •