当前位置: 技术问答>java相关
一个关于数据库的简单问题!
来源: 互联网 发布时间:2015-01-27
本文导语: 各位大虾: 我现在在插入数据库的时候遇到一个问题(我使用的是mysql数据库) 我的参数定义如下: String account=request.getParameter("account"); String passwd=request.getParameter("passwd"); String jobname=request.getParameter(...
各位大虾:
我现在在插入数据库的时候遇到一个问题(我使用的是mysql数据库)
我的参数定义如下:
String account=request.getParameter("account");
String passwd=request.getParameter("passwd");
String jobname=request.getParameter("jobname");
String arguments=request.getParameter("arguments");
String jobtype=request.getParameter("jobtype");
int count=Integer.parseInt(request.getParameter("count"));
int hostcount=Integer.parseInt(request.getParameter("hostcount"));
String ymd1=request.getParameter("year1")+"-"+request.getParameter("month1")+"-"+request.getParameter("date1");
String hour1=request.getParameter("hour1");
String ymd=request.getParameter("year")+"-"+request.getParameter("month")+"-"+request.getParameter("date");
String hour=request.getParameter("hour");
int minmemory=Integer.parseInt(request.getParameter("minmemory"));
int maxmemory=Integer.parseInt(request.getParameter("maxmemory"));
插入的语句如下:
insert into jobsubmission(account,passwd,jobname,arguments,jobtype,count,hostcount,ymd,hour,ymd1,hour,minmemory,maxmemory) Values('chh','780318','submit','x','1',"+count+","+hostcount+",'1978-03-18','9','2001-8-27','8',"+minmemory+","+maxmemory+");
可是网页提示有错,请问错误在哪呢?如果您不吝赐教,我全部分数都给你
我现在在插入数据库的时候遇到一个问题(我使用的是mysql数据库)
我的参数定义如下:
String account=request.getParameter("account");
String passwd=request.getParameter("passwd");
String jobname=request.getParameter("jobname");
String arguments=request.getParameter("arguments");
String jobtype=request.getParameter("jobtype");
int count=Integer.parseInt(request.getParameter("count"));
int hostcount=Integer.parseInt(request.getParameter("hostcount"));
String ymd1=request.getParameter("year1")+"-"+request.getParameter("month1")+"-"+request.getParameter("date1");
String hour1=request.getParameter("hour1");
String ymd=request.getParameter("year")+"-"+request.getParameter("month")+"-"+request.getParameter("date");
String hour=request.getParameter("hour");
int minmemory=Integer.parseInt(request.getParameter("minmemory"));
int maxmemory=Integer.parseInt(request.getParameter("maxmemory"));
插入的语句如下:
insert into jobsubmission(account,passwd,jobname,arguments,jobtype,count,hostcount,ymd,hour,ymd1,hour,minmemory,maxmemory) Values('chh','780318','submit','x','1',"+count+","+hostcount+",'1978-03-18','9','2001-8-27','8',"+minmemory+","+maxmemory+");
可是网页提示有错,请问错误在哪呢?如果您不吝赐教,我全部分数都给你
|
少了'是什么意思呢?