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(); 