sql查询与存储在变量

时间:2017-05-07 12:41:50

标签: java mysql sql

我在执行此sql查询时遇到问题。变量combo_sel似乎不会在sql查询中被替换。

你能帮我找到错误吗?

String combo_sel = String.valueOf(station_type.getSelectedItem());
sql="Select reporting_date as REPORTING_DATE,for_date as FOR_DATE,outage_date as OUTAGE_DATE,outage_time as OUTAGE_TIME,stat_detail as STATION_DETAILS,res_date as RESTORATION_DATE,rest_time as RESTORATION_TIME,rest_reason as RESTORATION_REASON from " + table_sel+" where for_date='" + date1 + "' and stat_detail ="+ combo_sel ;

0 个答案:

没有答案