Re: updatable resultset doesn't work
Posted by: Mark Matthews
Date: June 13, 2005 10:18AM

Konrad Piersdorfer wrote:
> i try to get an updatable resultset in this way:
>
> Statement
> upstmt=con.createStatement(ResultSet.TYPE_SCROLL_S
> ENSITIVE, ResultSet.CONCUR_UPDATABLE);
> ResultSet uprs=upstmt.executeQuery("select * from
> COFFEES");
>
> the resultset uprs, that i get back, is in fact
> not updatable!
> uprs.isUpdatable=false,
> and when i try to invoke the method
> uprs.moveToInsertRow(), i get the
> SQLException:com.mysql.jdbc.NotUpdatable: Result
> Set not updatable
>
> uprs is a valid resultset and i can get all the
> rows.
>
> i am using
> mysql-standard-4.1.12-apple-darwin7.9.0-powerpc
> with mysql-connector-java-3.1.8.
> does the connector/J not support updatable
> resultsets?
> please help!


Konrad,

Does the "COFFEES" table have a primary key? That's required for updatable result sets. The exception that's reported by the driver will tell you what's required (the requirements are JDBC-compliant, not all result sets are updatable).

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: updatable resultset doesn't work
June 13, 2005 10:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.