|
SQL都是对的,不知道为什么?
public static JSONObject getitem(JSONObject params, ActionContext context) throws SQLException, NamingException, java.sql.SQLException {
String para = params.getString("para");
List<Object> sqlParams = new ArrayList<Object>();
sqlParams.add(para);
Table table = null;
Connection conn = context.getConnection(DATASOURCE_TAKEOUT);
String sql = "";
try{
if(para != null){
sql = "SELECT CODE,NAME,SIZE FROM T_BD_ITEM WHERE CODE LIKE ? ";
table = DataUtils.queryData(conn, sql, sqlParams, null, null, null);
}else{
sql = "SELECT CODE,NAME,SIZE FROM T_BD_ITEM ";
table = DataUtils.queryData(conn, sql, sqlParams, null, null, null);
}
return Transform.tableToJson(table);
} finally {
conn.close();
}
|
|