Jasper Studio with Hibernate Session

Asked

Viewed 181 times

1

I’m trying to add a connection in Jasper Studio via the option "Hibernate Session" I added the . Hibernate jars, the Mysql Driver and I’ve uploaded the Hibernate.cfg.xml file, but still, I always have access:

Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbteste

I also tried the connection via "EJBQL". I added the . jars of libraries and a . jar with persistence.xml and my entities, but I always get the exception:

Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named JPAUnit

Someone has some clue how to make these connections. I want to perform them to test the reports with HQL or JPQL queries instead of using SQL.

  • What is the version of the mysql driver you are using?

  • The version is 5.1.35, but I’ve tried with 5.1.6 as well.

1 answer

1


Finally I managed to fix it. What happens is this, bug in Jasper Studio. I was using version 6.2.2 and with it there was no way to make it work.

So I installed version 6.3.0 of Jasper Studio and it worked. But there are some reasons, I only got the connection via "EJPQL", to JPA using Eclipselink libraries:

<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>org.eclipse.persistence.jpa</artifactId>
    <version>2.6.3</version>
</dependency>

Already with Hibernate, trying to use JPA, each time I changed the library version, it generated a different exception in the connection attempt. So it turns out I didn’t make it with Hibernate’s libs. But, if you use version 6.0.1 of Jasper Studio, with Hibernate 3.3.2-GA libraries it works with "EJPQL" for JPA. However, you have to compile the jar with the entities in version 1.6 of Java, in version 1.8 and 1.7 did not work.

Finally, it was not possible at all, either by changing the versions of the libraries of Hibernate or even Jasper Studio to get a connection via "Hibernate Session". There’s always the same mistake:

Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/dbteste

;D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.