postgresql-jdbc.git / summary / log / commit / refs
commit d69bb57a2de74f7af2bdd4645ee09b2c4badee73
Author: Kingter Wang <tew@vmware.com>
Date: Fri Dec 05 02:54:02 2014 +0000
Fix again the test code of testUpdateWithPGobject
Fix the ResultSet cannot be updated by initialize statement with
flag "CONCUR_UPDATABLE"
Set primary key for test table "testpgobject" to resolve
"No primary key" issue when trying to update the table
org/postgresql/test/jdbc2/ResultSetTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/org/postgresql/test/jdbc2/ResultSetTest.java b/org/postgresql/test/jdbc2/ResultSetTest.java
index ba42a199..72f3a3f3 100644
--- a/org/postgresql/test/jdbc2/ResultSetTest.java
+++ b/org/postgresql/test/jdbc2/ResultSetTest.java
@@ -94,7 +94,7 @@ public class ResultSetTest extends TestCase
stmt.executeUpdate("INSERT INTO testnumeric VALUES('9223372036854775808')");
stmt.executeUpdate("INSERT INTO testnumeric VALUES('-9223372036854775809')");
- TestUtil.createTable(con, "testpgobject", "id integer, d date");
+ TestUtil.createTable(con, "testpgobject", "id integer NOT NULL, d date, PRIMARY KEY (id)");
stmt.execute("INSERT INTO testpgobject VALUES(1, '2010-11-3')");
stmt.close();
@@ -731,7 +731,8 @@ public class ResultSetTest extends TestCase
public void testUpdateWithPGobject() throws SQLException
{
- Statement stmt = con.createStatement();
+ Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+ ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("select * from testpgobject where id = 1");
assertTrue(rs.next());
[parent: 0b6e9207d57c]