pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
To: pgsql-jdbc@postgresql.org
Subject: Binary transfer support [5/7] - more tests
Date: Fri, 16 Sep 2011 16:14:31 +0300
Message-ID: <4E734BB7.9000908@nitorcreations.com> (raw)



Attachments:

more-tests.patch (text/plain, 1.6K) download Index: pgjdbc.tmp3/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java =================================================================== --- pgjdbc.tmp3.orig/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java +++ pgjdbc.tmp3/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java @@ -53,6 +53,19 @@ public class ServerPreparedStmtTest exte TestUtil.closeDB(con); } + public void testEmptyResults() throws Exception + { + PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = ?"); + ((PGStatement)pstmt).setUseServerPrepare(true); + for (int i=0; i<10; ++i) { + pstmt.setInt(1, -1); + ResultSet rs = pstmt.executeQuery(); + assertFalse(rs.next()); + rs.close(); + } + pstmt.close(); + } + public void testPreparedExecuteCount() throws Exception { PreparedStatement pstmt = con.prepareStatement("UPDATE testsps SET id = id + 44"); Index: pgjdbc.tmp3/org/postgresql/test/jdbc2/StatementTest.java =================================================================== --- pgjdbc.tmp3.orig/org/postgresql/test/jdbc2/StatementTest.java +++ pgjdbc.tmp3/org/postgresql/test/jdbc2/StatementTest.java @@ -478,4 +478,14 @@ public class StatementTest extends TestC } catch (SQLException sqle) { } } + public void testResultSetTwice() throws SQLException + { + Statement stmt = con.createStatement(); + + ResultSet rs = stmt.executeQuery("select {fn abs(-2.3)} as abs "); + assertNotNull(rs); + + ResultSet rsOther = stmt.getResultSet(); + assertNotNull(rsOther); + } }

Message-ID: <4E734BB7.9000908@nitorcreations.com>
Permalink:  ../4E734BB7.9000908@nitorcreations.com/
Also on:    postgresql.org/message-id/4E734BB7.9000908@nitorcreations.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mikko.tiihonen@nitorcreations.com
  Subject: Re: Binary transfer support [5/7] - more tests
  In-Reply-To: <4E734BB7.9000908@nitorcreations.com>
  References: <4E734BB7.9000908@nitorcreations.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox