i need a connector where the mongodb data should be accessed in java ..Here the problem is the connector should support hibernate or spring.
If it is an opensource it will be more helpful..
Are there any new mongodb connectors which supports the hibernate.
Try this open source which is jpa based and supports seven datastores in additon to mongodb
https://github.com/impetus-opensource/Kundera/wiki
http://recipes4geeks.com/2011/05/02/working-with-mongodb-using-kundera/
https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes
Related
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.
How connect MySQL and SQLite to Play Framework 2.2?
What format of Build.scala for JDBC driver?
You can see the documentation here
http://www.playframework.com/documentation/2.2.0/ScalaDatabase
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.
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.