try{
Connection con = null;
Statement sta = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver");
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
String add = "jdbc:mysql://localhost:3306/blog";
String user = "root";
String pass = "123";
con = java.sql.DriverManager.getConnection(add,user,pass);
sta = con.createStatement();
String name = new String(request.getParameter("name").getBytes("iso8859_1"));
String context = new String(request.getParameter("context").getBytes("iso8859_1"));
String classID = request.getParameter("classID");
String in = "insert into rizhi values(null,'"+name+"','"+context+"',"+classID+")";
sta.executeUpdate(in);