显示页面:
<script type="text/javascript">
function subchk() {
document.form1.content.value = document.frames("myiframe").document
.frames("editor_body_area").document.documentEllement.outeHTML;
}
</script>
<body>
<div >
<form name="form1" onSubmit="subchk()" action="upNewsResult.jsp" method="post">
<table align="center">
<tr>
  <td colspan="2">&nbsp;</td>
  </tr>
<tr>
  <td colspan="2"><p>请输入标题:
    <input name="editName" type="text" size="50">
      <input name="submit"
type="submit" value="提交">
  </p>     </td>
  </tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"  width="626"><iframe id="myiframe"
src="/JPKC/editor/editor.htm?id=content&ReadCookie=0" frameborder="0"
scrolling="no" width="625" height="460"></iframe> 
 <textarea
name="content" id="content" cols="80" rows="2" style="display:none"></textarea></td>
</tr>
</table></form>
</div>
</body>
接受页面:<%
String name=new String(request.getParameter("editName").getBytes("iso_8859-1"));
String contents=new String(request.getParameter("content").getBytes("iso_8859-1"));
//String tname=session.getAttribute("tname").toString();
SimpleDateFormat   simpledateformat   =   new   SimpleDateFormat("yyyy-MM-dd   HH:ss");   
String dt =   simpledateformat.format(new Date()); 
String insertsql="INSERT INTO tb_newsinfo( title, content, addtime) VALUES(?,? ,?) ";
Connection conn=DBConnnection.getConnection();

try {
 PreparedStatement  stm=conn.prepareStatement(insertsql);
 stm.setString(1,name);
 stm.setString(2,contents);
 stm.setString(3,dt);
    int t=stm.executeUpdate();
    if(t>0)
 {

%>
"发布成功!"
<%   
 
 }
 else{
 
 %>
 "发布失败!"
 <% 
 }
 

}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
%>

"公告发布失败!"
<% 
}
conn.close();  
 %>出错:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s).

解决方案 »

  1.   

    你JDBC里面在DriverMamnager.getConnection();里面传参数的时候,传进的参数是给Driver的时候出现非法参数,请检查...
      

  2.   

    你的异常栈没出来
    DriverMamnager.getConnection()
    这个函数的内容最好也帖出来
      

  3.   

    是驱动加载字符串有错误我不知道如何去转换!!
    要转成gbk的字符
      

  4.   

    主要是content的内容进行转换!!
      

  5.   

    传递页面:
    <td colspan="2" width="626"><iframe id="myiframe"
    src="/JPKC/editor/editor.htm?id=content&ReadCookie=0" frameborder="0"
    scrolling="no" width="625" height="460"></iframe>  
     <textarea
    name="content" id="content" cols="80" rows="2" style="display:none"></textarea></td>
    接收页面:
    String contents=new String(request.getParameter("content").getBytes("iso_8859-1"));   contents中没有内容!
      

  6.   

    <%@page contentType="text/html charset=GB2312"%>
      

  7.   

    那你把getBytes("iso_8859-1"));这个转码去掉,然后在tomcat的server.xml里面加上
    URIEncoding="UTF-8"web乱码
    http://blog.csdn.net/crazylaa/archive/2009/12/24/5066784.aspx
    http://seagar-collection.javaeye.com/blog/297149