Hibernate.cfg.xml + SQL Server 2008

2 respostas
H

Alguém poderia me ajudar a conectar no banco SQL Server 2008, por favor ??

com.microsoft.jdbc.sqlserver.SQLServerDriver jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor root root org.hibernate.dialect.SQLServerDialect org.hibernate.transaction.JDBCTransactionFactory thread false

2 Respostas

H

Já consegui. Pode apagar o tópico se quiser !

caceres

Bom dia galera.

To precisando de uma ajuda Urgente. Eu preciso conectar meu Hibernate no SQL Server 2008 Express...
Mas o Hibernate esta acusando que ele não encontra o Driver... Por favor me ajudem...

Aqui é onde eu passo as configurações para o Hibernate...

SessionFactory fabrica = new Configuration().
                setProperty("hibernate.connection.driver_class", "net.sourceforge.jtds.jdbc.Driver").
                setProperty("hibernate.connection.url", "jdbc:jtds:sqlserver://localhost:1433"+cndto.getNome_banco()).
                setProperty("hibernate.connection.username", cndto.getUsuario()).
                setProperty("hibernate.connection.password", cndto.getSenha()).
                setProperty("hibernate.dialect", "org.hibernate.dialect.SQLServerDialect").
                setProperty("show_sql", "true").
                configure().buildSessionFactory();
                
                sessao = fabrica.openSession();

Esse é o Erro...

15 [AWT-EventQueue-0] INFO org.hibernate.cfg.Environment - Hibernate 3.5.3-Final
15 [AWT-EventQueue-0] INFO org.hibernate.cfg.Environment - hibernate.properties not found
15 [AWT-EventQueue-0] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
15 [AWT-EventQueue-0] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
156 [AWT-EventQueue-0] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
156 [AWT-EventQueue-0] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
250 [AWT-EventQueue-0] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : comunicacao.hbm.xml
328 [AWT-EventQueue-0] INFO org.hibernate.cfg.HbmBinder - Mapping class: br.com.JavaHibernate.DTO.Comunicacao_DTO -> Comunicacoes
343 [AWT-EventQueue-0] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
406 [AWT-EventQueue-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
406 [AWT-EventQueue-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
406 [AWT-EventQueue-0] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
421 [AWT-EventQueue-0] ERROR org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver class not found: net.sourceforge.jtds.jdbc.Driver

Agradeço desde já...

Criado 15 de junho de 2009
Ultima resposta 17 de set. de 2010
Respostas 2
Participantes 2