Thread: Updateable ResultSet

Updateable ResultSet

From
"Merilinna, Juhani"
Date:
Hi
 
I use the same Postgresql and JDBC versions and get the same error message.
But, if I once call updateRow, then moveToInsertRow works without errors.
 
Juhani Merilinna
juhani.merilinna.adulta.fi
 
 
>I used postgresql 7.21 version on Redhat 7.1 system,
>got same error. I used JDBC development version.
 
>ERROR:   Got exception: Result Set not updateable. The
>query that gene
>rated this result set must select only one table, and
>must select all primary ke
>ys from that table. See the JDBC 2.1 API
>Specification, section 5.6 for more details.
 
>But I only select one table, and I select all columns
>include primary key.
 
>How can I get "Updateable ResultSet" works?
 
>Thanks!
 
>Zengfa
 
--- Dave Cramer <Dave@micro-automation.net> wrote:
> It's possible it doesn't work with a 7.0 database.
> Why are you using
> such an old version?
> 
> Dave
> On Thu, 2002-08-15 at 14:21, Zengfa Gao wrote:
> > Hi, all:
> > 
> > >From JDBC website, I got
> > 
> > Latest Java/JDBC news 
> > Jun 23   Updated dev drivers that include callable
> > statement support and updatable result set support
> 
> >  
> > Then I downloaded 7.3Dev version of JDBC driver
> and
> > try to use updatable result set. 
> > 
> > When I run
> > 
> > ResultSet rs = stmt.executeQuery(selectStat);
> > 
> > rs.moveToInsertRow();
> > 
> > I got:
> > 
> > 
> >           ERROR:   Got exception: Result Set not
> > updateable. The query that gene
> > rated this result set must select only one table,
> and
> > must select all primary ke
> > ys from that table. See the JDBC 2.1 API
> > Specification, section 5.6 for more det
> > ails.   
> > 
> > 
> > But I only select from one table, and I select all
> > columns from that table include primary key. Does
> > anyone know why it failed at here?
> > 
> > I used PostgreSQL 7.0.3 on Redhat system.
> > 
> > Thanks,
> > 
> > Zengfa
> > 

 

###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/

Re: Updateable ResultSet

From
Dave Cramer
Date:
Yes, I have a patch for this, and just have to get around to applying
it.

Dave
On Fri, 2002-08-23 at 03:00, Merilinna, Juhani wrote:
> Hi
>
> I use the same Postgresql and JDBC versions and get the same error message.
> But, if I once call updateRow, then moveToInsertRow works without errors.
>
> Juhani Merilinna
> juhani.merilinna.adulta.fi
>
>
> >I used postgresql 7.21 version on Redhat 7.1 system,
> >got same error. I used JDBC development version.
>
> >ERROR:   Got exception: Result Set not updateable. The
> >query that gene
> >rated this result set must select only one table, and
> >must select all primary ke
> >ys from that table. See the JDBC 2.1 API
> >Specification, section 5.6 for more details.
>
> >But I only select one table, and I select all columns
> >include primary key.
>
> >How can I get "Updateable ResultSet" works?
>
> >Thanks!
>
> >Zengfa
>
> --- Dave Cramer <Dave@micro-automation.net> wrote:
> > It's possible it doesn't work with a 7.0 database.
> > Why are you using
> > such an old version?
> >
> > Dave
> > On Thu, 2002-08-15 at 14:21, Zengfa Gao wrote:
> > > Hi, all:
> > >
> > > >From JDBC website, I got
> > >
> > > Latest Java/JDBC news
> > > Jun 23   Updated dev drivers that include callable
> > > statement support and updatable result set support
> >
> > >
> > > Then I downloaded 7.3Dev version of JDBC driver
> > and
> > > try to use updatable result set.
> > >
> > > When I run
> > >
> > > ResultSet rs = stmt.executeQuery(selectStat);
> > >
> > > rs.moveToInsertRow();
> > >
> > > I got:
> > >
> > >
> > >           ERROR:   Got exception: Result Set not
> > > updateable. The query that gene
> > > rated this result set must select only one table,
> > and
> > > must select all primary ke
> > > ys from that table. See the JDBC 2.1 API
> > > Specification, section 5.6 for more det
> > > ails.
> > >
> > >
> > > But I only select from one table, and I select all
> > > columns from that table include primary key. Does
> > > anyone know why it failed at here?
> > >
> > > I used PostgreSQL 7.0.3 on Redhat system.
> > >
> > > Thanks,
> > >
> > > Zengfa
> > >
>
> ###########################################
>
> This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
> For more information, connect to http://www.F-Secure.com/




Re: Updateable ResultSet

From
Zengfa Gao
Date:
Thanks, Dave and Juhani.

I put resultset.updateRow() before
resultset.moveToInsertRow(), everything works fine
now.

I only have two resultset.moveToInsertRow() lines, so
it's easy for me. When I get the patch, I can just
remove these two resultset.updateRow() lines.

Zengfa

--- Dave Cramer <Dave@micro-automation.net> wrote:
> Yes, I have a patch for this, and just have to get
> around to applying
> it.
>
> Dave
> On Fri, 2002-08-23 at 03:00, Merilinna, Juhani
> wrote:
> > Hi
> >
> > I use the same Postgresql and JDBC versions and
> get the same error message.
> > But, if I once call updateRow, then
> moveToInsertRow works without errors.
> >
> > Juhani Merilinna
> > juhani.merilinna.adulta.fi
> >
> >
> > >I used postgresql 7.21 version on Redhat 7.1
> system,
> > >got same error. I used JDBC development version.
> >
> > >ERROR:   Got exception: Result Set not
> updateable. The
> > >query that gene
> > >rated this result set must select only one table,
> and
> > >must select all primary ke
> > >ys from that table. See the JDBC 2.1 API
> > >Specification, section 5.6 for more details.
> >
> > >But I only select one table, and I select all
> columns
> > >include primary key.
> >
> > >How can I get "Updateable ResultSet" works?
> >
> > >Thanks!
> >
> > >Zengfa
> >
> > --- Dave Cramer <Dave@micro-automation.net> wrote:
> > > It's possible it doesn't work with a 7.0
> database.
> > > Why are you using
> > > such an old version?
> > >
> > > Dave
> > > On Thu, 2002-08-15 at 14:21, Zengfa Gao wrote:
> > > > Hi, all:
> > > >
> > > > >From JDBC website, I got
> > > >
> > > > Latest Java/JDBC news
> > > > Jun 23   Updated dev drivers that include
> callable
> > > > statement support and updatable result set
> support
> > >
> > > >
> > > > Then I downloaded 7.3Dev version of JDBC
> driver
> > > and
> > > > try to use updatable result set.
> > > >
> > > > When I run
> > > >
> > > > ResultSet rs = stmt.executeQuery(selectStat);
> > > >
> > > > rs.moveToInsertRow();
> > > >
> > > > I got:
> > > >
> > > >
> > > >           ERROR:   Got exception: Result Set
> not
> > > > updateable. The query that gene
> > > > rated this result set must select only one
> table,
> > > and
> > > > must select all primary ke
> > > > ys from that table. See the JDBC 2.1 API
> > > > Specification, section 5.6 for more det
> > > > ails.
> > > >
> > > >
> > > > But I only select from one table, and I select
> all
> > > > columns from that table include primary key.
> Does
> > > > anyone know why it failed at here?
> > > >
> > > > I used PostgreSQL 7.0.3 on Redhat system.
> > > >
> > > > Thanks,
> > > >
> > > > Zengfa
> > > >
> >
> > ###########################################
> >
> > This message has been scanned by F-Secure
> Anti-Virus for Microsoft Exchange.
> > For more information, connect to
> http://www.F-Secure.com/
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com