Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Phone Book Bean Example

This is an example of a JSP-page calling an Enity Bean that uses container managed persistence (CMP). The result looks like this:

...

All soure code can be downloaded in the zip-file: myphonebook.zip@http://www.freefarm.se/j2ee/ejb/ex2/myphonebook.zip

Using MySQL as a database instead of derby

I have a MySQL 5.0.24-community-nt database installed on my computer. Let's see what we need to do to get the phnoebook example work with MySQL istead!
First set up the database! Logg in as root and create a new database called PhonebookDB (same as for derby earlier in this example). Then create the table and put som values. Be sure to put in a new person in this table so we later on can prove to ourselfs that we are really using the new mysql database instead of the old derby. This is my commands:

...