Presentation is loading. Please wait.

Presentation is loading. Please wait.

J2EE与中间件技术 ——Lab.

Similar presentations


Presentation on theme: "J2EE与中间件技术 ——Lab."— Presentation transcript:

1 J2EE与中间件技术 ——Lab

2 Tomcat的安装配置 1、安装Java Development Kit (JDK)
jdk-1_5_0_15-windows-i586-p.exe 设置环境变量 JAVA_HOME d:\jdk1.5.0_15 PATH d:\jdk1.5.0_15\bin;%path% CLASSPATH .;d:\jdk1.5.0_15\jre\lib\rt.jar;

3 2、下载Tomcat http://tomcat.apache.org/download-55.cgi
Core下面的Windows Service Installer apache-tomcat exe Administration Web Application下面的zip apache-tomcat admin.zip

4 3、安装Tomcat http://localhost:8080/ apache-tomcat-5.5.26.exe 设置环境变量
选择组件:选择Tomcat中的Service,Native 配置:password 设置环境变量 Tomcat_home d:\Tomcat5.5 CLASSPATH .;%Java_home%\lib\dt.jar; %Java_home%\lib\tools.jar; %Tomcat_home%\common\lib\servlet-api.jar; %Tomcat_home%\common\lib\jsp-api.jar;

5 4、安装Tomcat Administration
apache-tomcat admin.zip 解压 文件夹:conf和server 文件:license, notice和release-notes 将文件夹和文件复制到Tomcat_home下 admin/tomcat

6 JSTL http://www.apache.org/dist/jakarta/taglib/standard/
jakarta-taglib-standard-current.zip 解压 文件夹:lib、tld、doc、javadoc 文件: license, notice, readme和standard-doc.war, standard-examples.war 将lib下的standard.jar和jstl.jar复制到<Tomcat_home>\common\libs下; 将tld下的*.tld复制到<webapp_home>\WEB-INF下。

7 Install mysql 下载mysql-noinstall-5.0.51b-win32.zip
解压至C:\mysql b-win32

8 安装MYSQL为系统服务 启动MYSQL 登录MYSQL数据库
C:\mysql b-win32\bin\mysqld-nt.exe --install mysql5 启动MYSQL net start mysql5 登录MYSQL数据库 mysql -u root -p

9 创建测试数据库abcdef 在数据库上建立表EMPLOYEE 插入数据: create database abcdef;
use abcdef; CREATE TABLE `EMPLOYEE` ( `ID` varchar(8) NOT NULL, `NAME` varchar(24) default NULL, `LOCATION` varchar(96) default NULL); 插入数据: insert into `EMPLOYEE` values ('201', 'WangFang' , 'Nanjing'), ('101', 'LiPing' , 'Beijing');

10 在数据库上建立表books CREATE TABLE `books` ( `id` varchar(8) NOT NULL,
`name` varchar(24) default NULL, `title` varchar(96) default NULL, `price` float default NULL, `yr` int(11) default NULL, `description` varchar(30) default NULL, `saleAmount` int(11) default NULL, PRIMARY KEY (`id`));

11 jdbc驱动程序 下载mysql-connector-java-5.0.8.zip 解压
将其中的mysql-connector-java bin.jar驱动文件复制到<tomcat-home>\common\lib下面

12 配置数据源 http://localhost:8080/admin 点击Data Source一项
Data Source Actions:Create New Data Source JNDI Name:jdbc/abcdefds Data Source URL: jdbc:mysql:// /abcdef JDBC Driver Class: com.mysql.jdbc.Driver User Name: root Password:


Download ppt "J2EE与中间件技术 ——Lab."

Similar presentations


Ads by Google