Lists: | pgsql-bugs |
---|
From: | Daniele Arduini <darduini(at)cinetica(dot)it> |
---|---|
To: | pgsql-bugs(at)PostgreSQL(dot)org |
Subject: | PostgreSQL 7.1.3 - JDBC driver |
Date: | 2001-11-26 15:11:19 |
Message-ID: | 3C025B97.9090308@cinetica.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
Your name : Daniele Arduini
Your email address : darduini(at)cinetica(dot)it
System Configuration
---------------------
Architecture (example: Intel Pentium) : Any
Operating System (example: Linux 2.0.26 ELF) : Any
PostgreSQL version (example: PostgreSQL-7.1.3): PostgreSQL-7.1.3
Compiler used (example: gcc 2.95.2) :
Ant version 1.4 compiled on September 3 2001
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
Please enter a FULL description of your problem:
------------------------------------------------
Calling
org/postgresql/jdbc2/PreparedStatement.java:setBigDecimal(int parameterIndex, BigDecimal x)
with x == null a "java.lang.NullPointerException" is throw instead of setting the field
to NULL.
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
diff -urN jdbc.orig/org/postgresql/jdbc2/PreparedStatement.java
jdbc/org/postgresql/jdbc2/PreparedStatement.java
--- jdbc.orig/org/postgresql/jdbc2/PreparedStatement.java Fri Feb 16 17:45:00 2001
+++ jdbc/org/postgresql/jdbc2/PreparedStatement.java Tue Nov 20 12:16:53 2001
@@ -259,7 +259,11 @@
*/
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
{
+ if (x != null) {
set(parameterIndex, x.toString());
+ } else {
+ set(parameterIndex, "null");
+ }
}
/**
--
Ing. Daniele Arduini <darduini(at)cinetica(dot)it>
CINETICA - via III settembre, 11 - 47891 Dogana (San Marino)
TEL: (+39) 0549 970848 - FAX: (+39) 0549 970849
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Daniele Arduini <darduini(at)cinetica(dot)it> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: PostgreSQL 7.1.3 - JDBC driver |
Date: | 2001-11-26 18:25:57 |
Message-ID: | 200111261825.fAQIPv129596@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
This is corrected in current sources. See beta3 or snapshot for the new
code.
---------------------------------------------------------------------------
> Your name : Daniele Arduini
> Your email address : darduini(at)cinetica(dot)it
>
> System Configuration
> ---------------------
> Architecture (example: Intel Pentium) : Any
>
> Operating System (example: Linux 2.0.26 ELF) : Any
>
> PostgreSQL version (example: PostgreSQL-7.1.3): PostgreSQL-7.1.3
>
> Compiler used (example: gcc 2.95.2) :
>
> Ant version 1.4 compiled on September 3 2001
> java version "1.3.1_01"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
> Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
>
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> Calling
>
> org/postgresql/jdbc2/PreparedStatement.java:setBigDecimal(int parameterIndex, BigDecimal x)
>
> with x == null a "java.lang.NullPointerException" is throw instead of setting the field
> to NULL.
>
>
> Please describe a way to repeat the problem. Please try to provide a
> concise reproducible example, if at all possible:
> ----------------------------------------------------------------------
>
>
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
> diff -urN jdbc.orig/org/postgresql/jdbc2/PreparedStatement.java
> jdbc/org/postgresql/jdbc2/PreparedStatement.java
> --- jdbc.orig/org/postgresql/jdbc2/PreparedStatement.java Fri Feb 16 17:45:00 2001
> +++ jdbc/org/postgresql/jdbc2/PreparedStatement.java Tue Nov 20 12:16:53 2001
> @@ -259,7 +259,11 @@
> */
> public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException
> {
> + if (x != null) {
> set(parameterIndex, x.toString());
> + } else {
> + set(parameterIndex, "null");
> + }
> }
>
> /**
>
>
>
> --
> Ing. Daniele Arduini <darduini(at)cinetica(dot)it>
> CINETICA - via III settembre, 11 - 47891 Dogana (San Marino)
> TEL: (+39) 0549 970848 - FAX: (+39) 0549 970849
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026