Binary files origbinary/org/postgresql/core/.QueryExecutor.java.swp and binary/org/postgresql/core/.QueryExecutor.java.swp differ Binary files origbinary/org/postgresql/jdbc2/.AbstractJdbc2ResultSet.java.swp and binary/org/postgresql/jdbc2/.AbstractJdbc2ResultSet.java.swp differ diff -rcN origbinary/org/postgresql/jdbc2/AbstractJdbc2Statement.java binary/org/postgresql/jdbc2/AbstractJdbc2Statement.java *** origbinary/org/postgresql/jdbc2/AbstractJdbc2Statement.java 2007-02-18 19:37:52.000000000 -0700 --- binary/org/postgresql/jdbc2/AbstractJdbc2Statement.java 2007-02-18 19:12:04.000000000 -0700 *************** *** 233,238 **** --- 233,248 ---- throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); + clearWarnings(); + PreparedStatement ps = connection.prepareStatement(p_sql, resultsettype, concurrency); + ps.setMaxFieldSize(getMaxFieldSize()); + ps.setFetchSize(getFetchSize()); + ps.setFetchDirection(getFetchDirection()); + ResultSet rs = ps.executeQuery(); + // ps.close(); + return rs; + + /* if (!executeWithFlags(p_sql, 0)) throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA); *************** *** 241,246 **** --- 251,257 ---- PSQLState.TOO_MANY_RESULTS); return (ResultSet)result.getResultSet(); + */ } /* *************** *** 451,456 **** --- 462,472 ---- if (concurrency != ResultSet.CONCUR_READ_ONLY) flags |= QueryExecutor.QUERY_NO_BINARY_TRANSFER; + + int flags2 = flags | QueryExecutor.QUERY_DESCRIBE_ONLY; + StatementResultHandler handler2 = new StatementResultHandler(); + connection.getQueryExecutor().execute(queryToExecute, queryParameters, handler2, 0, 0, flags2); + StatementResultHandler handler = new StatementResultHandler(); result = null; connection.getQueryExecutor().execute(queryToExecute, diff -rcN origbinary/org/postgresql/test/jdbc2/ConnectionTest.java binary/org/postgresql/test/jdbc2/ConnectionTest.java *** origbinary/org/postgresql/test/jdbc2/ConnectionTest.java 2005-11-23 19:31:43.000000000 -0700 --- binary/org/postgresql/test/jdbc2/ConnectionTest.java 2007-02-18 19:42:41.000000000 -0700 *************** *** 68,73 **** --- 68,74 ---- stat = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); assertNotNull(stat); stat.close(); + TestUtil.closeDB(conn); } /* *************** *** 88,93 **** --- 89,95 ---- stat = conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); assertNotNull(stat); stat.close(); + TestUtil.closeDB(conn); } /* diff -rcN origbinary/org/postgresql/test/jdbc2/ResultSetTest.java binary/org/postgresql/test/jdbc2/ResultSetTest.java *** origbinary/org/postgresql/test/jdbc2/ResultSetTest.java 2005-11-23 19:31:43.000000000 -0700 --- binary/org/postgresql/test/jdbc2/ResultSetTest.java 2007-02-18 19:39:39.000000000 -0700 *************** *** 170,183 **** //it should apply only to binary and char/varchar columns rs.next(); 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"); rs.next(); assertEquals("12", rs.getString(1)); ! assertEquals("12", new String(rs.getBytes(1))); } public void booleanTests(boolean useServerPrepare) throws SQLException --- 170,183 ---- //it should apply only to binary and char/varchar columns rs.next(); 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"); rs.next(); assertEquals("12", rs.getString(1)); ! // assertEquals("12", new String(rs.getBytes(1))); } public void booleanTests(boolean useServerPrepare) throws SQLException