String new_score = "update learning_paper set lp_votetimes = '"+ newscore + "' where lp_issue='"+issue+"' and lp_part='"+part+"' and lp_title='"+title+"'";
open();
try {
st = dbConn.createStatement();
//PreparedStatement ps = dbConn.prepareStatement(new_score);
//ps.executeUpdate();
st.execute(new_score);
//st.executeUpdate(new_score);
} catch (SQLException e) {
close();
}
new_score 语句在数据库中可以执行,但是写成java语句就没有反应,不报错,估计是tomcat没反应了。各位高手帮我看看,是什么问题?
open();
try {
st = dbConn.createStatement();
//PreparedStatement ps = dbConn.prepareStatement(new_score);
//ps.executeUpdate();
st.execute(new_score);
//st.executeUpdate(new_score);
} catch (SQLException e) {
close();
}
new_score 语句在数据库中可以执行,但是写成java语句就没有反应,不报错,估计是tomcat没反应了。各位高手帮我看看,是什么问题?
解决方案 »
- 关于struts标签知道的大神进来看看
- 求教:Spring3 AOP 在Controller里不起作用
- 有木有抓取网页内容的高手啊?求指教HttpURLConnection的用法
- 分页css,有时间的朋友帮忙看看 谢谢
- 网页如何正常显示带格式的JAVA代码?
- 一个数据连接问题
- 请问:有没有一个方法得到某一年的第几周的最后一天是这一年的几月几号?请高手指点!谢谢!
- excel2000转excel表为csv文件的问题???
- 为什么说asp不安全?
- response.sendRedirect()和forward标记跳转有什么区别???
- ASP下Set GetSession("conn")=server.CreateObject("adodb.connection");
- urlrewritefilter的<outbound-rule>用法
open();
try {
st = dbConn.createStatement();
//PreparedStatement ps = dbConn.prepareStatement(new_score);
//ps.executeUpdate();
st.execute(new_score);
//st.executeUpdate(new_score);
} catch (SQLException e) {
close();
} 1 首先看看你的jsp页面提交到servlet是否成功!,在你的servlet的 post()方法里System.out.print("进入Servlet");2 看看有没有反应!。如果你的jsp进入了servlet,你的方法说明也成功了,然后检查你的参数从jsp传递过来没有!
例如:System.out.print(request.getParamete("newscore"))3 在servlet中system.out.print(new_score);检查你的动态生成的sql语句是否语法有误3 st对象中的executeUpdate();方法返回int的 你可以 System.out.print(st.executeUpdate(new_score)); 检查的修改有没有成功
就是不报错,也不出异常就是 突然不执行了...
open();
try {
st = dbConn.createStatement();
//PreparedStatement ps = dbConn.prepareStatement(new_score);
//ps.executeUpdate();
st.execute(new_score);
//st.executeUpdate(new_score);
} catch (SQLException e)
{
//你这里没有处理异常 你只是捕捉了 system.out.print(e.getMessage()+"aaaaaaaaaaaaa");
close();
} 你这样试试