Problemas com hibernate:conexão mysql

Tô iniciando com hibernate: peguei uma tutorial, configurei o hibernate e e quando fui executar o teste do tutorial deu erro na conexão. Vejam o código do teste:

[b]import org.hibernate.Session;
import org.hibernate.Transaction;

public class Teste{
public static void main(String[] args) {
Session sessao = HibernateUtility.getSession(); //Abrindo uma sessão
Transaction transaction = sessao.beginTransaction(); //Iniciando uma transação
Curso curso = new Curso(); //Instanciando um objeto transiente
curso.setNome(“Desenvolvimento de Software”); //Preenchendo as propriedades do objeto
curso.setDescricao(“Curso só pra programadores”);
sessao.save(curso); //Transformando o objeto transiente em um objeto
//persistente no banco de dados
transaction.commit(); //Finalizando a transação
sessao.close(); //Fechando a sessão
}
}[/b]

e as exceções foram as seguintes:

java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:129)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1290)
at Teste.main(Teste.java:7)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)
… 8 more
08:33:43,896 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: null
08:33:43,896 ERROR JDBCExceptionReporter:72 - Connections could not be acquired from the underlying database!
Exception in thread “main” org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:129)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1290)
at Teste.main(Teste.java:7)
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)
at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:35)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
… 5 more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)
… 8 more

Desculpem pela mediocridade, mas alguém pode me dar uma dica!!!
valeu

deve ser algum problema no seu hybernate.cfg.xml
posta else ae pra v c eu posso fazer algo…
c der pra postar os mapeamentos e suas classes tb heeheh…

Olha o hibernate.cfg.xml:

[b]

	<property 
		name="hibernate.dialect">
		org.hibernate.dialect.MySQLDialect
	</property>
	<property 
		name="hibernate.connection.driver_class">
		com.mysql.jdbc.Driver
	</property>
	<property 
		name="hibernate.connection.url">
		jdbc:mysql://localhost/hibernate?autoReconnect=true
	</property>
	<property 
		name="hibernate.connection.username">
		root
	</property>
	<property 
		name="hibernate.connection.password">
		root
	</property>		
	
	<!-- Condiguração do c3p0 -->
	
	<property name="hibernate.c3p0.max_size">10</property>
	<property name="hibernate.c3p0.min_size">2</property>
	<property name="hibernate.c3p0.timeout">5000</property>		
	<property name="hibernate.c3p0.max_statements">10</property>
	<property name="hibernate.c3p0.idle_test_period">3000</property>
	<property name="hibernate.c3p0.acquire_increment">2</property>			

	<!-- Configurações de debug -->

	<property name="show_sql">true</property>
    <property name="use_outer_join">true</property>	
    <property name="hibernate.generate_statistics">true</property>
    <property name="hibernate.use_sql_comments">true</property>
    	
	<mapping resource="Curso.hbm.xml"/>
	<mapping resource="Disciplina.hbm.xml"/>
	<mapping resource="Turma.hbm.xml"/>			
	<mapping resource="Pessoa.hbm.xml"/>	
	<mapping resource="Aluno.hbm.xml"/>		
	<mapping resource="Professor.hbm.xml"/>		
	<mapping resource="Endereco.hbm.xml"/>
		
</session-factory>

[/b]

e as classes:

[b]import java.util.Set;

public class Aluno extends Pessoa {

private String matricula;
 
private Set turmas;
 
/**
 * @return Returns the matricula.
 */
public String getMatricula() {
	return matricula;
}
/**
 * @param matricula The matricula to set.
 */
public void setMatricula(String matricula) {
	this.matricula = matricula;
}
/**
 * @return Returns the turmas.
 */
public Set getTurmas() {
	return turmas;
}
/**
 * @param turmas The turmas to set.
 */
public void setTurmas(Set turmas) {
	this.turmas = turmas;
}

public String toString() {
	return this.getNome() + " " + this.getMatricula() + " "+ this.getEndereco();
}

}
[/b]

[b]import java.util.Set;

public class Curso {

private String descricao;
 
private String nome;
 
private Set disciplinas;
 
private Integer id;



/**
 * @return Returns the id.
 */
public Integer getId() {
	return id;
}
/**
 * @param id The id to set.
 */
public void setId(Integer id) {
	this.id = id;
}	

/**
 * @return Returns the descricao.
 */
public String getDescricao() {
	return descricao;
}
/**
 * @param descricao The descricao to set.
 */
public void setDescricao(String descricao) {
	this.descricao = descricao;
}
/**
 * @return Returns the disciplinas.
 */
public Set getDisciplinas() {
	return disciplinas;
}
/**
 * @param disciplinas The disciplinas to set.
 */
public void setDisciplinas(Set disciplinas) {
	this.disciplinas = disciplinas;
}
/**
 * @return Returns the nome.
 */
public String getNome() {
	return nome;
}
/**
 * @param nome The nome to set.
 */
public void setNome(String nome) {
	this.nome = nome;
}

}
[/b]

[b]import java.util.Set;

public class Disciplina {

private String nome;
 
private String ementa;
 
private Set turmas;
 
private Curso curso;

private Integer id;



/**
 * @return Returns the id.
 */
public Integer getId() {
	return id;
}
/**
 * @param id The id to set.
 */
public void setId(Integer id) {
	this.id = id;
}


/**
 * @return Returns the curso.
 */
public Curso getCurso() {
	return curso;
}
/**
 * @param curso The curso to set.
 */
public void setCurso(Curso curso) {
	this.curso = curso;
}
/**
 * @return Returns the ementa.
 */
public String getEmenta() {
	return ementa;
}
/**
 * @param ementa The ementa to set.
 */
public void setEmenta(String ementa) {
	this.ementa = ementa;
}
/**
 * @return Returns the nome.
 */
public String getNome() {
	return nome;
}
/**
 * @param nome The nome to set.
 */
public void setNome(String nome) {
	this.nome = nome;
}
/**
 * @return Returns the turmas.
 */
public Set getTurmas() {
	return turmas;
}
/**
 * @param turmas The turmas to set.
 */
public void setTurmas(Set turmas) {
	this.turmas = turmas;
}

}[/b]

[b]public class Endereco {

private String bairro;

private String cep;

private String cidade;

private String complemento;

private String estado;

private Integer id;

private Integer numero;

private Pessoa pessoa;

private String rua;

/**
 * @return Returns the bairro.
 */
public String getBairro() {
	return bairro;
}

/**
 * @return Returns the cep.
 */
public String getCep() {
	return cep;
}

/**
 * @return Returns the cidade.
 */
public String getCidade() {
	return cidade;
}

/**
 * @return Returns the complemento.
 */
public String getComplemento() {
	return complemento;
}

/**
 * @return Returns the estado.
 */
public String getEstado() {
	return estado;
}

/**
 * @return Returns the id.
 */
public Integer getId() {
	return id;
}

/**
 * @return Returns the numero.
 */
public Integer getNumero() {
	return numero;
}

/**
 * @return Returns the pessoa.
 */
public Pessoa getPessoa() {
	return pessoa;
}

/**
 * @return Returns the rua.
 */
public String getRua() {
	return rua;
}

/**
 * @param bairro
 *            The bairro to set.
 */
public void setBairro(String bairro) {
	this.bairro = bairro;
}

/**
 * @param cep
 *            The cep to set.
 */
public void setCep(String cep) {
	this.cep = cep;
}

/**
 * @param cidade
 *            The cidade to set.
 */
public void setCidade(String cidade) {
	this.cidade = cidade;
}

/**
 * @param complemento
 *            The complemento to set.
 */
public void setComplemento(String complemento) {
	this.complemento = complemento;
}

/**
 * @param estado
 *            The estado to set.
 */
public void setEstado(String estado) {
	this.estado = estado;
}

/**
 * @param id
 *            The id to set.
 */
public void setId(Integer id) {
	this.id = id;
}

/**
 * @param numero
 *            The numero to set.
 */
public void setNumero(Integer numero) {
	this.numero = numero;
}

/**
 * @param pessoa
 *            The pessoa to set.
 */
public void setPessoa(Pessoa pessoa) {
	this.pessoa = pessoa;
}

/**
 * @param rua
 *            The rua to set.
 */
public void setRua(String rua) {
	this.rua = rua;
}

}[/b]

Lá vai!!

O Hibernate não esta conseguindo fazer a conexão com o banco de dados.
Isso ocorre quando o nome de usuário ou senha esta incorreta.

Verifique se o nome de usuário e senha do seu banco estão iguais ao do seu cfg:

Usuário: root
Senha: root