estou aprendendo a usar netbeans com o banco h2database. Mas quando tento vincular a JTable com o BD, não tenho sucesso aparece esse erro:
run:
Fev 20, 2012 9:39:49 PM org.hibernate.cfg.annotations.Version <clinit>
Informações: Hibernate Annotations 3.3.1.GA
Fev 20, 2012 9:39:50 PM org.hibernate.cfg.Environment <clinit>
Informações: Hibernate 3.2.0
Fev 20, 2012 9:39:50 PM org.hibernate.cfg.Environment <clinit>
Informações: hibernate.properties not found
Fev 20, 2012 9:39:50 PM org.hibernate.cfg.Environment buildBytecodeProvider
Informações: Bytecode provider name : cglib
Fev 20, 2012 9:39:50 PM org.hibernate.cfg.Environment <clinit>
Informações: using JDK 1.4 java.sql.Timestamp handling
Fev 20, 2012 9:39:50 PM org.hibernate.ejb.Version <clinit>
Informações: Hibernate EntityManager 3.3.2.GA
Fev 20, 2012 9:39:51 PM org.hibernate.cfg.AnnotationBinder bindClass
Informações: Binding entity from annotated class: h2database.java.visao.Exemplo
Fev 20, 2012 9:39:51 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
Informações: Binding Named query: Exemplo.findAll => SELECT e FROM Exemplo e
Fev 20, 2012 9:39:51 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
Informações: Binding Named query: Exemplo.findById => SELECT e FROM Exemplo e WHERE e.id = :id
Fev 20, 2012 9:39:51 PM org.hibernate.cfg.annotations.QueryBinder bindQuery
Informações: Binding Named query: Exemplo.findByNome => SELECT e FROM Exemplo e WHERE e.nome = :nome
Fev 20, 2012 9:39:51 PM org.hibernate.cfg.annotations.EntityBinder bindTable
Informações: Bind entity h2database.java.visao.Exemplo on table EXEMPLO
Fev 20, 2012 9:39:51 PM org.hibernate.cfg.AnnotationConfiguration secondPassCompile
Informações: Hibernate Validator not found: ignoring
Fev 20, 2012 9:39:52 PM org.hibernate.connection.DriverManagerConnectionProvider configure
Informações: Using Hibernate built-in connection pool (not for production use!)
Fev 20, 2012 9:39:52 PM org.hibernate.connection.DriverManagerConnectionProvider configure
Informações: Hibernate connection pool size: 20
Fev 20, 2012 9:39:52 PM org.hibernate.connection.DriverManagerConnectionProvider configure
Informações: autocommit mode: true
Fev 20, 2012 9:39:52 PM org.hibernate.connection.DriverManagerConnectionProvider configure
Informações: using driver: org.h2.Driver at URL: jdbc:h2:D:~\test
Fev 20, 2012 9:39:52 PM org.hibernate.connection.DriverManagerConnectionProvider configure
Informações: connection properties: {user=sa, dialect=org.hibernate.dialect.H2Dialect, autocommit=true, release_mode=auto}
Fev 20, 2012 9:39:55 PM org.hibernate.cfg.SettingsFactory buildSettings
Informações: RDBMS: H2, version: 1.3.163 (2011-12-30)
Fev 20, 2012 9:39:55 PM org.hibernate.cfg.SettingsFactory buildSettings
Informações: JDBC driver: H2 JDBC Driver, version: 1.3.163 (2011-12-30)
Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: No Persistence provider for EntityManager named HibernateJPAPU: Provider named org.hibernate.ejb.HibernatePersistence threw unexpected exception at create EntityManagerFactory:
javax.persistence.PersistenceException
javax.persistence.PersistenceException: [PersistenceUnit: HibernateJPAPU] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at h2database.NewApplication.initComponents(NewApplication.java:32)
at h2database.NewApplication.<init>(NewApplication.java:17)
at h2database.NewApplication$2.run(NewApplication.java:204)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: H2
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:62)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:409)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
... 20 more
The following providers:
oracle.toplink.essentials.PersistenceProvider
org.eclipse.persistence.jpa.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
Returned null to createEntityManagerFactory.
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at h2database.NewApplication.initComponents(NewApplication.java:32)
at h2database.NewApplication.<init>(NewApplication.java:17)
at h2database.NewApplication$2.run(NewApplication.java:204)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
CONSTRUÍDO COM SUCESSO (tempo total: 10 segundos)
Não entendo quando faço a mesma coisa com MySQL funciona direitinho, segue uma imagem da minha tela do aplicativo, será que para programar com H2 preciso usar código puro, sem os benefícios do netbeans?