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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Robert 'Bobby' Zenz
  Branch: refs/heads/master
  Home:   https://github.com/pgjdbc/pgjdbc
  Commit: 5b9edb7dfb1b281bffedf7c9f2583f2df354c0ea
      https://github.com/pgjdbc/pgjdbc/commit/5b9edb7dfb1b281bffedf7c9f2583f2df354c0ea
  Author: Robert 'Bobby' Zenz <[hidden email]>
  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.



--
Sent via pgsql-jdbc mailing list ([hidden email])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Previous Thread Next Thread