/**
* @param f
* @throws TODO
* 图书续借
*/
public boolean reborrow(Connection con, String id) { this.bookid = id;
String tableName = "message";//数据库用户表信息表 boolean v = false;
int result = 0;
Statement stmt = null;
Date dNow = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String today = formatter.format(dNow);
System.out.print("\n"+bookid+"\n" + today + "\n");
try {
stmt = con.createStatement(); String isCorrect = "update message"
+ " set reborrowday = '" + today
+ "',returnday = '" + today + "' where bookid = '" + bookid
+ "'"; result = stmt.executeUpdate(isCorrect); System.out.print(":" + result + "\n");
} catch (Exception e) {
System.out.println("error1 is " + e);
} finally {
try {
stmt.close();
con.close();
} catch (SQLException ex) {
System.out.println("error2 is " + ex);
}
} return v; }总是Unknown column reborrowday in 'field list'
我表里有reborrowday的字段,怎么会未知呢?
* @param f
* @throws TODO
* 图书续借
*/
public boolean reborrow(Connection con, String id) { this.bookid = id;
String tableName = "message";//数据库用户表信息表 boolean v = false;
int result = 0;
Statement stmt = null;
Date dNow = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String today = formatter.format(dNow);
System.out.print("\n"+bookid+"\n" + today + "\n");
try {
stmt = con.createStatement(); String isCorrect = "update message"
+ " set reborrowday = '" + today
+ "',returnday = '" + today + "' where bookid = '" + bookid
+ "'"; result = stmt.executeUpdate(isCorrect); System.out.print(":" + result + "\n");
} catch (Exception e) {
System.out.println("error1 is " + e);
} finally {
try {
stmt.close();
con.close();
} catch (SQLException ex) {
System.out.println("error2 is " + ex);
}
} return v; }总是Unknown column reborrowday in 'field list'
我表里有reborrowday的字段,怎么会未知呢?
解决方案 »
- webservice 赋值问题
- SQL语句查询控制时间范围,大家帮忙分析下怎么改
- 敢问 这页中的投票/热点调查 用jsp怎么做? 如何判断相同ip不能重复投票? 做项目要用到了。
- 表单提交
- ruby和rails有什么不同
- 急啊,在线等,谁能帮忙看一下?
- 请问各位大哥我的jsp页面不支持 ${indexid + 1} 这类的形式 为什么啊?
- 小妹求问各位大哥大姐关于applet怎样访问数据库的问题?
- The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
- 请问我装了tomcat并运行了它,好像不能解释jsp样的
- 请问怎样设置才能使访问http://localhost:8080之后进入自己的网站而不是tomcat的管理页面
- 如何实现统计点击率
如果是linux系统,要区分大小写的,须和数据库字段名一致
而且你那么多打印语句是没输出还是根本就没贴上来啊?