int rowCount = pstmt.executeUpdate(); 怎么不执行?

Anajian 2004-08-13 11:00:12

pstmt=db.conn.prepareStatement(sql);
pstmt.setString(1,n1);
pstmt.setString(2,n2);
pstmt.setString(3,n3);
pstmt.setFloat(4,n4);
pstmt.setString(5,n5);
pstmt.setString(6,n6);
pstmt.setString(7,n7);


rowCount = pstmt.executeUpdate();


在该语句 rowCount = pstmt.executeUpdate();
前面的语句可一正常执行,到该语句就不执行了,

...全文
611 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Anajian 2004-08-13
  • 打赏
  • 举报
回复
sql
String sql="insert into consumer values (?,?,?,?,?,?,?)";
Anajian 2004-08-13
  • 打赏
  • 举报
回复
type Exception report

message

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

exception

javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]????: ??????????????????
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Person.cominfo_005fok_jsp._jspService(cominfo_005fok_jsp.java:231)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


root cause

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]????: ??????????????????
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
org.apache.jsp.Person.cominfo_005fok_jsp._jspService(cominfo_005fok_jsp.java:178)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.25 logs.

lovelymaomao 2004-08-13
  • 打赏
  • 举报
回复
sql 是怎么写的啊?
xuyang821225 2004-08-13
  • 打赏
  • 举报
回复
有next()吗?
luckywei 2004-08-13
  • 打赏
  • 举报
回复
sql的组装代码贴出来
JamesLeeCH 2004-08-13
  • 打赏
  • 举报
回复
sql再确认!
Weilibo 2004-08-13
  • 打赏
  • 举报
回复
报什么错误?

检查一下你的sql语句
outiejun 2004-08-13
  • 打赏
  • 举报
回复
UP
luckywei 2004-08-13
  • 打赏
  • 举报
回复
确认一下每个赙值函数的类型与字段类型是否一致,比如setString对应字符类型字段

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧