java怎么返回number类型,具体代码如下
package com.amarsoft.app.lending.bizlets;
import com.amarsoft.are.sql.ASResultSet;
import com.amarsoft.are.util.DataConvert;
import com.amarsoft.are.sql.Transaction;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.biz.bizlet.Bizlet;
public class GetQuotiety extends Bizlet
{
public Object run(Transaction Sqlca) throws Exception
{
String sSerialNo = (String)this.getAttribute("SerialNo");
String sItemNo = (String)this.getAttribute("ItemNo");
String sSql = "",sQUOTIETY="";
int iItemValue=0;
double dQUOTIETY=0.0;
ASResultSet rs = null;
sSql = "select ItemValue from EVALUATE_DATA where SerialNo='"+sSerialNo+"' and ItemNo='"+sItemNo+"' ";
rs = Sqlca.getASResultSet(sSql);
if(rs.next())
iItemValue = DataConvert.toInt(rs.getString(1));
rs.getStatement().close();
sSql = "select QUOTIETY from QUOTIETY_TABLE where NORMRATIO='"+iItemValue+"' ";
rs = Sqlca.getASResultSet(sSql);
if(rs.next())
dQUOTIETY = DataConvert.toDouble(rs.getString("QUOTIETY"));
rs.getStatement().close();
//System.out.println("**********************************8"+dQUOTIETY);
return dQUOTIETY;
}
}
程序这样写 有问题 cannot convert from double to object
我要怎么修改呢???
------解决方案--------------------
return new Double(dQUOTIETY);