Re: java.sql.SQLException: 1 >= 1

Поиск
Список
Период
Сортировка
Искать
От
Darin Ohashi
Тема
Re: java.sql.SQLException: 1 >= 1
Дата
Msg-id
F17255C2B596D3119A5600508B44FA6803BB2630@courier.maplesoft.on.ca
Список
Дерево обсуждения
Re: java.sql.SQLException: 1 >= 1 Darin Ohashi <DOhashi@maplesoft.com>

I just found the problem.  I had a call to ResultSet.next that moved the cursor
off the end of the table.  So I was trying to update the "afterlast" row.  The
error message kind of makes sense now, however I think a better error message
would be more helpful.  Something about "invalid row" would have definately
helped me find the problem sooner.

Darin

> 
> I am getting the following exception from ResultSet.updateRow().
> 
> java.sql.SQLException: 1 >= 1
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateRow(Abstract
> Jdbc2ResultSet.jav
> a:1082)
> 
> I was wondering if anyone knows what it means.  I have not 
> been able to
> reproduce this is a simple example, so I'll descriibe what my 
> code is doing.
> 
> I am running a coverage test for some code that I wrote that 
> sits on top of
> jdbc.  I create a table containing around 20 columns, one for 
> each of the basic
> jdbc data types.  I insert some data into the table, and then 
> SELECT all the
> columns (and rows) from the table.  I then update each of the 
> columns of the
> first row by calling the appropreate updateX( string, X ) 
> method followed
> immediately by an updateRow. 
> 
> It looks something like this:
> 
> rs.updateInt( "integerCol", 1 );
> rs.updateRow( );
> 
> rs.updateString( "stringCol", "fish" );
> rs.updateRow( );
> 
> 	.
> 	.	
> 	.
> 
> Once each column has been updated I getX( string ) each of 
> the columns to check
> the data has been changed.  All this works without a problem.
> 
> Next I try to update the row again, this time using the 
> updateX( int, X )
> methods.  The exception is raised on the UpdateRow after I 
> call updateX( int, X)
> the first time.
> 
> I'm not sure if this exception means that I am doing 
> something wrong or that
> there is a bug in the jdbc.
> 
> Any clues to the cause of this expection would be appreciated.
> 
> Thanks
> 
> Darin
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index 
> scan if your
>       joining column's datatypes do not match
> 
В списке pgsql-jdbc по дате отправления
От: Darin Ohashi
Дата:
Сообщение: java.sql.SQLException: 1 >= 1
От: Oliver Jowett
Дата:
FAQ