求各位大虾指教一下!

h641695 2010-09-18 04:07:58
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.IllegalStateException: getOutputStream() has already been called for this response
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:413)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)





我是用JSP想插入数据到SQL里!
...全文
68 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
h641695 2010-09-18
好了好了!出来了出来了!谢谢了~
回复
h641695 2010-09-18
com.microsoft.sqlserver.jdbc.SQLServerException: 仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'FirstLevelTitle'中的标识列指定显式值。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown Source)
at com.accp.News.DBConnection.FirstLeveTitleDBOpreation.insertOneRecord(FirstLeveTitleDBOpreation.java:60)
at org.apache.jsp.Page.saveFirstLevelTitle_jsp._jspService(saveFirstLevelTitle_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)



这是什么意思啊?
回复
h641695 2010-09-18
还是不行! 插入不进去!
回复
crazylaa 2010-09-18
ps.setString(4, strCurrenTime);

什么数据库?用数据库时间作为系统时间好了。

mysql:
String strSql = "insert into FirstLevelTitle values(?,?,?,now())";
oracle:
String strSql = "insert into FirstLevelTitle values(?,?,?,systimestamp)";
然后删掉ps.setString(4, strCurrenTime);
回复
qianquan 2010-09-18
sql 语句争取要写全,insert into tab(列名,列名。。) values(?,?..)
回复
h641695 2010-09-18
刚刚看了一下! 说是插入日期的问题!

SimpleDateFormat HFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String strCurrenTime = HFormat.format(new Date());
con = ConnectionHelp.getConnection();
String strSql = "insert into FirstLevelTitle values(?,?,?,?)";
ps = con.prepareStatement(strSql);
ps.setInt(1, getNewId());
ps.setString(2, fTitle.getTitleName());
ps.setString(3, fTitle.getCreator());
ps.setString(4, strCurrenTime);
回复
sound9world 2010-09-18
无代码 无真相啊

或者猜测说 是不是没有用内置对象out
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2010-09-18 04:07
社区公告
暂无公告