[pgjdbc/pgjdbc] 5b9edb: fix: Add fallback to setObject(int, Object) for Nu...

From: Robert 'Bobby' Zenz <Robert(dot)Zenz(at)bonsaimind(dot)org>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] 5b9edb: fix: Add fallback to setObject(int, Object) for Nu...
Date: 2017-05-19 15:12:53
Message-ID: 591f0b75b20a7_6b13fe0b4c09c3c17056e@hookshot-fe2-cp1-prd.iad.github.net.mail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: 5b9edb7dfb1b281bffedf7c9f2583f2df354c0ea
https://github.com/pgjdbc/pgjdbc/commit/5b9edb7dfb1b281bffedf7c9f2583f2df354c0ea
Author: Robert 'Bobby' Zenz <Robert(dot)Zenz(at)bonsaimind(dot)org>
Date: 2017-05-19 (Fri, 19 May 2017)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java
M pgjdbc/src/test/java/org/postgresql/test/jdbc2/PreparedStatementTest.java

Log Message:
-----------
fix: Add fallback to setObject(int, Object) for Number (#812)

Add a fallback to the PgPreparedStatement.setObject(int, Object) method
which handles Number types. This allows support for BigInteger and
similar types (f.e. AtomicLong) which are not explicitly mentioned by
JDBC.

This fallback operates by invoking toString() on the Number, which is
the same method used by setBigDecimal(int, BigDecimal). Also,
setBigDecimal(int, BigDecimal) does now invoke setNumber(int, Number)
because they work the same way.

The tracking bug is #810.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2017-05-19 17:39:57 this is a problem for jdk9
Previous Message Dave Cramer 2017-05-18 17:02:04 Re: Postgres 10 partitioned tables