/ Published in: Java
this goes under src/main/resource/META-INF/persistence.xml
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="default"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <!-- Auto detect annotation model classes --> <property name="hibernate.archive.autodetection" value="class"/> <!-- Datasource --> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.password" value=""/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost/myhibernatejpa_dev"/> </properties> </persistence-unit> </persistence>