Skip to main content

Numbers

The Java and database vendors offer different numeric implementations. The JDBC driver should make the transition without any data loss.

However, there are types where this is not necessarily possible. Float or double floating point numbers cannot hold precise values. Mathematical operations on these numbers will yield different results based on the operation order. A good practice is to summarize the small numbers then add the bigger ones.

Another common mistake is when using globalMap. You need to use the Class instead of the primitive.

  • int > Integer
  • double > Double

When converting a String to a number, you could use the following:

  • Integer.valueOf / Integer.parseInt
  • Double.valueOf / Double.parseDouble

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!