MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » January 2013

Re: Uniquely identifying a record in SQL without a unique key?



fixed

Mark S Waterbury wrote:
See:
http://www.tutorialspoint.com/jdbc/index.htm

See especially the link "JDBC - Result Sets" on the left.


Their so-called "award-winning tutorial" (what kind of award? The DARWIN Award?) starts out fine, but turns to bupkis when it gets to updating the database:

As soon as their own example code,
http://www.tutorialspoint.com/jdbc/updating-result-sets.htm
gets to
rs.updateDouble( "age", newAge );
it throws
com.mysql.jdbc.NotUpdatable: Result Set not updatable (referenced table has no primary keys).This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, can not use functions and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.
at com.mysql.jdbc.UpdatableResultSet.generateStatements(UpdatableResultSet.java:621)
at com.mysql.jdbc.UpdatableResultSet.syncUpdate(UpdatableResultSet.java:1530)
at com.mysql.jdbc.UpdatableResultSet.updateDouble(UpdatableResultSet.java:2056)
at com.mysql.jdbc.UpdatableResultSet.updateDouble(UpdatableResultSet.java:2084)

They provide no direct link to email the author, just a very-low-traffic BBS, and when I signed up and posted my complaint thereon, I got back a message accusing me of spamming the board.

Anybody know of tutorials that actually work, by non-anonymous authors?

--
JHHL





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact