在jsp中加入
<%
request.setCharacterEncoding("GB2312");
%>

解决方案 »

  1.   

    其实很简单 String url ="jdbc: mysql://localhost/softforum?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1" 
    //testDB为你的数据库名 
    Connection conn= DriverManager.getConnection(url,"babo","dxzddp");
     
      

  2.   

    snicker和方法和我的第一种一样。只不过是用了url变量。
    而且既然url里面包括了user=soft&password=soft1234了
    Connection conn= DriverManager.getConnection(url,"babo","dxzddp");
    这里还要babo,dxzddp干吗?
    babo,dxzddp也是用户名和密码
      

  3.   

    在url里包括的话 就用getConnection(url)
    没包括就用getConnection(url,user,password)
      

  4.   


    用这个试试呢?
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost/addressbook","babo","dxzddp","true","GB2312");