when I insert some records to dasebase,a error occured
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet is not updateable.
How to resolve the problem? thanks!
Check the constants in the Field Summary for the online ResultSet API documentation at Sun.Result sets created using the returned Statement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY.
You might note that just specifying that a result set be updatable does not guarantee that the result set you get is updatable. If a driver does not support updatable result sets, it will return one that is readonly. The query you send can also make a difference. In order to get an updatable result set, the query must generally specify the primary key as one of the columns selected, and it should select columns from only one table.
The following line of code checks whether the ResultSet object uprs is updatable.
int concurrency = uprs.getConcurrency();
The variable concurrency will be one of the following:
1007 to indicate ResultSet.CONCUR_READ_ONLY
1008 to indicate ResultSet.CONCUR_UPDATABLE
Originally posted by Welsh Ding:
I can get the updateable resultset like this: