2018-08-28 12:09:07 +08:00

36 lines
1.1 KiB
Java

package com.tenwa.apzl.comm;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.dict.als.cache.CacheLoaderFactory;
public class GetBidPrice {
public static String getBidPrice(String framenumber) throws JBOException
{
String bidPrice="";
Transaction Sqlca =null;
try {
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
String sql="SELECT MAX(bid_price) AS bid_price FROM LC_CAR_BID WHERE frame_number=:frame_number ";
SqlObject asql = new SqlObject(sql);
asql.setParameter("frame_number", framenumber);
ASResultSet rs = null;
rs = Sqlca.getASResultSet(asql);
if(rs.next()){
bidPrice=rs.getStringValue("bid_price");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
if(Sqlca!=null){
Sqlca.disConnect();
Sqlca = null;
}
}
return bidPrice;
}
}