Thread: Is postgresql 8.xx jdbc support SCROLL_SENSITIVE?

Is postgresql 8.xx jdbc support SCROLL_SENSITIVE?

From
Hengki Suhartoyo
Date:
Hi, all

I have problem with my jdbc program, my java program
can't use TYPE_SCROLL_SENSITIVE.
But I need Sensitive scrollable result.

Can anybody help me?


this is my java test program,

/*
 * testRS.java
 *
 * Created on May 16, 2005, 9:48 PM
 */

import java.sql.*;
public class testRS {

    public testRS() {
    }

    public static void main(String[] args) {
        String url =
"jdbc:postgresql://localhost/testDB";
        try{
            Class.forName("org.postgresql.Driver");


            Connection conn =
DriverManager.getConnection(url,"user","xxxxxx");



System.out.println(conn.getMetaData().getDriverName());

System.out.println(conn.getMetaData().getDriverVersion());

            if
(conn.getMetaData().supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE))
{
                System.out.println("Insensitive
scrollable result sets are supported");
            }
            if
(conn.getMetaData().supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE))
{
                System.out.println("Sensitive
scrollable result sets are supported");
            }

        } catch(SQLException e) {

System.err.println("-----SQLException-----");
            System.err.println("SQLState:  " +
e.getSQLState());
            System.err.println("Message:  " + e.getMessage());
            System.err.println("Vendor:  " + e.getErrorCode());

        } catch(ClassNotFoundException ce) {

System.out.println(ce.getMessage());
        }

    }

}


And the result always like this:

PostgreSQL Native Driver
PostgreSQL 8.1devel JDBC3 with SSL (build 400)
Insensitive scrollable result sets are supported


Thank You



__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

Re: Is postgresql 8.xx jdbc support SCROLL_SENSITIVE?

From
Kris Jurka
Date:

On Wed, 18 May 2005, Hengki Suhartoyo wrote:

> I have problem with my jdbc program, I need Sensitive scrollable result.
>

Postgresql only supports insensitive cursors and ResultSets.  Your only
option is to reissue the query to pick up any changes.

Kris Jurka