用文本域向数据库oracle提交文字时
数据类型为:
type:VARCHAR2 Length 4000
字数一多就提交不进去
报错 java.sql.SQLException: 数据大小超出此类型的最大值: 4609
那位大侠帮忙指点一下 多谢
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> <%@ include file="include/dbbegin.jsp"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> </head>
<body> <%
int i=0; String ctitle=""; if(request.getParameter("title")!=null && !request.getParameter("title").equals("")){ ctitle=new String (request.getParameter("title").toString().getBytes("iso8859-1")); i++; } String ccontent=""; if(request.getParameter("content")!=null && !request.getParameter("content").equals("")){ ccontent=new String (request.getParameter("content").toString().getBytes("iso8859-1")); i++; } String pic=request.getParameter("pic"); String sqlstr="INSERT INTO XLT_PHS_NEWS (TITLE,CONTENT,ID)VALUES(?,?,SEQ_XLTNEWS_COUNT.nextval )"; if(i==2){ PreparedStatement stmt=null; stmt=conn.prepareStatement(sqlstr); stmt.setString(1,ctitle); stmt.setString(2,ccontent); stmt.executeUpdate(); stmt.close(); out.print("<script>alert(\"信息添加完成。\");window.location=\"item_new_show.jsp\";</script>"); } else{ out.print("<script>alert(\"信息不完整,请重新处理。\");history.back();</script>"); } %> </body> </html> <%@ include file="include/dbend.jsp"%>