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 |
Thread: | |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Barry Lind | 2003-02-04 10:10:42 | Re: DatabaseMetaData oddities |
Previous Message | Didrik Pinte | 2003-02-04 09:27:11 | Re: Connection pooling problems |