How to migrate HSQLDB based tutorials to MySQL and Derby on NetBeans.

First of tutorials,we had better to learn "How to create JDBC Connection pool and JDBC resource".here


We already know that If you create some Web Application using NetBeans "Visual JSF Application" Framework,then "JDBC Connection pool and JDBC resource" is created automatically.
You can see tutorials from here: Java Web Application Learning Trail

You can create a sample application using this tutorial: Using Databound Components to Access a Database
You need not complete this tutorial,only one JSF component(using database) is sufficient.
I think this is most quick way to create "JDBC Connection pool and JDBC resource".

Here,we create "JDBC Connection pool and JDBC resource" manually.
This "Know_How" is from the tutorial: LAB-4923: Spring Framework and JPA

Using this "JDBC Connection pool and JDBC resource",we can migrate ZK applications
from HSQLDB based application to MySQL based or Derby.
With this base environment we proceed to ZKtodo2.


1. ZKtodo2

2. ZKPetshop2

Tuorial:
How to create JDBC Connection pool and JDBC resource


1. Create database.

pet4

pet5

2. Create a Database connection.
Caution!! This is old!! Database connection is created automatically.

pet2

pet3

 

3. Populate database tables.

pet6



CREATE TABLE "ZKDERBY"."REMINDER"
(
REMINDER_ID varchar(50) PRIMARY KEY NOT NULL,
NAME varchar(50),
PRIORITY int,
DATE date
)
;
CREATE UNIQUE INDEX SQL090324110418140 ON REMINDER(REMINDER_ID)
;

pet8

pet9

4. Open Admin Console of the GlassFish V2 application server.

1

2

5. Ceate a connection pool.

p1

p2

p3c

p4

6. Remove SecurityMechanism property from derby_net_ZKDerby_zkderbyPool.

p3d

p3d2

p3d2


7. Start Java DB server.

pet1


8. Make sure derby_net_ZKDerby_zkderbyPool is operational.

p3d4

p3d4

9. Create JDBC resource.

3

4

5