Re: bug in AbstractJdbc1Statement.java (7.3) - Mailing list pgsql-jdbc
From | Barry Lind |
---|---|
Subject | Re: bug in AbstractJdbc1Statement.java (7.3) |
Date | |
Msg-id | 3E3F9185.8020207@xythos.com Whole thread Raw |
In response to | Re: bug in AbstractJdbc1Statement.java (7.3) (Kris Jurka <books@ejurka.com>) |
List | 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
pgsql-jdbc by date: