Hi all,
Serious Urgent problem:
i am working on a Japanese OS
i have got 2 info objects, and 2 statement objects, i am opening a connection with Properties info1:
info1.put("user", "...");
info1.put("password", "...");
Connection con1, Statement stmt1, and ResultSet rs1. After executing query with stmt1, I am opening a new connection with Properties info2:
info2.put("user", "...");
info2.put("password", "...");
info2.put("charSet", "ISO8859_1");
Connection con2, Statement stmt2, and ResultSet rs2. I am performing a close on con2,stmt2,rs2.
I am doing:
rs1=stmt1.executeQuery("SELECT...");
The problem is that rs1.getString(1) isn't printing the same japanese characters anymore, instead giving garbage chracters.
The sample code is:
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Properties info = new Properties();
info.put("user", "...");
info.put("password", "....");
Connection con1 = DriverManager.getConnection("jdbc
dbc:...", info);
Statement stmt1 = con1.createStatement();
ResultSet rs1 = stmt1.executeQuery("SELECT FIELD2 FROM FOO");
if (rs1.next())
{
System.out.println("First try with connection1: " + rs1.getString(1));
}
//Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Properties info2 = new Properties();
info2.put("user", "...");
info2.put("password", "d...");
info2.put("charSet", "ISO8859_1");
Connection con2 = DriverManager.getConnection("jdbc
dbc:HARIT", info2);
Statement stmt2 = con2.createStatement();
ResultSet rs2 = stmt2.executeQuery("SELECT FIELD2 FROM FOO WHERE FIELD1 = 2");
if (rs2.next())
{
System.out.println(rs2.getString(1));
}
rs2.close();
stmt2.close();
con2.close();
rs1 = stmt1.executeQuery("SELECT FIELD2 FROM FOO");
if (rs1.next())
{
System.out.println("Second try with connection1: " + rs1.getString(1));
}
rs1.close();
stmt1.close();
con1.close();
I want to know is this a
JDBC techinical Spec problem or something else.
nayan_khare@yahoo.com