• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to replace Derby with MySQL Ant properties & CLASSPATH reference

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I would like to run a JPA tutorial using MySQL instead which has been built with Derby pre-configured and is working fine using Ant built script. Below are some configuration files used by this exercise:

Also tried to include the latest Eclipse JPA (E:/Oracle/glassfish-persistence-installer-v2.1-b60.jar) & MySQL JDBC driver (E:/Oracle/mysql-connector-java-5.1.6-bin.jar) in CLIENT_CLASSPATH of common.properties file. This same example built from scratch in Netbeans 6.9.1 including these jar files in the CLASSPATH has worked beautifully.

Some system environmental variables used by Java & Ant are:
ANT_HOME=C:\Ant\apache-ant-1.8.2
CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20
Path=C:\Program Files\Java\jdk1.6.0_20\bin;C:\Ant\apache-ant-1.8.2\bin;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\glassfish3\bin;C:\glassfish3\glassfish\bin

However, the following exception kept occurring and I am can do with some advice on how to correctly update these configuration files in order to persist the data into MySQL:

The issue is how to replace Derby properties & driver with MySQL equivalents.

I am running JDK1.6.0_20, GF3.1, Ant 1.8.2 on Windows XP.

Your suggestion would be much appreciated.

Thanks,

Jack
 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Forgotten to include C:\ProJPA2\examples\Chapter2\employeeService\etc\sql\db.sql which consists of:

DROP TABLE EMPLOYEE;
CREATE TABLE EMPLOYEE (ID INTEGER NOT NULL, NAME VARCHAR(255), SALARY BIGINT, NUMBER INTEGER, PRIMARY KEY (ID));

Also C:\ProJPA2\examples\Chapter2\employeeService\lib is made up of the following files:

eclipselink.jar,
glassfish-persistence-installer-v2.1-b60.jar,
mysql-connector-java-5.1.6-bin.jar.

Thanks,

Jack
 
reply
    Bookmark Topic Watch Topic
  • New Topic