OLHA GALERA !
opa é o seguinte eu estou estudando com a apostilha da caelum fj21.
tipo eu sei que as clases e todas funcionam mais por conta de ums erros da jee não poder usar generics.
pois bem, eu retirei todo o cod de generics aqui
agora esta me retornando o erro :
Exception in thread "main" java.sql.SQLException: com.mysql.jdbc.Driver
at com.br.jdbc.ConnectonFatory.getConnection(ConnectonFatory.java:31)
at com.br.jdbc.ContatoDAO.<init>(ContatoDAO.java:34)
at com.br.jdbc.TestaListaDAO.main(TestaListaDAO.java:24)
o cod que gera o erro é esse:
public static void main( String args[] ) throws SQLException {
ContatoDAO dao = new ContatoDAO();
// List contatos = dao.getLista();
for ( int i = 0; i < dao.getLista().size(); i++ ) {
Contato c = ( Contato ) dao.getLista().get(i);
System.out.print( c.getNome() + "/t" );
System.out.print( c.getEmail() + "\t" );
System.out.print( c.getEndereco() + "\t" + "\n\n" );
}
}
que apota pra qui:
public static Connection getConnection() throws SQLException {
try {
Class.forName( "com.mysql.jdbc.Driver");
System.out.println( "Connectaded" );
return DriverManager.getConnection("jdbc:mysql://localhost/java", "root", "kaspil" );
} catch ( ClassNotFoundException e ) {
throw new SQLException( e.getMessage() );
}
especificamnete nessa linhaa
throw new SQLException( e.getMessage() );
alguém pode me ajudar !!
o que será que esta acontecendo ???