I've my jsp, where I simply want to fill a table with some "italian" characters:

<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection 
("jdbc:mysql://localhost:3306/jdbctest?useUnicode=true&characterEncoding=ISO-8859-1", 
"usrjdbc", "pwd");
Statement stmt = conn.createStatement();
stmt.executeUpdate("INSERT INTO table (text) VALUES ('אטלשע')");
ResultSet rs = stmt.executeQuery("SELECT * FROM table");
while (rs.next()) {
   int id = rs.getInt("id");
   String text = rs.getString("text");
   out.print("row#" + rs.getRow() + ": id=" + id + ", text=" + text);
   out.println("<br>");
}
stmt.close();
conn.close();
%>

Everything works fine, and when I print the content of the db with the getString 
mehotd, I see my characters.
The problem is that when I go to the MySQL prompt, I can see strange characters 
isntead of the ones I tried to write.

MySQL uses the default ISO-8859-1 encoding, and since I'm telling to the JDBC driver 
to use ISO-8859-1, I can't explain what's wrong


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to