LINUX.ORG.RU

JAVA + MYSQL


0

0

ПОМОГИТЕ... Не могу понять, почему Exception выходит...

Example:
try {
Statement st = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = st.executeQuery("SELECT * FROM table_name");
rs.moveToInsertRow();
for(int i=0; i<data.length; i++)
rs.updateString(i+1,data[i]);
rs.insertRow();
rs.last();
rs.deleteRow();
st.close();
}catch(SQLException s) {
}

======================================================================

java.sql.SQLException: Result Set not updateable. The query that generated this result set must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.

======================================================================

Вроде всё правильно, но не идёт... :(
Подскажите пожалусто, целый день потерял...
Не могу понять... :(

anonymous

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.