wood burning stoves 2.0*
The moose likes JDBC and the fly likes Is there a jar library for Java and SQLite to manipulate with currency values (BigDecimal)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Is there a jar library for Java and SQLite to manipulate with currency values (BigDecimal)?" Watch "Is there a jar library for Java and SQLite to manipulate with currency values (BigDecimal)?" New topic
Author

Is there a jar library for Java and SQLite to manipulate with currency values (BigDecimal)?

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590
So far I found that SQLite doesn't support BigDecimal,
Is there a library to work around this?
I need a decimal point for currency with 2 trailing cents digits
Thanks
Jack
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41613
    
  55
Try this fork of the JDBC driver; it specifically adds some support for BigDecimal.


Ping & DNS - my free Android networking tools app
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590
Ulf Dittmer wrote:Try this fork of the JDBC driver; it specifically adds some support for BigDecimal.


Thanks, let me try it.
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590

Hello, just wonder what type of fields should be defined for currency values (string or integer)?
and BTW, should I use setBigDecimal or setString or setInt when interfacing with JDBC?

Edit
I know now, I should use VARCHAR, but when comparing amount using having,
say having sum(od.NetSales) > 50000.00
, od is order details, would there be any problems?
just unsure!
Thanks
Jack
 
Consider Paul's rocket mass heater.
 
subject: Is there a jar library for Java and SQLite to manipulate with currency values (BigDecimal)?