Running ToyAppForJPA outside Netbeans or Eclipse

Moderator: admin

Post Reply
jackstuard
Posts: 6
Joined: Thu Oct 09, 2014 7:14 am
Contact:

Running ToyAppForJPA outside Netbeans or Eclipse

Post by jackstuard »

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:

Code: Select all

		<dependency>
			<groupId>org.apache.derby</groupId>
			<artifactId>derby</artifactId>
			<version>10.5.3.0_1</version>
		</dependency>
Open src\main\resources\META-INF\persistence.xml and change:

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"/>
to

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"/>
Now run the follow command in ToyAppForJPA folder:

Code: Select all

mvn clean install dependency:copy-dependencies
and then to start the App enter the target folder (cd target) and execute:

Code: Select all

java -cp ToyAppForOCPJPA.jar;.\dependency\* guiclient.JPATest
You can create a bat to make easier to start the app.

admin
Site Admin
Posts: 10284
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Running ToyAppForJPA outside Netbeans or Eclipse

Post by admin »

Great! Thank you for posting it here. I'm sure it will be helpful for other readers.

-Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests