Prezados, alterei como sugerido pelo Maurício, o HSQLDB pelo MySql, e pra minha surpresa, quando chamo o controller InfraController, pela url, não funciona, apenas dando erros. Alguém pode me ajudar? Segue código da classe ConnectionFactory.
package br.com.caelum.contas;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectionFactory {
// public Connection getConnection() throws SQLException {
// System.out.println("conectando ...");
//
// try {
// Class.forName("org.hsqldb.jdbcDriver");
// } catch (ClassNotFoundException e) {
// throw new SQLException(e);
// }
//
// return DriverManager.getConnection("jdbc:hsqldb:file:contas.db","sa", "");
// }
public Connection getConnection()throws SQLException{
try {
System.out.println("conectando ...");
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return DriverManager.getConnection("jdbc:mysql://localhost/dbcontas", "root", "minhasenha");
}
}
Segue a minha stacktrace
GRAVE: Servlet.service() for servlet [spring mvc] in context with path [/contas] threw exception [Request processing failed; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if exists' at line 1] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'if exists' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Quando volto para