JSP connection mysql database If there is a Chinese access, there is a garbled, and the Chinese shows a bunch of "?",
Need to do the following change
1. Connection string:
String mysqldriver = "org.gjt.mm.mysql.driver"; // Database driver
String mysqlurl = "JDBC: mysql: // localhost: 3306 / bbs? Useunicode = true & characterencoding = GB2312"; // Database connection string
String mysqluser = "root"; // Database Username
String mysqlpsw = ""; // database password
Class.Forname ("org.gjt.mm.mysql.driver"). NewInstance (); // Register Driver
Conn = drivermanager.getConnection (mysqlurl, mysqluser, mysqlpsw); // Get a connection
2. Request object settings:
<% Request.SetCharacterencoding ("GB2312");%>
Set the character set of the JSP's request object to support Chinese