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