Skip site navigation (1) Skip section navigation (2)


From: kgeis(at)speakeasy(dot)net
To: pgsql-jdbc(at)postgresql(dot)org
Subject: patch:
Date: 2005-10-25 08:18:13
Message-ID: W277193702285981130228293@webmail4 (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Here are a couple of problems I ran across in ResultSetTest.

The first section removes an assertion that is redundant and makes the (not necessarily true) assumption that the field was returned by the database in text format.  From the Javadoc on java.sql.ResultSet.getBytes(): "The bytes represent the raw values returned by the driver."

The second section has an unnecessarily complex query that caused me problems because pg_database contains a column of type aclitem[] which does not support binary transfer from the database.


RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/,v
retrieving revision 1.25
diff -u -r1.25
--- jdbc2/	11 Jan 2005 08:25:48 -0000	1.25
+++ jdbc2/	25 Oct 2005 08:09:13 -0000
@@ -170,14 +170,12 @@
         //it should apply only to binary and char/varchar columns;
         assertEquals("12345", rs.getString(1));
-        assertEquals("12345", new String(rs.getBytes(1)));
         //max should apply to the following since the column is
         //a varchar column
         rs = stmt.executeQuery("select * from teststring");;
         assertEquals("12", rs.getString(1));
-        assertEquals("12", new String(rs.getBytes(1)));
     public void booleanTests(boolean useServerPrepare) throws SQLException
@@ -485,7 +483,7 @@
         Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
         // Create a one row result set.
-        ResultSet rs = stmt.executeQuery("SELECT * FROM pg_database WHERE datname='template1'");
+        ResultSet rs = stmt.executeQuery("SELECT 1");


pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-10-25 08:43:45
Subject: Re: name "oid" is confusing
Previous:From: Ken GeisDate: 2005-10-25 08:08:00
Subject: name "oid" is confusing

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group