Jasper Studio with Hibernate Session

1

I'm trying to add a connection in Jasper Studio via the "Hibernate Session" option I've added the Hibernate .jars, the MySQL Driver and set the hibernate.cfg.xml file, but I still have the 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

Does anyone have any tips on how to make these connections. I want to perform them to test reports with HQL or JPQL queries instead of using SQL.

    
asked by anonymous 30.06.2016 / 20:23

1 answer

1

I finally got it sorted out. What happens is the following, 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 Jasper Studio version 6.3.0 and it worked. But there are a few things, I just 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>

Now with Hibernate, trying to use JPA, every time I changed the version of the libraries, it caused a different exception in the connection attempt. So it turned out I could not get Hibernate libs. But if you use version 6.0.1 of Jasper Studio, with the Hibernate 3.3.2-GA libraries it works with "EJPQL" for JPA. However, you have to compile the jar with entities in version 1.6 of Java, version 1.8 and 1.7 did not work.

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

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

; D

    
01.07.2016 / 23:33