请确定你的数据库实例的字符集支持中文
使用如下语句察看字符集:
Select value$ from sys.props$ where name = 'NLS_NCHAR_CHARACTERSET';

解决方案 »

  1.   

    VALUE$
    --------------------------------------------------------------------------------
    ZHS16GBK结果是这个,说明什么呢?
      

  2.   

    <%@ page contentType="text/html; charset=gb2312" language="java" errorPage="/error.jsp" %>
    <%@ include file="/jstl.inc"%><html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <LINK href="../../style.css" type=text/css rel=stylesheet>
    </head>
    <body>
    <sql:update var="addCategory" dataSource="${shop}" sql="insert into category values('2','2','测试')">  
    </sql:update>
    更新成功
    </body>
    </html>我直接写汉字也会是写入??
      

  3.   

    String xxx=new String(request.getParameter("xxx").getBytes("ISO-8859-1"));
      

  4.   

    <%
    request.setCharacterEncoding("gb2312");
    %><sql:update var="addCategory" dataSource="${shop}" sql="insert into category values(?,?,?)">
    <sql:param value="<%=request.getParameter("categoryId")%>"/>
    <sql:param value="<%=request.getParameter("name")%>"/>
    <sql:param value="<%=request.getParameter("desc")%>"/>
    </sql:update>改成这个样子不可以吗?哪里有错呢?
      

  5.   

    duty为所获得的字符串:String duty=request.getParameter("duty");
    duty=new String(duty.getBytes("ISO-8859-1"),"GBK");原理就是进行一下字符集转换,具体的就看你支持的字符集。
      

  6.   

    转了肯定是可以的,我也碰到了和你一样的问题,我得到了下REQUEST的字符集看了下是null
      

  7.   

    解决了。不用转。
    <%@ page contentType="text/html;charset=gb2312"%>
    <%
    response.setContentType("text/html; charset=GB2312"); 
    request.setCharacterEncoding("gb2312");
    %>
    然后把<form action="addCategory_do.jsp" method="get">方法改为post就可以了。
      

  8.   

    request.setCharacterEncoding("gb2312");
    就是这句话
    加上说可以了
      

  9.   

    表单里用get方法不可以吗?
    不清楚!
    学习!