日期:2014-05-20 浏览次数:21008 次
public List excuteView(String sqlString) throws Exception{
List<Map> rsList = new ArrayList<Map>();
Map<String,Object> row;
try{
Connection con= Pool.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(sqlString);
ResultSetMetaData rsmd = rs.getMetaData();
int intColumnCount = rsmd.getColumnCount();
while(rs.next())
{
row = new HashMap<String,Object>(intColumnCount);
for(int i = 1; i<=intColumnCount;i++)
{
row.put(rsmd.getColumnName(i).toLowerCase(),rs.getObject(i));
}
rsList.add(row);
}
rs.close();
con.close();
}catch (Exception e) {
throw new Exception("查询不成功。" + e.getMessage());
}
return rsList;
}
select c.name as supp_name,a.order_code,a.yd_number*a.price as yd_money,a.number*a.price as sh_money from kc_cgsh_order_list as a,kc_cgsh_order as b,kc_supplier as c,all_materiel as d where a.order_code=b.code and b.supplier_code=c.code and a.materiel_code=d.code order by c.code