Здравствуйте.
создал БД и таблицу FireBird 3 с полем в кириллице
SQL> CREATE DATABASE 'D:\databases\Firebird\data\example.fdb' USER 'SYS' PASSWORD 'пароль' DEFAULT CHARACTER SET WIN1251;
SQL> create table customers(id int not null,name varchar(50));
SQL> insert into customers values (1,'first');
SQL> insert into customers values (2,'второй');
SQL> commit;
SQL> select * from customers;
ID NAME
============ ==================================================
1 first
2 второй
Написал клиент на Java с encoding WIN1251 результата
Properties props = new Properties();
props.setProperty("user", "sys");
props.setProperty("password", "пароль");
props.setProperty("encoding", "WIN1251");
String connection_string=connection_string="jdbc:firebirdsql:192.168.10.41/3050:D:\\databases\\Firebird\\data\\example.fdb";
boolean st = false;
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
String Connection_Status = "";
String value;
Integer count_values;
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
Connection connection = DriverManager.getConnection(connection_string, props);
connection.close();
Connection_Status = "Подключение к БД " + connection_string + " прошло успешно.";
try {
//loading drivers for mysql
Class.forName("org.firebirdsql.jdbc.FBDriver");
//creating connection with the database
con = DriverManager.getConnection
(connection_string, props);
ps = con.prepareStatement
(Text_Script);
//ps.setString(1, uname);
//ps.setString(2, pass);
rs = ps.executeQuery();
//st = rs.next();
value = "";
count_values = 0;
// iterate through the java resultset
while (rs.next()) {
count_values = count_values + 1;
value = value + rs.getString("ID") + "; ";
value = value + rs.getString("name") +"; ";
}
но в результате получаю абракадабру вместо кириллицы
1; first; 2; ўв®а®©;
Как решить эту проблему?