Bigdecimal, postrgesql

Posted on 2012-09-18
Last Modified: 2012-10-05

I'm currently developing a JAVA application that needs to calculate financial data, so I'm using BigDecimals to avoid inaccurate calculations.

How should I store these Bigdecimals in a postgresql db? which datatype should I use?

Regards Kristof
Question by:kristof1104
    LVL 86

    Accepted Solution

    The easiest way would probably be to use BigDecimal's own natural mapping to String and store it as a character type
    LVL 2

    Author Closing Comment

    Thanks, I went with postgres's Number field, that way you can still use the field as a number in query's
    LVL 86

    Expert Comment


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now