aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to replace Derby with MySQL Ant properties & CLASSPATH reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to replace Derby with MySQL Ant properties & CLASSPATH reference" Watch "How to replace Derby with MySQL Ant properties & CLASSPATH reference" New topic
Author

How to replace Derby with MySQL Ant properties & CLASSPATH reference

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
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

Joined: Oct 20, 2006
Posts: 235
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to replace Derby with MySQL Ant properties & CLASSPATH reference