X-Original-To: pgsql-hackers@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1B1F6474E5C for ; Tue, 25 Mar 2003 08:02:11 -0500 (EST) Received: from mx1.verat.net (mx1.verat.net [217.26.64.139]) by postgresql.org (Postfix) with ESMTP id 349E9474E44 for ; Tue, 25 Mar 2003 08:02:09 -0500 (EST) Received: from ppp65-099.verat.net (ppp65-099.verat.net [217.26.65.99]) by mx1.verat.net (8.12.1/8.12.1) with ESMTP id h2PD20cM017399; Tue, 25 Mar 2003 14:02:10 +0100 From: snpe To: Neil Conway , PostgreSQL Hackers Subject: Re: updateable cursors & visibility Date: Tue, 25 Mar 2003 14:15:22 +0000 User-Agent: KMail/1.5 References: <1048542558.421.87.camel@tokyo> In-Reply-To: <1048542558.421.87.camel@tokyo> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303251415.22695.snpe@snpe.co.yu> X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/1058 X-Sequence-Number: 37304 Hello Neil, I try example for Oracle jdbc 1.4 driver This is sample and results. I hope that is helps. If you want yet another example, please tell me. regards Haris Peco /** * A simple sample to check the availability of scrollable result sets. * * Please use jdk1.2 or later version */ import java.sql.*; public class ResultSetmy1 { public static void main(String[] args) throws SQLException { // Load the Oracle JDBC driver DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); String url = "jdbc:oracle:thin:@spnew:1521:V9i"; try { String url1 = System.getProperty("JDBC_URL"); if (url1 != null) url = url1; } catch (Exception e) { // If there is any security exception, ignore it // and use the default } // Connect to the database // You can put a database name after the @ sign in the connection URL. Connection conn = DriverManager.getConnection (url, "scott", "tiger"); // Get the metadata regarding this connection's database DatabaseMetaData dbmd = conn.getMetaData(); // List all the possible result set types int resultset_types[] = { ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE }; // List all the possible result set concurrency types int concurrency_types[] = { ResultSet.CONCUR_READ_ONLY, ResultSet.CONCUR_UPDATABLE }; // List the result set type names String resultset_types_msg [] = { "Forward only", "Scroll insensitive", "Scroll sensitive" }; // List the concurrency type names String concurrency_types_msg[] = { "Read only", "Updatable" }; // Check the availability of the result type and concurrency type for (int i=0; i Folks, > > I'd like to implement updateable cursors. I'll be working on just > getting updateable cursors working for relatively simple SELECT queries > (e.g. no joins, aggregates, grouping, user-defined function calls, > etc.). BTW, I believe that's all the SQL spec requires, but I need to > double check that. I'm also planning on only implementing only > INSENSITIVE cursors, and not allowing holdable cursors. > > However, I'm a little unsure how tuple visibility should work with > updateable cursors. In particular: > > - if the user updates a row X in the cursor, then rewinds the cursor and > fetches X again, should they see the new X or the old X? > > - if the user updates a row X in the cursor, and then a query within the > cursor's transaction views X, should the query see new X or old X? > > Any comments? > > Neil > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster