bug in AbstractJdbc1Statement.java (7.3)

Поиск
Список
Период
Сортировка
Искать

bug in AbstractJdbc1Statement.java (7.3)

От:
Harald Krake <harald@krake.de>
Дата:
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.


Re: bug in AbstractJdbc1Statement.java (7.3)

От:
Fernando Nasser <fnasser@redhat.com>
Дата:
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@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Re: bug in AbstractJdbc1Statement.java (7.3)

От:
Kris Jurka <books@ejurka.com>
Дата:
Вложения:


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
>

Re: bug in AbstractJdbc1Statement.java (7.3)

От:
Barry Lind <blind@xythos.com>
Дата:
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


FAQ