Segue o código:
package br.com.caelum.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class TestaListagem {
public static void main(String[] args) throws SQLException {
Connection connection = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/loja-virtual", "SA", "");
Statement statement = connection.createStatement();
boolean resultado = statement.execute("select * from Produto");
ResultSet resultSet = statement.getResultSet();
while (resultSet.next()) {
int id = resultSet.getInt("id");
String nome = resultSet.getString("nome");
String descricao = resultSet.getString("descricao");
System.out.println(id);
System.out.println(nome);
System.out.println(descricao);
}
resultSet.close();
statement.close();
connection.close();
}
Exception in thread "main" java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: PRODUTO
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.TestaListagem.main(TestaListagem.java:13)
Já refiz todos os passos e continuo tendo erro. alguém consegue me informar o motivo ?