Boa tarde Gurus. Mais uma pergunta:
Estou recebendo o erro:
Exception in thread "main" java.sql.SQLException: java.lang.NoClassDefFoundError: org/hsqldb/navigator/RowSetNavigatorDataChangeMemory java.lang.NoClassDefFoundError: org/hsqldb/navigator/RowSetNavigatorDataChangeMemory
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source)
at br.com.caelum.jdbc.Delete.main(Delete.java:14)
Quando tento deletar um registro, usando a seguinte classe:
package br.com.caelum.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class Delete {
public static void main(String[] args) throws SQLException {
Connection conn = Database.getConnection();
Statement smtm = conn.createStatement();
int id=3;
String query = "delete from Produto where id>3";
boolean res = smtm.execute(query);
int updRow=smtm.getUpdateCount();
System.out.println(updRow);
}
}
Segue a classe Database:
package br.com.caelum.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Database {
public static Connection getConnection() throws SQLException {
Connection connection = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/loja-virtual", "SA", "");
return connection;
}
}