Galera estou tendo problemas para fazer a conexão com o banco de dados firebird com hibernate.
Meu hibernate configuration
org.firebirdsql.jdbc.FBDriver jdbc:firebird:localhost/3050:c:\\banco\\javahibernate.FDB SYSDBA masterkey org.hibernate.dialect.FirebirdDialectO Erro que está dando é esse:[size=18] [/size]
run:
18 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
21 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
26 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
31 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
121 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: hibernate.cfg.xml
121 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: hibernate.cfg.xml
234 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : aluno.hbm.xml
314 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: aluno -> aluno
339 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
412 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
412 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
412 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
422 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.firebirdsql.jdbc.FBDriver at URL: jdbc:firebird:localhost/3050:c:\banco\javahibernate.FDB
422 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=SYSDBA, password=****}
422 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection to query metadata
java.sql.SQLException: No suitable driver found for jdbc:firebird:localhost/3050:c:\banco\javahibernate.FDB
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
at gravaAluno.main(gravaAluno.java:20)
512 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.FirebirdDialect
519 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
651 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
683 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
687 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
688 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: disabled
688 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
695 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
697 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
697 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
697 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
697 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
697 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
705 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
705 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
705 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
705 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
705 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
707 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
711 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
719 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
727 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
727 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
727 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
727 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
804 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
1040 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
1093 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08001
1093 [main] ERROR org.hibernate.util.JDBCExceptionReporter - No suitable driver found for jdbc:firebird:localhost/3050:c:\banco\javahibernate.FDB
CONSTRUÍDO COM SUCESSO (tempo total: 5 segundos)
OBS: O driver que estou utilizando é o jaybird-full-2.1.6
A mensagem que aparece é essa:
Erro de inserção org.hibernate.exception.JDBConnectionException: Cannot open connection
Minha classe para Gravar o arquivo:
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
/**
*
-
@author JMLS
*/
import javax.swing.JOptionPane;
import org.hibernate.;
import org.hibernate.cfg.;
public class gravaAluno {
public static void main(String[] arg){
try
{
SessionFactory insercao = new Configuration().configure().buildSessionFactory();
Session sessao = insercao.openSession();
Aluno aluno = new Aluno();
aluno.setAlu_codigo(1);
aluno.setAlu_nome("Jose da Silva");
aluno.setAlu_cidade("Salvador");
aluno.setAlu_tel("xx-xxxx-xxxx");
aluno.setAlu_curso("Hibernate");
Transaction tx_aluno = sessao.beginTransaction();
sessao.save(aluno);
tx_aluno.commit();
sessao.close();
}
catch(Exception erro)
{
JOptionPane.showMessageDialog(null,"Erro de inserção "+erro);
}
}
}
Se alguém puder me ajudar desde já agradeço.