Exibe o erro no console ....
Meu código:
package br.com.robson.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class TestaInsercao {
public static void main(String[] args) throws SQLException {
Connection connection = Database.getConnection();
Statement statement = connection.createStatement();
boolean resultado = statement.execute("insert into Produto (nome, descricao) values('Notebook')");
System.out.println(resultado);
statement.close();
connection.close();
}
}
Erro exibido no console:
Exception in thread "main" java.sql.SQLSyntaxErrorException: row column count mismatch 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.robson.jdbc.TestaInsercao.main(TestaInsercao.java:13)