Re: JDBC problem
From: Richard Reynolds (richiereynoldsNNNN_at_ntlworld.com)
Date: 12/26/03
- Next message: Samba: "Re: newbie I/O problem"
- Previous message: Ryan Stewart: "Re: Newbie: Inheritage, overloading and casting"
- In reply to: cursor: "JDBC problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 26 Dec 2003 15:20:00 -0000
"cursor" <aleamb@ya.com> wrote in message news:bsg8tg$auc$1@news.ya.com...
>
> Hi.
>
> Im developing JSP/Servlet app on Tomcat 5 with MySQL database (version
> 4.1.1-alpha) and its JDBC Connector (version 2.1)
>
> I have got this code:
>
> stmt = conn.createStatement(
> ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_UPDATABLE);
>
>
>
> rs = stmt.executeQuery("SELECT * FROM posts");
>
> rs.moveToInsertRow();
>
> rs.updateString("Nick","foo");
>
> rs.insertRow();
>
>
> And rs.moveToInsertRow(); throw the next Exception:
>
> SQLException: Result Set not updatable.This result set must come from a
> statemen
> t that was created with a result set type of ResultSet.CONCUR_UPDATABLE,
the
> query must select only one table, and must select all primary keys from
that
> table.
> See the JDBC 2.1 API Specification, section 5.6 for more details.
>
> But my statemet sets CONCUR_UPDATABLE property and sql query selects
primary
> keys; I dont understand it.
>
> Thank you
>
>
Hi, haven't used jdbc for quite a while now but from your provided info you
might want to try selecting the primary key col from posts rather then *.
I'm just guessing that the crsor implemented by the result set needs to know
which column is the primary key.
Richard.
- Next message: Samba: "Re: newbie I/O problem"
- Previous message: Ryan Stewart: "Re: Newbie: Inheritage, overloading and casting"
- In reply to: cursor: "JDBC problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|