首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java相关 >

java如何返回number类型,具体代码如下

2012-06-12 
java怎么返回number类型,具体代码如下package com.amarsoft.app.lending.bizletsimport com.amarsoft.are

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);

热点排行