8 messages in com.mysql.lists.javaRe: Updatable JdbcRowSet
FromSent OnAttachments
lopes16 Jan 2004 02:56 
Collins, Danny16 Jan 2004 03:58 
lopes16 Jan 2004 04:19 
Mark Matthews16 Jan 2004 06:32 
Ricardo Lopes16 Jan 2004 06:39 
Ricardo Lopes16 Jan 2004 08:18 
Mark Matthews16 Jan 2004 08:48 
Jim16 Jan 2004 10:54 
Subject:Re: Updatable JdbcRowSet
From:Ricardo Lopes (lop@elevaconsult.pt)
Date:01/16/2004 06:39:50 AM
List:com.mysql.lists.java

I'm using the rowset.jar from sun that includes the com.sun.rowset.JdbcRowSetImpl, com.sun.rowset.CachedRowSetImpl, and some other classes.

The problem is not with the table, the problem is with the driver or more probably with the way i am creating the RowSet, but here is the DDL from show create:

CREATE TABLE `atable` ( `freguesia_id` int(11) NOT NULL auto_increment, `nome_freguesia` varchar(100) NOT NULL default '', `concelho_id` int(11) NOT NULL default '0', PRIMARY KEY (`freguesia_id`) ) TYPE=MyISAM;

lopes said:

I'm trying to make an updatable JdbcRowSet, i already read a previuos question in this mailing list and follow the sugested items but i cant make

it work.

my table has a primary key, in my select statement i only select one table (no joins), i force the JdbcRowSet to be CONCUR_UPDATABLE but it doesnt work.

What i would like is somebody tell me what an i doing wrong, give an example or tell me wich class do i have to hack, patch or something like that to make it create an updatable resulset by default like 2.x driver did. (i know this is not jdbc compilant)

My code is:

Class.forName("com.mysql.jdbc.Driver"); conn =

DriverManager.getConnection("jdbc:mysql://127.0.0.1/adatabase","root","");

rowset = new JdbcRowSetImpl(conn); rowset.setType(ResultSet.TYPE_SCROLL_SENSITIVE); rowset.setConcurrency(ResultSet.CONCUR_UPDATABLE); rowset.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);

rowset.setCommand("SELECT * FROM atable"); rowset.execute();

The MySQL driver doesn't provide the JdbcRowSetImpl class, where is that defined? Are you using the one from Sun?

What does the DDL for 'atable' look like?

-Mark