[JDBC] [pgjdbc/pgjdbc] 5b9edb: fix: Add fallback to setObject(int, Object)for Nu... - Mailing list pgsql-jdbc

From Robert 'Bobby' Zenz
Subject [JDBC] [pgjdbc/pgjdbc] 5b9edb: fix: Add fallback to setObject(int, Object)for Nu...
Date
Msg-id 591f0b75b20a7_6b13fe0b4c09c3c17056e@hookshot-fe2-cp1-prd.iad.github.net.mail
Whole thread Raw
List 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.Zenz@bonsaimind.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.



pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: [JDBC] Postgres 10 partitioned tables
Next
From: Dave Cramer
Date:
Subject: [JDBC] this is a problem for jdk9