Galera, é o seguinte, eu to com um problema ao acessar o MySql, por sinal já vi tópicos aqui e em outros lugares com pessoas tirando a mesma dúvida que eu, porém as resoluções que tinham não resolveram o meu problema. Segue o erro quando tento acessar o MySql:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/cono
hibernate.cfg.xml<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:mysql://localhost/cono</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">123456</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2dll.auto">update</property>
<mapping class="br.com.cadastrodenoticias.model.Usuario"/>
<mapping class="br.com.cadastrodenoticias.model.Noticia"/>
</session-factory>
</hibernate-configuration>
package br.com.cadastrodenoticias.util;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
public static final SessionFactory sessionFactory;
static {
Configuration configuration = new AnnotationConfiguration();
configuration.configure();
sessionFactory = configuration.buildSessionFactory();
}
public static Session getSession() {
return sessionFactory.openSession();
}
}
O interessante, é que quando executo a classe GeraBanco, ele cria as tabelas normalmente.
Desde já agradeço !