Answer the question
In order to leave comments, you need to log in
How to solve the problem with Cyrillic in FireBird?
Hello.
created a database and a FireBird 3 table with a field in Cyrillic
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 второй
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; ўв®а®©;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question