(Old Eclipse usage on 16.10.2010)
Eclipse Java EE IDE for Web Developers. Version: Kepler Release Build id: 20130614-0229Details about the core Eclipse release is under button "Eclipse.org".
http://download.jboss.org/jbosstools/updates/stable/kepler/Install
mysqldump -u <user> -p<pw> dp clients datecancels dategroups datetemplates fixeddates group grouprole logins profiles sequence tablelogs > 201309230_dp.sql;Import locally with MySQL Workbench > Menu > Server > Data Import/Restore > "Import from Self-Contained File"
1. In the JPA project edit the persistence.xml:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" 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_2_0.xsd"> <persistence-unit name="DatePlanner201_JPA"> <description>any description</description> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>ebel.dp201.jpa.Profile</class> <class>...</class> <properties> <property name="hibernate.default_schema" value="dp"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/> <property name="hibernate.id.new_generator_mappings" value="true"/> <property name="hibernate.connection.url" value="jdbc:mysql://_hostname_:3306/_database_"/> <property name="hibernate.connection.username" value="user"/> <property name="hibernate.connection.password" value="xxxx"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.datasource" value="DatePlanner201_JPA" /> </properties> </persistence-unit> </persistence>
Create a new datasource (http://localhost:8080/console > Connector > Datasources)
Name = Any name, maybe database JNDI Name = DatePlanner201_JPA Driver = mysql-connector-java-5.1.26-bin.jar Username = user Password = xxxx Connection URL = jdbc:mysql://localhost/dp
JBoss datasources are stored in
/standalone/configuration/standalone.xml.
The "JNDI Name" can be any name, but I guess it is a good idea to have it prefixed with "java:jboss/datasources/..." (as described in this Jboss Community Thread), but it must match the JDNI name in the JBoss console.
The "persistence-unit" name in persistence.xml therfore is only used by your application with @PersistenceContext(unitName = "xyz").
Put the MySql Java driver to the deployment folder:
../standalone/deployments/mysql-connector-java-5.1.26-bin.jar
Deploy driver and application with a text file named <driver/app>.dodploy