I get this error
javax.servlet.ServletException: com.mysql.jdbc.NotUpdatable: Result Install not updatable.
I know this error applies to the primary key, but for all my tables, I initially insert the primary key. Therefore, there is also a primary key for this table. I am posting part of my code.
Statement st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); ResultSet rs=st.executeQuery("Select * from test3 order by rand() limit 5"); List arrlist = new ArrayList(); while(rs.next()){ String xa =rs.getString("display"); if(xa.equals("1")){ arrlist.add(rs.getString("question_text")); } rs.updateString("display", "0"); rs.updateRow();
Just tell me there is something wrong with this code.please help. This is my database.
+----------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+---------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | index_question | varchar(45) | YES | | NULL | | | question_no | varchar(10) | YES | | NULL | | | question_text | varchar(1000) | YES | | NULL | | | file_name | varchar(128) | YES | | NULL | | | attachment | mediumblob | YES | | NULL | | | display | varchar(10) | YES | | NULL | | +----------------+---------------+------+-----+---------+----------------+
source share