Hirbenate

6001 palavras 25 páginas
Spring Framework Tutorial
Isabelle Muszynski
15 April 2003

Chapter 1

Introduction
This tutorial covers the main packages in the Spring Framework. For full details, we refer you to Rod
Johnson’s book, Expert One-on-One J2EE Design and Development, published by Wrox Press in 2002. The book’s ISBN number is 1-86100-784-1.
The code for the Spring Framework is contained in package com.interface21. We provide UML diagrams for the subpackages, as well as code samples.

1.1

Setting up for the samples

The samples have been written using the MySQL database (www.mysql.com), Tomcat (jakarta.apache.org/tomcat) and JBoss(www.jboss.org). We refer you to these web sites for setting up the environment correctly. In
MySQL, create a database named test, a user test with password test, and grant user test all rights: grant all on test.* to test@localhost identified by ’test’;
If you use a different database, read the comments at the top of the samples files, they will direct you to the spots in the code you will have to change for your database.

1.2

Building the tutorials

The tutorials can be built using the provided Ant script (you can get ant at http://jakarta.apache.org/ant).
You may need to edit the build.properties file to set paths correctly for your system.

1.3

Running the tutorials

We provide a shell script, runtest.sh, and a batch file, runtest.bat, for running a single tutorial. You may need to edit these files to set the paths correctly.

1

Chapter 2

The JDBC Package
Data access is taken care of in the com.interface21.jdbc package and its subpackages. These packages are non-intrusive, and so you can use them separately from the rest of the framework to implement persistence in your application.
There are two main packages, com.interface21.jdbc.core, which implements low-level persistence, and the high-level com.interface21.jdbc.object, which presents an object-oriented view of the low-level package.

2.1

Exception

Relacionados