Monthly Archives: February 2010

Locking a row, portable between databases, with JDBC

A couple of years ago I was with a project designing a system to manage Investor Meetings. An Investor must have a valid Pass in order to join a Meeting. Each Pass has a unique serial number. It was a … Continue reading

Posted in Databases, Java | Tagged , , , , , | 1 Comment

Squareroot (sqrt) with BigDecimal

Recently I was refactoring some code from using double to using BigDecimal and suddenly needed a square root method. I remembered years ago I was taught a simple “successive approximation” method; believe it was grammar school. I searched the net … Continue reading

Posted in Java | Tagged , | 2 Comments

Implementing a simple database semaphore

In this article I will describe a simple technique that enables you to implement an “exclusive lock” in a distributed, even clustered, environment. The technique works with all major databases, and should work with any database that has a reasonable … Continue reading

Posted in Databases, Java | Tagged , , , , , , , , | 11 Comments

Financial (monetary) computations using floating point arithmetic [in JAVA]

In this article, I will discuss some of the issues in doing financial calculations in JAVA. The issues are not related to JAVA only, but to any calculation done in a “computer language” using binary floating point arithmetic, including calculations … Continue reading

Posted in Java | Tagged , | Leave a comment