Re: bug in AbstractJdbc1Statement.java (7.3)

Lists: pgsql-jdbc
From: Harald Krake <harald(at)krake(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: bug in AbstractJdbc1Statement.java (7.3)
Date: 2002-11-30 16:02:28
Message-ID: 200211301702.28624.harald@krake.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

in line 1937 should be:

private static final String PG_DOUBLE = "float8";

instead of ... = "double".

Otherwise QueryExecutor.execute() throws
java.sql.SQLException: ERROR: Type "double" does not exist

regards,
Harald.


From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Harald Krake <harald(at)krake(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug in AbstractJdbc1Statement.java (7.3)
Date: 2002-11-30 16:21:50
Message-ID: 3DE8E59E.5090805@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

The correct type name is DOUBLE PRECISION, not just DOUBLE, thus the
error message. It would be better to use the standard SQL names for the
types, so I suggest it is changed to:

private static final String PG_DOUBLE = "double precision";

Harald Krake wrote:
> in line 1937 should be:
>
> private static final String PG_DOUBLE = "float8";
>
> instead of ... = "double".
>
> Otherwise QueryExecutor.execute() throws
> java.sql.SQLException: ERROR: Type "double" does not exist
>
> regards,
> Harald.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9


From: Kris Jurka <books(at)ejurka(dot)com>
To: Harald Krake <harald(at)krake(dot)de>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: bug in AbstractJdbc1Statement.java (7.3)
Date: 2003-02-03 19:18:23
Message-ID: Pine.LNX.4.33.0302031416490.27245-300000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

This problem is still present in the driver. I have attached a test case
and a patch.

Kris Jurka

On Sat, 30 Nov 2002, Harald Krake wrote:

> in line 1937 should be:
>
> private static final String PG_DOUBLE = "float8";
>
> instead of ... = "double".
>
> Otherwise QueryExecutor.execute() throws
> java.sql.SQLException: ERROR: Type "double" does not exist
>
> regards,
> Harald.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

Attachment Content-Type Size
ServerPreparedDouble.java text/plain 560 bytes
serverprepareddouble.patch text/plain 1.3 KB

From: Barry Lind <blind(at)xythos(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Harald Krake <harald(at)krake(dot)de>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: bug in AbstractJdbc1Statement.java (7.3)
Date: 2003-02-04 10:10:13
Message-ID: 3E3F9185.8020207@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Patch applied to CVS head.

thanks,
--Barry

Kris Jurka wrote:
>
> This problem is still present in the driver. I have attached a test case
> and a patch.
>
> Kris Jurka
>
>
> On Sat, 30 Nov 2002, Harald Krake wrote:
>
>
>>in line 1937 should be:
>>
>>private static final String PG_DOUBLE = "float8";
>>
>>instead of ... = "double".
>>
>>Otherwise QueryExecutor.execute() throws
>>java.sql.SQLException: ERROR: Type "double" does not exist
>>
>>regards,
>>Harald.
>>
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 6: Have you searched our list archives?
>>
>>http://archives.postgresql.org
>>
>>
>>
>>------------------------------------------------------------------------
>>
>>import java.sql.*;
>>
>>public class ServerPreparedDouble {
>>
>> //create table doubletable (x double precision);
>>
>>
>> public static void main(String args[]) throws Exception {
>> Class.forName("org.postgresql.Driver");
>> Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/jurka","jurka","");
>> PreparedStatement pstmt = conn.prepareStatement("INSERT INTO doubletable (x) VALUES (?) ");
>> ((org.postgresql.jdbc1.AbstractJdbc1Statement)pstmt).setUseServerPrepare(true);
>> pstmt.setDouble(1,2.0);
>> pstmt.executeUpdate();
>> }
>>}
>>
>>
>>------------------------------------------------------------------------
>>
>>Index: src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
>>===================================================================
>>RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v
>>retrieving revision 1.14
>>diff -c -r1.14 AbstractJdbc1Statement.java
>>*** src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java 2002/11/20 07:34:32 1.14
>>--- src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java 2003/02/03 19:07:40
>>***************
>>*** 1934,1940 ****
>> private static final String PG_INT8 = "int8";
>> private static final String PG_NUMERIC = "numeric";
>> private static final String PG_FLOAT = "float";
>>! private static final String PG_DOUBLE = "double";
>> private static final String PG_BOOLEAN = "boolean";
>> private static final String PG_DATE = "date";
>> private static final String PG_TIME = "time";
>>--- 1937,1943 ----
>> private static final String PG_INT8 = "int8";
>> private static final String PG_NUMERIC = "numeric";
>> private static final String PG_FLOAT = "float";
>>! private static final String PG_DOUBLE = "double precision";
>> private static final String PG_BOOLEAN = "boolean";
>> private static final String PG_DATE = "date";
>> private static final String PG_TIME = "time";
>>
>>
>>------------------------------------------------------------------------
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 4: Don't 'kill -9' the postmaster