Eu fiz conforme exercício mas apareceu o seguinte erro no console, referente a linha do statement:
Conectado ao City Bank Exception in thread "main" java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: CLIENTE 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 Jdbc.main(Jdbc.java:16) Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: CLIENTE at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.error.Error.error(Unknown Source) at org.hsqldb.ParserDQL.readTableName(Unknown Source) at org.hsqldb.ParserDQL.readTableOrSubquery(Unknown Source) at org.hsqldb.ParserDQL.XreadTableReference(Unknown Source) at org.hsqldb.ParserDQL.XreadFromClause(Unknown Source) at org.hsqldb.ParserDQL.XreadTableExpression(Unknown Source) at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source) at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source) at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source) at org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source) at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source) at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source) at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source) at org.hsqldb.ParserCommand.compilePart(Unknown Source) at org.hsqldb.ParserCommand.compileStatements(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) ... 3 more
Meu Código Java é esse:
public static void main(String[] args) throws SQLException {
Connection connection = DriverManager.getConnection( "jdbc:hsqldb:hsql//localhost/city-bank", "SA", "");
System.err.println("Conectado ao City Bank");
Statement statement = connection.createStatement(); boolean execute = statement.execute("select * from cliente"); System.out.println(execute);
connection.close();
}