DB2 Express-C

Download Report

Transcript DB2 Express-C

®
IBM Software Group
Kick-start your Java Apps: Free Software, fast
development
Eclipse IDE, WASCE, DB2 Express-C
© 2006 IBM Corporation
IBM Software Group | Rational software
The Kick-start combo
 DB2 Express-C database server
 WebSphere Application Server Community Edition
 The Eclipse IDE
2
IBM Software Group | Rational software
Agenda
 Briefing on AI and How important is 3 tier model
 J2EE Platform Architecture Overview
 Introduce Student Kit
Eclipse Open Source IDE
WebSphere Application Server Community Edition
DB2 Express-C
 Develop an example of web application: Demos
3
IBM Software Group | Rational software
Before You Start
 Downloading and installing DB2 Express-C
 Creating databases and manipulating data with tools in DB2 Express-C
 Downloading and installing Application Server
 Managing Application Server through the Web console
 Connecting Application Server to DB2 Express-C using a JCA 1.5 connector
 Downloading and installing Eclipse
 Installing the Application Server plug-in for Eclipse
 Managing, browsing, and editing DB2 Express-C data through the Eclipse IDE
 Testing Web applications in Eclipse with embedded control of Application Server
instances
 Rapidly developing and testing a JSP/JSTL Web application in Eclipse, with data
access to DB2 Express-C, and deploying it to Application Server
 Configuring Application Server as a general Web server on the Internet
4
IBM Software Group | Rational software
Prerequisites
 Familiar with Java development in general and server-side Java
development specifically
 Understand the general operations of a relational database
 Familiar with basic J2EE Concepts
5
IBM Software Group | Rational software
System Requirements
 Sun JDK 1.4.2_09 or above
 Or IBM JDK 1.4.2 SR3
 512 MB of main memory (1GB recommended)
 900MB of disk space to install the software components & examples
6
IBM Software Group | Rational software
Overview
 Eclipse, Application Server, and DB2 Express-C working together
7
IBM Software Group | Rational software
J2EE Platform Architecture Overview
Presentation
Layer
Business
Layer
Servlets
Integration
Layer
Session
Beans
SDOs
Entity
Beans
JavaBeans
Entity
JSP/JSF
Pages
Entity
Java
JavaBeans
JavaBeans
Java
Java
HTML
Pages
8
IBM Software Group | Rational software
Introducing DB2 Express-C
 The robust, proven, and scalable database server
The core technology of DB2 has existed as an IBM product since
1983
International enterprises use DB2 today to maintain some of the
largest databases on servers
scaling up (by adding more CPU and memory toone server) or
scaling out (by adding more servers over an interconnection
network)
 Built-in management and business application features
32-bitmicroprocessor-based server hardware (with extensions for
64-bit CPUs)
built-in self-monitoring, maintenance, and tuning features
Transactions, XA distributed transactions, stored procedures,
referential constraints, and triggers have been well-tested
 DB2 Express-C can grow with your needs
9
IBM Software Group | Rational software
Downloading and Installing DB2 Express-C
 Downloading DB2 Express-C
 Go to DB2 Universal Database Express Edition for Linux and Windows
 http://www306.ibm.com/software/data/db2/udb/db2express/download.html?S_TACT=105AGX0
2&S_CMP=SIMPLE
 Installing DB2 Express-C
 Unzip the downloaded file, db2exc_NT_x86.zip, to a directory.
 Run SETUP.EXE to begin installing DB2 Express-C
10
IBM Software Group | Rational software
Installing DB2 Express-C
Setup screen for DB2 Express-C installer
11
IBM Software Group | Rational software
Installing DB2 Express-C
 Selecting typical installation for DB2 Express-C
12
IBM Software Group | Rational software
Installing DB2 Express-C
Windows user authentication assignments for DB2 installation
13
IBM Software Group | Rational software
Understanding the DB2 Express-C Components
 DB2 System Services
 DB2 tools and utilities for administrators, users, and developers
14
IBM Software Group | Rational software
Understanding the DB2 Express-C Components
 DB2 System services
15
IBM Software Group | Rational software
Understanding the DB2 Express-C Components
 DB2 tools for administrators, users, and developers
16
IBM Software Group | Rational software
Working with the DB2 Command Line Processor
 Logging on the CLP of DB2
Express-C
Ex: connect to sample
 select firstname, lastname, salary
from employee where salary >
40000
17
IBM Software Group | Rational software
DB2 Script file for creating a table
 products.sql
18
IBM Software Group | Rational software
Introducing WebSphere Application Server
Community Edition
 Server for J2EE 1.4 applications and Web Services
 JSPs
 Servlets
 Custom Java coding
 EJBs
 Model-view-controller (MVC) frameworks
 Lightweight development frameworks
 JCA 1.5 resource adapters connecting to EIS or legacy systems
 Other data-access components
 Once a Geronimo (http://geronimo.apache.org)
19
IBM Software Group | Rational software
WebSphere Application Server’s open source server
components
20
IBM Software Group | Rational software
Downloading and Installing Application Server
 Downloading Application Server
 Go to: Download: WebSphere Application Server Community Edition
V1.0.0.1
 http://www128.ibm.com/developerworks/downloads/ws/wasce/?S_TACT=105AGX02
&S_CMP=SIMPLE
 Installing Application Server
 Run the wasce_setup-1.0.0.1.exe file on your system
21
IBM Software Group | Rational software
A system console showing output from the
Application Server Startup
22
IBM Software Group | Rational software
The login screen for the Application Server
Administration Console
23
IBM Software Group | Rational software
Operating Application Server
 Starting server
 select IBM WebSphere > Application Server Community Edition > Start
the server from the Windows Start menu
 Stopping Server
 Log in to the Administration Console and select Shutdown from its menu on
the left-hand side.
 From the Windows Start menu, select IBM WebSphere > Application
Server Community Edition > Stop the server
24
IBM Software Group | Rational software
Obtain a list of installed applications
deploy list-modules
25
IBM Software Group | Rational software
Connecting Application Server to DB2 Express-C
 Deploying a resource adapter
 Deploy JCA 1.5 resource adapter on Application Server
 Uploading the DB2 Express-C JDBC driver to the code of Application
Server
 Creating a deployment plan to deploy TranQL resource adapter,
configured with the JDBC driver
26
IBM Software Group | Rational software
Connecting Application Server to DB2 Express-C
 Uploading the DB2 JDBC driver and license JARs to Application Repository
 db2jcc.jar
 Db2jcc_license_cu.jar
27
IBM Software Group | Rational software
Connecting Application Server to DB2 Express-C
 Adding a system-wide database
pool
28
IBM Software Group | Rational software
Introducing the open source Eclipse IDE














Built-in smart editors for Java code, HTML, XML, and so on
Full syntax highlighting on all editors
Full syntax check as you enter your code
Context-sensitive code assists for supported programming languages,
including dynamic API documentation lookup
Support for the development of standard Java applications, as well as J2EE
targets, such as Web applications and Web services
Tight integration with popular version-control systems, such as Subversion and
CVS
Tight integration with popular Java build tools, such as Apache Ant
Tight integration with popular Java unit-testing frameworks, such as JUnit
Ability to control, manage, and deploy applications to servers during the test
and debug cycle
Tight integration with relational database sources through JDBC
One-click ability to find the declaration of a type or base type anywhere in the
source code
One-click ability to look up all references to a type or symbol anywhere in the
source code
Refactoring tools that assist in the often tedious, complex, and
error-prone refactoring process
29
IBM Software Group | Rational software
Features of the Eclipse IDE user interface made
available to all plug-ins
30
IBM Software Group | Rational software
Downloading and installing Eclipse
 Downloading Eclipse
eclipse-SDK-3.1.1-win32.zip from
http://download.eclipse.org/eclipse/downloads
 Unzip and install the Eclipse distribution
Double click eclipse.exe to initialize and to select workspace
31
IBM Software Group | Rational software
Eclipse SDK
32
IBM Software Group | Rational software
Connecting Eclipse to DB2 Express-C
 From the Eclipse IDE menus, select
Window > Show View > Other....
33
IBM Software Group | Rational software
Exploring the SAMPLE DB2 Express-C database
from Eclipse
34
IBM Software Group | Rational software
Working with data in the Data Output and
Database Explorer views
 Examining table schema
 Viewing the table content
 Modifying table content
 Generating Data Definition Language (DDL)
for your table
35
IBM Software Group | Rational software
Demonstration: Creating a Web application with
Eclipse and WTP
36
IBM Software Group | Rational software
Summary
 Installed and became familiar with DB2 Express-C, using its rich set of
GUI tools and command-line tools
 Installed and worked with WebSphere Application Server Community
Edition, using its Web-based Administration Console as well as the
command-line deployer tool
 Connected WebSphere Application Server Community Edition to DB2
Express-C by deploying a system-wide database pool to the DB2
database
 Installed the Eclipse IDE, the supporting Web Tools Platform, and the
WebSphere Application Server Community Edition Eclipse plug-in
 Connected Eclipse to DB2 Express-C through Eclipse's versatile
 Database Explorer view, which lets you view schema structure, see
table data content, modify data, and generate DDL
 Used Eclipse to create a Web application and deployed it to
WebSphere Application Server Community Edition with one click,
supported through Installed and became familiar with DB2 Express-C,
using its rich set of GUI tools and command-line tools
37
IBM Software Group | Rational software
Resources
 Rational and Eclipse
 http://www-306.ibm.com/software/rational/eclipse/
 developerWorks
 Rational
 http://www-128.ibm.com/developerworks/rational/
 Eclipse
 http://www.ibm.com/developerworks/opensource/top-projects/eclipse.html
 Eclipse
 www.eclipse.org
 Eclipse Technology on alphaWorks
http://www.alphaworks.ibm.com/eclipse
 Ready for IBM Rational software Plug-in Central
http://www.ibm.com/developerworks/websphere/downloads/plugin/
38
IBM Software Group | Rational software
39