org.springframework.jdbc.UncategorizedSQLException异常其中的一种情况

异常:

org.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'     a.vehicle_type = ? 
      wher', expect IDENTIFIER, actual IDENTIFIER pos 299, line 11, column 11, token IDENTIFIER a : update cims_charge_rule a
       SET a.init_price = ?,
        a.init_mileage = ?,
        a.time_price = ?,
        a.mileage_price = ?,
        a.long_distance_price = ?,
        a.long_distance_mileage = ?,
        a.out_town_price = ?,
        a.order_type = ?,
        a.immediacy = ?
        a.vehicle_type = ? 
      where
      a.id = ?

Caused by: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'     a.vehicle_type = ? 
      wher', expect IDENTIFIER, actual IDENTIFIER pos 299, line 11, column 11, token IDENTIFIER a : update cims_charge_rule a
       SET a.init_price = ?,
        a.init_mileage = ?,
        a.time_price = ?,
        a.mileage_price = ?,
        a.long_distance_price = ?,
        a.long_distance_mileage = ?,
        a.out_town_price = ?,
        a.order_type = ?,
        a.immediacy = ?
        a.vehicle_type = ? 
      where
      a.id = ?

Caused by: com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'     a.vehicle_type = ? 
      wher', expect IDENTIFIER, actual IDENTIFIER pos 299, line 11, column 11, token IDENTIFIER a

经过检查发现


  update cims_charge_rule a
    
      a.init_price = #{initPrice},
      a.init_mileage = #{initMileage},
      a.time_price = #{timePrice},
      a.mileage_price = #{mileagePrice},
      a.long_distance_price = #{longDistancePrice},
      a.long_distance_mileage = #{longDistanceMileage},
      a.out_town_price = #{outTownPrice},
      a.order_type = #{orderType},
      a.immediacy = #{immediacy,}
      a.vehicle_type = #{vehicleType}
    
    where
    a.id = #{id}

 

 

你可能感兴趣的:(org.springframework.jdbc.UncategorizedSQLException异常其中的一种情况)