Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: Greek characters are stored in mysql database like "?????????".Please help.

  1. #1
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Greek characters are stored in mysql database like "?????????".Please help.

    I did an application with jframe which i store member personal info like name, surname etc.But when i save it to Mysql database the values are ??????.I have changed database and table and columns collation to utf8, i checked java encoding it's utf-8 but the problem remains.Please help i have spent hours in google search but nothing that works.
    Thanks in advance.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Try this article. And practice your searching. I found many useful articles and StackOverflow topics that cover this problem from many different angles.

  3. #3
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Hello.
    I would suggest this.
    Login to MySql database directly from the command prompt in windows or shell terminal in linux. Try to insert some data. And then read this data. See if you get them right. If yes then there shall be no problem with java i suppose.
    Let me hear from you.

    Syed.

  4. #4
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Thanks for the answer but i am not doing a web app.I am doing an application using java and jframe.

    --- Update ---

    Quote Originally Posted by syedbhai View Post
    Hello.
    I would suggest this.
    Login to MySql database directly from the command prompt in windows or shell terminal in linux. Try to insert some data. And then read this data. See if you get them right. If yes then there shall be no problem with java i suppose.
    Let me hear from you.

    Syed.
    Hello mate, i have inserted data from mysql and i get them right.So I suppose it's java problem because when i try to insert data from jframe app i dont get them right.But i checked as i have mention above that the project->properties->unicode its UTF-8.

  5. #5
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Hello.
    I see. Thanks for the update.
    Now can you write java console application. Just use plain JDBC. Insert some data using the program.
    And read it at the command/shell prompt.
    Let me see if you get the right data.

    Syed.

  6. #6
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Quote Originally Posted by syedbhai View Post
    Hello.
    I see. Thanks for the update.
    Now can you write java console application. Just use plain JDBC. Insert some data using the program.
    And read it at the command/shell prompt.
    Let me see if you get the right data.

    Syed.
    As i have understand i must enter data to app and then check from mysql control panel->shell prompt if the data in the database are ok.I did it but the ????? remains.

  7. #7
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Hello.
    I have asked you to write a console app in java. Not the one you have already written earlier.
    Did you write one more separate console app just to ensure if the data is stored properly in the db?

    Syed.

  8. #8
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Quote Originally Posted by syedbhai View Post
    Hello.
    I have asked you to write a console app in java. Not the one you have already written earlier.
    Did you write one more separate console app just to ensure if the data is stored properly in the db?

    Syed.
    Untitled.jpg
    I have run the application with greek letters but the problem remains.I made the app in the photo.Sorry i am beginner.

  9. #9
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    After many hours i found that it's when i assign the variable with greek characters in sql to execute it that cause the problem.

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??????,'var2','var3','var4',1234,1234,1234,1234,' 2013-10-05')' at line 1

    Anyone which can help

  10. #10
    Member
    Join Date
    Mar 2011
    Posts
    84
    My Mood
    Daring
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default Re: Greek characters are stored in mysql database like "?????????".Please help.

    Tell me where are you writing these SQL Queries?? I assume you may be using console. right?

Similar Threads

  1. Replies: 2
    Last Post: July 8th, 2013, 11:20 PM
  2. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  3. Replies: 1
    Last Post: December 15th, 2011, 08:29 AM
  4. Replies: 3
    Last Post: December 7th, 2011, 02:03 AM
  5. Replies: 1
    Last Post: January 15th, 2010, 01:32 AM

Tags for this Thread