I appreciate your work. It is excellent.
I am having issues with encoding, I see question marks instead of letters.
I tried props.setProperty("encoding", "Cp1254");
But it didnt help.
Thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You need to set the "charSet" property if you want to set the connection characterset using Java character set names. The property "encoding" is used when you want to set the connection characterset using the Firebird name of the characterset (value "WIN1254" in this case).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This works fine as:
Properties ParamConnection = new Properties();
ParamConnection.setProperty(“user”, “SYSDBA”);
ParamConnection.setProperty(“password”, “masterkey”);
// ParamConnection.setProperty(“encoding”, “WIN1251″);
// Get connection
Connection con = DriverManager.getConnection(sCon, ParamConnection);
And if you remove the comment in a row
ParamConnection.setProperty (“encoding”, “WIN1251″)
An error occurs:
08-08 02:46:07.225: E / AndroidRuntime (1376): FATAL EXCEPTION: main
08-08 02:46:07.225: E / AndroidRuntime (1376): java.lang.IllegalStateException: Could not execute method of the activity
08-08 02:46:07.225: E / AndroidRuntime (1376): at android.view.View $ 1.onClick (View.java: 3599)
…..
….. more
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I appreciate your work. It is excellent.
I am having issues with encoding, I see question marks instead of letters.
I tried props.setProperty("encoding", "Cp1254");
But it didnt help.
Thanks in advance
You need to set the "charSet" property if you want to set the connection characterset using Java character set names. The property "encoding" is used when you want to set the connection characterset using the Firebird name of the characterset (value "WIN1254" in this case).
Thanks Mark.
I tried that too, it cant even connect to database.
When I remove that line, it connects and fetchs with question marks.
What error do you get on connecting?
This works fine as:
Properties ParamConnection = new Properties();
ParamConnection.setProperty(“user”, “SYSDBA”);
ParamConnection.setProperty(“password”, “masterkey”);
// ParamConnection.setProperty(“encoding”, “WIN1251″);
String sCon = “jdbc:firebirdsql:192.168.0.97/3050:TestDB”;
// register
DriverClass.forName(“org.firebirdsql.jdbc.FBDriver”);
// Get connection
Connection con = DriverManager.getConnection(sCon, ParamConnection);
And if you remove the comment in a row
ParamConnection.setProperty (“encoding”, “WIN1251″)
An error occurs:
08-08 02:46:07.225: E / AndroidRuntime (1376): FATAL EXCEPTION: main
08-08 02:46:07.225: E / AndroidRuntime (1376): java.lang.IllegalStateException: Could not execute method of the activity
08-08 02:46:07.225: E / AndroidRuntime (1376): at android.view.View $ 1.onClick (View.java: 3599)
…..
….. more
I will look at this. Please try "SET NAMES WIN1251" as a query instead.
Solved this problem as follows:
encoding in the connection parameters do not use.
Reading data from a text field in the database with the encoding 1251:
old code -
names[i] = rs.getString (1);
new code -
names[i] = new String (rs.getBytes (1), "cp1251");
Encoding issues should be fixed in 2.2.4. Can you confirm that ?