Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个十进制(10,2)值的数据库。
我需要从数据库中提取它并用java添加一个数量,但我不明白。
从数据库查询,值为5.50
System.out.println(rsMax.getLong(1)); Long cost = rsMax.getLong(1) + 2;
这将打印 5 和 cost = 7,它应该打印 5.50 和 cost = 7.50
我该怎么做?
Long是一个整数。你需要BigDecimal类型。
Long
BigDecimal