Probably, I will be the billionth person who asks how to make mysql begin to understand Russian. I tried all the tools available to me, wrote in the table UTF, CP1251, both in the columns and in the properties of the table itself, tried to write when connecting to the base like this

jdbc:mysql://eu-cdbr-west-02.cleardb.net:3306/heroku_ab7637be43866cf?charset=utf8 

I made the set charset before each input .....

 import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; public class Main { public static void main(String[] args) throws SQLException { Driver driver; driver=new com.mysql.cj.jdbc.Driver(); DriverManager.registerDriver(driver); // ApiContextInitializer.init(); // TelegramBotsApi telegramBotsApi = new TelegramBotsApi(); // Botstart1 bot = new Botstart1(); // try { // telegramBotsApi.registerBot(bot); // } catch (TelegramApiRequestException e) { // e.printStackTrace(); // } Bdate ss=new Bdate(); try { // ss.bd("set names utf8"); ss.bd("update users set username = 'уаыаыы' where userId=535077417"); ss.bs("select username from users where userid=535077417"); System.out.println( ss.res.getString(1)); } catch (SQLException e) { e.printStackTrace(); 

}}

 public class Bdate{ String url = "jdbc:mysql://eu-cdbr-west-02.cleardb.net:3306/heroku_ab7637be43866cf?charset=utf8"; String name="*******"; String password="*******"; Connection con; { try { con = DriverManager.getConnection(url,name,password); } catch (SQLException e) { e.printStackTrace(); } } ResultSet res; public void bd(String sql) throws SQLException { con.createStatement().execute(sql); } public void bs(String sql)throws SQLException{ res=con.createStatement().executeQuery(sql); res.next(); 

enter image description here

  • one
    Did you set collation: utf8_unicode_ci for tables and columns? - Screaming Voices
  • four
    Describe clearly, with a code without nagging, what and how you did, how you place the data and how you read it, otherwise there will be nothing left for us but to advise everything the same - andreymal
  • Of course, he exhibited both for tables and for Ut8 columns - Alekseev Stanislav
  • corrected the question - Stanislav Alekseev
  • that is, you want to say that you write Cyrillic in the table directly to the workbench and it does not accept? or what's the matter? - Paul Wall

0