Greek characters in the database are similar to question marks ("?????"). I can not find a solution. I developed an application using Java / Swing, but when I insert Greek letters into MySQL, it looks like question marks. I changed the db sort to utf8 and columns. My project encoding is set to UTF-8. When I insert Greek letters from MySQL, they are saved correctly.
I am using the jar connector file of MySQL.
public class Testing { public static void main(String[] args) { try { Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/chartest","root","1234"); Statement pst=conn.createStatement(); String var1="ασδασδ"; String sql="INSERT INTO chars(value) values('"+var1+"')"; pst.execute(sql); } catch (SQLException ex) { Logger.getLogger(Testing.class.getName()).log(Level.SEVERE, null, ex); } }
}
source share