import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; /* To run this example run the following sql: CREATE TABLE testmoney ( id serial, cost money NOT NULL ); INSERT INTO testmoney (id, cost) VALUES (1, '$999.00'); INSERT INTO testmoney (id, cost) VALUES (2, '$1,000.00'); INSERT INTO testmoney (id, cost) VALUES (3, '$10,000.01'); and then fix the connection paramters */ public class PgMoneyIssue { public static void main(String[] args) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost/postgis", "username", "password"); Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select * from testmoney"); while(rs.next()) { System.out.println(rs.getObject(1)); System.out.println(rs.getObject(2)); // kaboom on the second record! } } }