update a field with JoinRowSet
"RAPPAZ Francois" <[email protected]> Tue, 13 Feb 2007 17:08:51 +0100
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <[email protected]> |
Hi
I tested a few lines of codes with JoinRowSet
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/dokpe_i01?user=...&password=...");
jrs = new JoinRowSetImpl();
crs = (CachedRowSet) getCRS("SELECT * FROM jrnabt where nofm=13");
crsabo = (CachedRowSet) getCRS("SELECT * FROM abo");
jrs.addRowSet(crs, "noabt");
jrs.addRowSet(crsabo, "noabt");
if (jrs != null) {
jrs.beforeFirst();
while (jrs.next()){
String ti =jrs.getString("ref");
System.out.println(ti);
jrs.updateString("ref",ti + " modif");
jrs.updateRow();
}
jrs.acceptChanges(conn);
jrs.close();
jrs = null;
}//if
All is fine until acceptChanges: without any connection specified, I get an error saying there is no connection, and if I give one, I got an error saying "com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'MergedCol' in 'field list'"
I'm using v 5.0.3 of Jconnector with mysql 5.0.15.
Thanks for any help !
François Rappaz
--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/[email protected]