Java Reference
In-Depth Information
CREATE TABLE seat_type (
id int(10) NOT NULL PRIMARY KEY auto_increment,
description varchar(50) NOT NULL,
price int(10) NOT NULL,
quantity int(10) NOT NULL
) ENGINE=InnoDB;
CREATE TABLE seat (
id int(10) NOT NULL PRIMARY KEY auto_increment,
booked Boolean,
seat_id int(10),
FOREIGN KEY (seat_id) REFERENCES seat_type (id)
ON DELETE CASCADE) ENGINE=InnoDB;
Installing the JDBC driver on JBoss AS 7
Database connectivity is carried out in Java using JDBC drivers, which are used
either directly in your applications or behind the scenes in JPA or Hibernate. The
MySQL JDBC driver can also be downloaded for free from http://dev.mysql.com/
downloads/connector/j/ .
Once download is complete, extract the file mysql-connector-java-5.X.XX-
bin.jar and place it in a convenient location on your filesystem. We will show now
how to install the JDBC driver on JBoss AS 7.
In JBoss AS 5 and 6, you used to install the JDBC driver into the common/lib folder
of your server distribution. In the new modular server architecture, you have more
than one option to install your JDBC driver. The recommended approach consists of
installing the driver as a module .
The procedure for installing a new module requires creating a module path under
JBOSS_HOME/modules and placing the .jar libraries and the module.xml file
(that declares the module and its dependencies) there.
In our example, we will add the following units to our filesystem:
JBOSS_HOME/modules/com/mysql/main/mysql-connector-
java-5.1.24-bin.jar
Search WWH ::




Custom Search