Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update in Chapter 3 sfsbLifeCycleExample in JPA Pro2

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, for everyone's information,
chapter 3's sfsbLifeCycelExample source code does not work on my side.
Here is what I did:

1. Suppose you have a  MySQL database instead of derby.
Your className should be com.mysql.jdbc.jdbc2.optional.MysqlDataSource.
2. Suppose you have a database url in mySQL : localhost:3306/javageek with credentials :root/sesame.
3. Also download mysql-connector-java-5.1.39-bin.jar and put it in glassfish installation directory at :
C:\ your glassfish directory\glassfish-4.1.1-web\glassfish\domains\domain1\lib

Reference:
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html
http://stackoverflow.com/questions/8349970/connecting-a-mysql-database-to-glassfish-classpath-is-not-set-or-classname-is-wr

I hope this will help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic