首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

求指教 这个方法是错在哪里?该怎么解决

2012-05-24 
求指教 这个方法是错在哪里?Java codepublic static boolean InsertAuditEvent(HttpServletRequest reques

求指教 这个方法是错在哪里?

Java code
public static boolean InsertAuditEvent(HttpServletRequest request){        boolean b = false;        String checkout_style_id = StringUtil.getRequestString(request, "way");            String bank_name = StringUtil.getRequestString(request, "bankname");                            String account = StringUtil.getRequestString(request, "banknumber");                                String account_uesrname = StringUtil.getRequestString(request, "holder");              //String developer_id = StringUtil.getRequestString(request, "developer_id");               String developer_type = StringUtil.getRequestString(request, "usertype");                String APPLY_PRICE = StringUtil.getRequestString(request, "withdraw");                      String sql="Insert into withdraw (checkout_style_id, bank_name, account,account_name,syadate,developer_type,apply_price,draw_type) values ("+checkout_style_id+", "+bank_name+","+account+","+account_name+","+developer_id+","+syadate+","+developer_type+","+apply_price+","+draw_type+")  ";        b= DataBaseOperator.insertOrUpdateData(sql);        return b;          }

SQL code
报错内容为:String sql="Insert into withdraw (checkout_style_id, bank_name, account,account_name,syadate,developer_type,apply_price,draw_type) values ("+checkout_style_id+", "+bank_name+","+account+","+account_name+","+developer_id+","+syadate+","+developer_type+","+apply_price+","+draw_type+")  ";


[解决办法]
这哪是报错内容啊,是报错的地方啊,你把控制台的报错信息发出来嘛
是不是运行时候才报错啊 ?
如果是的话,估计是一些字符串类型的字段,没有加上'' ;
[解决办法]
String sql="Insert into withdraw (checkout_style_id, bank_name, account,account_name,syadate,developer_type,apply_price,draw_type) values ('"+checkout_style_id+"', '"+bank_name+","+account+"','"+account_name+"','"+developer_id+"','"+syadate+"','"+developer_type+"','"+apply_price+"','"+draw_type+"') ";
[解决办法]
String sql="Insert into withdraw (checkout_style_id, bank_name, account,account_name,syadate,developer_type,apply_price,draw_type) values ('"+checkout_style_id+"', '"+bank_name+"',"+account+",'"+account_name+"',"+developer_id+",'"+syadate+"','"+developer_type+"','"+apply_price+"','"+draw_type+"') ";

热点排行