Running ToyAppForJPA outside Netbeans or Eclipse
Posted: Tue Mar 10, 2015 9:14 am
Hi,
If someone would like to run ToyAppForJPA without an IDE here's how I did:
Edit pom.xml and add this dependency under dependencies:
Open src\main\resources\META-INF\persistence.xml and change:
to
Now run the follow command in ToyAppForJPA folder:
and then to start the App enter the target folder (cd target) and execute:
You can create a bat to make easier to start the app.
If someone would like to run ToyAppForJPA without an IDE here's how I did:
Edit pom.xml and add this dependency under dependencies:
Code: Select all
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.5.3.0_1</version>
</dependency>
Code: Select all
<property name="hibernate.connection.url" value="jdbc:derby://localhost:1527/toyjpadb"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.ClientDriver"/>
Code: Select all
<property name="hibernate.connection.url" value="jdbc:derby:toyjpadb;create=true"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
Code: Select all
mvn clean install dependency:copy-dependencies
Code: Select all
java -cp ToyAppForOCPJPA.jar;.\dependency\* guiclient.JPATest