db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: Can an embedded Derby connection support multiple simultaneous result sets?
Date Tue, 03 Feb 2009 07:58:28 GMT
John T. Dow wrote:
> On Mon, 02 Feb 2009 17:10:52 +0100, Knut Anders Hatlen wrote:
> 
>> "John T. Dow" <john@johntdow.com> writes:
>>

[ snip ]

> try {
>   Statement s1 = jdbcConn.createStatement(
> 	ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
>   Statement s2 = jdbcConn.createStatement(
> 	ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
> 
>   ResultSet rs1 = s1.executeQuery("select * from table1");
> 
>   while (rs1.next()) {
> 
>     rs1.getRow()     RETURNS CORRECT VALUES
> 
>     ResultSet rs2 = s2.executeQuery("select * from table2");
>     while (rs2.next()) {
> 
>       rs1.getRow()     RETURNS 0 FOR EVERY ROW
> 
>       rs2.getRow()     RETURNS CORRECT VALUES
> 
>     }
>   }
> } catch (SQLException ex) {
> }
> 
> I also did the following, with the same results.
> 
> Statement s1 = jdbcConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
> Statement s2 = jdbcConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

Hi John,

Derby doesn't support TYPE_SCROLL_SENSITIVE result sets (as of 10.4, I'm 
not aware of any work going on to support scrollable sensitive result sets).
If you ask for one, it will be downgraded to a TYPE_SCROLL_INSENSITIVE 
result set. If this happens, you should get a warning on the connection.


-- 
Kristian

[ snip ]

Mime
View raw message