I have a Java application that uses a local mysql db. I want to give this to clients so they can install it in their machines without installing mysql. I did some research online and many people suggest using HSQLDB. My question is can I use HSQLDB with hibernate? Do I just need HSQLDB and hibernate or do I need Spring as well?
Yes, you can use HSQLDB with Hibernate with or without using the Spring Framework.
Related
In our project i am using JBPM core only. We have a maven project setup instead of ANT.
I am trying to use JBPM with mysql instead of H2 database .
I tried multiple blog posts and JBOSS documentation but everything is explained based on whole JBPM stack and with ANT profiler.
Can anyone help me in integrating JBPM core with mysql database with maven.
For a new project which has to target Linux and Windows, I am searching for a solution to support MySQL (or MariaDB).
Because we have to support those different platforms I wish to work on DNX Core5.0. However I can't find any nuget packages / connectors which I can use to connect to the database. the one that i find are not supported by DNX core 5.0.
Is there a way to connect to mysql in DNX core 5.0 ? Or do you have to fall back on ODBC connections, i don't know if this would work...
Further i was searching for an ORM to support this, my research till now found out that
Entity Framework 7 is not supporting MySQL at this moment. (and EF is not my favorite ORM at this moment)
NHibernate: Currently nobody is working on it and it will be difficult (breaking changes) to port it to DNX Core
Dapper: (MicroORM I know ...): This is supporting DNXCore but i need a vallid IConnection which I can't create.
Thanks for your feedback!
Rob
I asked a similar question a couple of weeks ago. There is no MySql connector for DNX Core. I had to fall back to DNX 4.5.1 and was able to use MySql with Entity Framework in a project that's running inside a Docker container. Also see the response to my question.
I know how to use JPA with Oracle and derby DBMSs, but is it possible to use MySQL DBMS with the Java Persistence API ? If so, how ?
You may use heavyweight J2EE servers, Jetty/Tomcat servlet engines or standalone Java apps to run JPA stack. Should not matter which jdbc driver being used.
I always use MariaDB(read: MySQL) in my ScopedEntityManager project fine, also have installed on IBM-WAS web server using MSSQL jdbc driver. Download MariaDB Connector/J and MySQL Connector/J packages. You may put both jdbc files to a same application and use connection string to identify which one of the driver use.
jdbc:mysql://localhost:3306/mydbname?useUnicode=true&characterEncoding=utf8
Like most JPA implementations, using the proper JDBC adapter. What's your JPA implementation? EclipseLink?
Edit: You need to have access to a MySQL database, which is trivial to setup.
Yes, it is possible to use MySQL and Java Persistence API.
JPA is not only restricted to Oracle or derby. For example, Netbeans 8 let you use JPA with MySQL. It has everything built in for that functionality such as the MySQL JDBC connector and a JPA implementation called EclipseLink.
If you want to test it yourself, take a look at this tutorial. Although it is referring to derby DBMS, the steps are similiar for MySQL.
I got the following situation.
I'm using Apache Felix as OSGi Service implementation and Apache Karaf as OSGi container.
There is a bundle in karaf which should save some data via hibernate into a database, but I always get a SQLException: No Suitable Driver found.
I deployed the mysql-connector-bundle to karaf.
The problem is, in my mind, that hibernate whether imports the mysql-driver-packages nor my classes which should be mapped.
But I don't know hot to fix this. I'm familar to eclipse rcp where the buddy-policy fixes such problems, is there any best practice for this problem for felix and karaf?
What version of hibernate do you use? Only since Hibernate 4, hibernate is aware of OSGi classloaders, and it still doesn't have complete OSGi support. See e.g. https://hibernate.onjira.com/browse/HHH-7527, which is planned for Hibernate 4.2.
We used Gemini JPA with eclipselink instead as JPA provider in OSGi.
In the karaf eco-system, there is Aries JPA, which is primarly used with OpenJPA. See Which JPA providers are supported by Apache Aries Managed JPA?
Hibernate can't access do data and classes from other bundles (at least in version 3.x; I don't know about version 4). It only works easily if all (methods using hibernate, pojos, mapping files, all libraries) is in the same bundle. It can't access resources in other bundles.
Please also see my answer in this thread.
Does anyone know any way to have the Entity Framework working with mysql connector 6.3/6.4 no install version? I can add the dll-s to my project, but I can't add the connection to the Entity framework because it doesn't see mysql.
The steps to get mySQL and entity framework working are available in this blog post
If you are trying to do it without have a database installed, I do not think that that is possible.