Pulling data from the database. Faced the problem that Russian characters are in the form of question marks, although they are normally recorded in the table itself.
I connect to the database as follows:
Class.forName("com.mysql.jdbc.Driver"); connection = DriverManager.getConnection("jdbc:" + drivername + "://" + host + "/" + dbName + "?useUnicode=true&characterEncoding=utf8", User, Password); stat = connection.createStatement(); stat.execute("SET CHARACTER SET utf8"); stat.execute("SET NAMES utf8"); I pull it like this:
String getdata = "Запрос"; PreparedStatement get = dbConnect.connection.prepareStatement(getdata); result = get.executeQuery(); while(result.next()) { ... } Encoding tables and the database itself - utf-8
servletalready obtained question marks. - Tsyklop