日期:2014-05-19  浏览次数:20565 次

求指教 这个方法是错在哪里?
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+"') ";