executeQuery

From: "Lufkin, Brad" <brad(dot)lufkin(at)ngc(dot)com>
To: 'postgres' <pgsql-jdbc(at)postgresql(dot)org>
Subject: executeQuery
Date: 2003-08-07 16:18:00
Message-ID: 0E253E40DC78F4499CEDDE9223099F430706B7BE@xcgva040.northgrum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I'm executing an SQL query using the following code:

Connection connection =
DriverManager.getConnection(url,user,password);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT * FROM
someTable");

This works except that the third statement doesn't return until the query is
complete. This contrasts with the behavior of other databases (such as
Informix) where the query returns immediately, thus allowing the result set
metadata to be analyzed before the result set is.
Is there any way to force the executeQuery to return immediately?
If not, is there some way to limit the results of the query to the first n
rows, where n is some reasonable number?

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-08-07 16:24:44 Re: SSL support in PG 7.4
Previous Message Barry Lind 2003-08-07 15:33:36 Re: more bad markup -- jdbc.sgml