数据库中数据为:
select * from t_accunt ;
amount 字段值是 138.550000
select amount from t_accunt ;
amount 字段值是 138.000000
amount 类型是 number(18,6) System.out.println(rs.getDouble("amount")); 138.0
System.out.println(rs.getBigDecimal("amount")); 138
System.out.println(rs.getFloat("amount")); 138.0
请问我怎么样才能取出 138.550000 来。
另,我想把取出的数据放到 excel 里面,
Document dom = new DocumentImpl();
Element root = dom.createElement("documents");
dom.appendChild(root);
AddItem ad = new AddItem();
while (rs.next())
{
Element row = dom.createElement("row");
root.appendChild(row);
row.setAttribute("count", "" + j++);
int jj = 1;
ad.addItem(dom, row, rs, 1, "N", "", jj++, "oracle");
}
最后excel得出数据为 138 我想让它显示 138.550000,我该怎么改?
select * from t_accunt ;
amount 字段值是 138.550000
select amount from t_accunt ;
amount 字段值是 138.000000
amount 类型是 number(18,6) System.out.println(rs.getDouble("amount")); 138.0
System.out.println(rs.getBigDecimal("amount")); 138
System.out.println(rs.getFloat("amount")); 138.0
请问我怎么样才能取出 138.550000 来。
另,我想把取出的数据放到 excel 里面,
Document dom = new DocumentImpl();
Element root = dom.createElement("documents");
dom.appendChild(root);
AddItem ad = new AddItem();
while (rs.next())
{
Element row = dom.createElement("row");
root.appendChild(row);
row.setAttribute("count", "" + j++);
int jj = 1;
ad.addItem(dom, row, rs, 1, "N", "", jj++, "oracle");
}
最后excel得出数据为 138 我想让它显示 138.550000,我该怎么改?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货