strsql="update class_1 set class_1_name='"+class_1_name+"',class_1_regtime='"+strNow+"' where id='"+id+"'";
sqlData.execute(strsql);
不能得到结果,我想将ID转换成整型的,怎么作,
其中ID在数据库中为整型标识,我用Integer(id)转换却不行
7 个解决方案
#1
int ID = integer.parseInt(request.getParameter("id"));
#2
int ID = Integer.parseInt(request.getParameter("id"));
#3
搜一下类型转换的帖子,很多的
#4
int ID = Integer.parseInt(request.getParameter("id"));
#5
最好先判断 request.getParameter("id") 是否为null
#6
int ID = integer.parseInt(request.getParameter("id"));
#7
String strID = request.getParameter("id");
int id = strID == null ? 0 : Integer.parseInt( strID );
int id = strID == null ? 0 : Integer.parseInt( strID );
#1
int ID = integer.parseInt(request.getParameter("id"));
#2
int ID = Integer.parseInt(request.getParameter("id"));
#3
搜一下类型转换的帖子,很多的
#4
int ID = Integer.parseInt(request.getParameter("id"));
#5
最好先判断 request.getParameter("id") 是否为null
#6
int ID = integer.parseInt(request.getParameter("id"));
#7
String strID = request.getParameter("id");
int id = strID == null ? 0 : Integer.parseInt( strID );
int id = strID == null ? 0 : Integer.parseInt( strID );