38
1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

Embed Size (px)

Citation preview

Page 1: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

1

Introducing Eclipse DTP for

Ingres

An IntroductionGIUA Juni 2007

J. Peel Ingres Corp

Page 2: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

2

Overview

• Open Source Development Tool

• Eclipse, DTP and Ingres

• Database Browsing and Editing

• Examples

Page 3: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

3

Ingres

• Business Open Source DBMS

• Developer IDE?

• Promote Ingres Uptake

• Promote Community Involvement

Page 4: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

4

Eclipse

• Advanced Development Framework

• Plug-ins provide functionality

• Java

• Java IDE

• CDT: C/C++ IDE

• DTP: Data Tools Platform

Page 5: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

5

Eclipse DTP

• Access to SQL Data Sources

• Eclipse “Look and Feel”

• Browse

• Edit

• View

Page 6: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

6

Eclipse Plug-In Architecture

Ingres DTP

• Connectivity

• Schema Browsing

• Ingres SQL Syntax

• Ingres DB Entities

Eclipse Framework

Workspace

EMF

GEF

DTP Ingres

Page 7: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

7

Ingres Eclipse Functionality

• Browse Database Objects• Tables• Stored Procedures• Triggers (Rules)

• Ad Hoc SQL

Page 8: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

8

Ingres Plug-in Overview

Page 9: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

9

Tables Example

Page 10: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

10

Stored Procedures Example

Page 11: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

11

Example: Database Schema

Create Audit:

Table

Procedure

Rule

Page 12: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

12

Database Schema Development

• Audit New Routes Added

• New Schema Components:

Audit Table: route_new

Stored Procedure:

route_add_dbp

Trigger on Table:

route_add_rul

Page 13: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

13

Create Table routes_added Example

Page 14: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

14

Create Stored Procedure Example

Page 15: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

15

Create Audit Rule Example

Page 16: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

16

Test New Rule Example

Page 17: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

17

Checking Rule Example Continued

Page 18: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

18

Example: BEFORE Rule

Create BEFORE Rule

Page 19: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

19

Before Rule

• New in 2006r2

• Triggers before Ingres updates the base table

• Prevent unwanted updates

• For Example• Where no flight slots available

• Procedure and BEFORE Rule

Page 20: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

20

Saving before procedure

Page 21: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

21

Before Rule Example

Page 22: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

22

Test BEFORE Trigger Example

Page 23: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

23

Example: Develop an application

Simple Application

Page 24: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

24

Developing A Simple Application

• Connect to database

• Insert a new Country

• Retrieve all Countries

• Disconnect

Page 25: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

25

Create Java Project

Page 26: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

26

Add JDBC Driver

• Libraries Tab

• Add full path to iijdbc.jar

Page 27: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

27

Create Class

• File New Class

• Package• com.ingres.one

• Name• CountryList

• Check• public static void main

Page 28: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

36

Running Ingres Application

Page 29: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

37

Example: Import a Project

Import the source from the IFF project

Page 30: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

38

Importing Project Source Overview

Page 31: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

39

Launching The Application

• Select the project com.ingres.demoapp

• Context Menu:

• Run As… Eclipse Application

Page 32: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

40

Launching the Application: Example

Page 33: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

41

Running The Application Example

Page 34: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

42

Ingres Functionality Demonstrated

• Simple SELECT• CountryDAO: getCountries()

• Dynamic SELECT• AirportDAO: getRegionsByCountry()

• Stored Procedure• AirportDAO: getAirportsByRegion()

Page 35: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

43

Calling An Ingres Stored Procedure

Page 36: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

44

Summary Eclipse and Ingres DTP plug-in

• Browse Database

• Ad hoc SQL

• Work with: Tables, Procedures, Triggers

• Examples• Develop Schema• BEFORE TRIGGER• Simple Application• Import IFF Demo

Page 37: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

45

Questions?

• Answers!

Page 38: 1 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp

46

Introducing Eclipse DTP for

Ingres

An IntroductionGIUA Juni 2007

J. Peel Ingres Corp

Danke

sch

ön!