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

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

CE203 - Application Programming Autumn 2013CE203 Part 51 Part 5.
Copyright  Oracle Corporation, All rights reserved. 2 Java and Databases: An Overview.
1 Lecture 05: Database Programming (JDBC). 2 Outline JDBC overview JDBC API Reading: Chapter 10.5 PostgreSQL JDBC interface documentation
JDBC. Java Database Connectivity (JDBC) Use the java.sql package to query and update the database. JDBC is an API that allows java to communicate with.
Distributed Application Development B. Ramamurthy.
1 JDBC Java Database Connectivity. 2 c.pdf
1 Lecture 05: Database Programming (JDBC). 2 Outline JDBC overview JDBC API Reading: Chapter 10.5 Pointbase Developer Manual.
Java Database Connectivity (JDBC) java.sql package to query and update the database. JDBC is an API that allows java to communicate with a database server.
Advanced Java Programming – Eran Toch Methodologies in Information System Development Tutorial: Advanced Java Programming and Database connection Eran.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Three-Tier Architecture Oracle DB Server Apache Tomcat App Server Microsoft Internet Explorer HTML Tuples HTTP Requests JDBC Requests Java Server Pages.
JDBC Java API for Database Connectivity. Layout of this recitation Introduction to JDBC API JDBC Architecture Understanding the design of JDBC API –Classes.
UFCE4Y UFCE4Y-20-3 Components and Services Julia Dawson.
Introduction to JDBC (Java Database Connectivity).
CIS 270—App Dev II Big Java Chapter 22 Relational Databases.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
CSCI 6962: Server-side Design and Programming
1 Java Database Connection (JDBC) There are many industrial-strength DBMS's commercially available in the market. Oracle, DB2, and Sybase are just a few.
Helena Pomezná, ciz034 St. skupina: L392 FEI, VŠB-TUO Ak. rok. 2002/2003 Download:
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 8 Object Oriented Programming in Java Advanced Topics Java Database.
JDBC. What is JDBC JDBC is an acronym for –Java Data Base Connectivity. It allows java/jsp program to connect to any database.
Beginning Databases with JDBC Mike Bradley Adapted from and notes by Kevin Parker, Ph.D.
October 30, 2007S. Weigert / Y. HAN1 Working with Eclipse-Ingres RUBIS Autumn 2007.
Database Environment Chapter 2 AIT632 Sungchul Hong.
MySQL, Java, and JDBC CSE 3330 Southern Methodist University.
JDBC Tutorial MIE456 - Information Systems Infrastructure II Vinod Muthusamy November 4, 2004.
JAVA Database Access. JDBC The Java Database Connectivity (JDBC) API is the industry standard for database- independent connectivity between the Java.
CS 405G: Introduction to Database Systems Database programming.
Object-Oriented Software How does it differ from procedural? How is it similar to procedural? Why has it become so popular? Does it replace or supplement.
Servlets Database Access. Agenda:  Setup Java Environment  Install Database  Install Database Drivers  Create Table and add records  Accessing a.
JDBC Java and Databases, including Postgress. JDBC l Developed by Industry leaders l Three main goals: –JDBC should be an SQL-level API –JDBC should capitalize.
 What software components are required?  How do I install the Oracle JDBC driver?  How do I connect to the database?  What form is the data in and.
JDBC  The JDBC (Java Database Connectivity) API helps a Java program to access a database in a standard way  JDBC is a specification that tells the.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
Chapter 25 Databases. Chapter Scope Database concepts Tables and queries SQL statements Managing data in a database Java Foundations, 3rd Edition, Lewis/DePasquale/Chase25.
Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.
Copyright  Oracle Corporation, All rights reserved. 7 Accessing a Database Using SQLJ.
Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0.
JDBC Database Programming in Java Prepared by., Mrs.S.Amudha AP/SWE.
JDBC. Java.sql.package The java.sql package contains various interfaces and classes used by the JDBC API. This collection of interfaces and classes enable.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Application Development Chapter 6 Sections –
COMP 321 Week 4. Overview Normalization Entity-Relationship Diagrams SQL JDBC/JDBC Drivers hsqldb Lab 4-1 Introduction.
EXAMPLE I An application showing JDBC access to Cloudscape.
JDBC and SQLJ CIS 612 Spring JDBC JDBC is an API that enables database access from Java programs JDBC for DB access provides ◦ Portability across.
1 Database Application Development Chapter 6 Sections –
Connecting to MySQL using Java By:. – Required to use Java.sql so that we can use Connection and Queries using strings. – Javax.swing.* needed for components.
Tasks Needed for MissionMapEditor Martin Q. Zhao September 18, 2010.
Access Databases from Java Programs via JDBC Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale
Advanced Java Session 5 New York University School of Continuing and Professional Studies.
Database Programming With Java & JDBC Reading: DD Ch. 18, pp al/jdbc/index.html, or anything covering JDBC.
1 Announcements Reading for next week: Chapters 6 and 7  Next-to-Last reading from the text for a little while (I promise) Your database accounts should.
1 JDBC – Java Database Connectivity CS , Spring 2010.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
Using Oracle JDBC How to Run JDBC on Your Account Communication Mechanism Using Metadata Building a Database Auto Commit v.s Atomic Transaction.
JSP/Database Connectivity Instructor: Dr. M. Anwar Hossain.
CS422 Principles of Database Systems JDBC and Embedded SQL Chengyu Sun California State University, Los Angeles.
JDBC. What is JDBC JDBC is an acronym for –Java Data Base Connectivity. It allows java program to connect to any database.
1. Writing a Java program to connect to SQL Server 2008 and Create a table Populate the table (insert data) Perform queries to retrieve information from.
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
Database Programming Basic JDBC Programming Concepts.
JDBC and OCCI 10/29/2017.
1st Semester, 2017 Sanghyun Park
Lec - 14.
JDBC – Java Database Connectivity
HW#4 Making Simple BBS Using JDBC
Prof: Dr. Shu-Ching Chen TA: Sheng Guan
Java Chapter 6 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

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

3 Ingres Business Open Source DBMS Developer IDE? Promote Ingres Uptake Promote Community Involvement

4 Eclipse Advanced Development Framework Plug-ins provide functionality Java Java IDE CDT: C/C++ IDE DTP: Data Tools Platform

5 Eclipse DTP Access to SQL Data Sources Eclipse “Look and Feel” Browse Edit View

6 Eclipse Plug-In Architecture Ingres DTP Connectivity Schema Browsing Ingres SQL Syntax Ingres DB Entities Eclipse Framework Workspace EMF GEF DTP Ingres

7 Ingres Eclipse Functionality Browse Database Objects Tables Stored Procedures Triggers (Rules) Ad Hoc SQL

8 Ingres Plug-in Overview

9 Tables Example

10 Stored Procedures Example

11 Example: Database Schema Create Audit: Table Procedure Rule

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

13 Create Table routes_added Example

14 Create Stored Procedure Example

15 Create Audit Rule Example

16 Test New Rule Example

17 Checking Rule Example Continued

18 Example: BEFORE Rule Create BEFORE Rule

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

20 Saving before procedure

21 Before Rule Example

22 Test BEFORE Trigger Example

23 Example: Develop an application Simple Application

24 Developing A Simple Application Connect to database Insert a new Country Retrieve all Countries Disconnect

25 Create Java Project

26 Add JDBC Driver Libraries Tab Add full path to iijdbc.jar

27 Create Class File  New  Class Package com.ingres.one Name CountryList Check public static void main

28 Class Member Variables // URL Components private static String demoHost = "localhost"; private static String demoPort = "AF7"; private static String demoDb = "demodb3"; private static String demoUser = "user=ingres"; private static String demoPassword = "password=my_password"; // JDBC Connection variables private static String demoDbUrl = "jdbc:ingres://" + demoHost + ":" + demoPort + "/" + demoDb + ";" + demoUser + ";" + demoPassword; private static Connection conn = null; private static Statement stmt = null; private static String tableName = "country"

29 Create method main() public static void main(String[] args) { createConnection(); System.out.println("Insert Switzerland (CH)..."); insertCountry("CH", "Switzerland"); System.out.println("Retrieve and print all countries found:"); retrieveCountries(); // Clean up removeCountry("CH"); }

30 Create Connection private static void createConnection() { try { Class.forName( "com.ingres.jdbc.IngresDriver").newInstance(); //Get a connection conn = DriverManager.getConnection(demoDbUrl); } catch (Exception except) { except.printStackTrace(); }

31 Create insertCountry() method private static void insertCountry(String countryCode, String countryName) { stmt = conn.createStatement(); stmt.execute("INSERT INTO " + tableName + "( ct_id, ct_code, ct_name )" + " VALUES (" + "NEXT VALUE FOR ct_id, '" + countryCode + "','" + countryName +"')"); stmt.close(); }

32 Retrieve and Print, 1 retrieve private static void retrieveCountries() { stmt = conn.createStatement(); ResultSet results = stmt.executeQuery( "SELECT ct_name, ct_code " + "FROM " + tableName); ResultSetMetaData rsmd = results.getMetaData(); The code to print the data is on the next slide…

33 Retrieve and Print, 2: print for (int i=1; i<=numberCols; i++) { //print Column Names System.out.print(rsmd.getColumnLabel(i)+ "\t\t"); } //print Column Names while(results.next()) { String countryName = results.getString(1); String countryCode = results.getString(2); System.out.println(countryCode + "\t\t" + countryName); } results.close(); stmt.close(); }

34 Remove added data private static void removeCountry(String countryCode) { stmt = conn.createStatement(); stmt.execute("delete from " + tableName + " where ct_code = '" + countryCode + "'"); stmt.close(); }

35 Try / Catch Error handling has been removed Try / Catch similar to: try { /* Exception generating code block */ } catch (Exception except) { except.printStackTrace(); }

36 Running Ingres Application

37 Example: Import a Project Import the source from the IFF project

38 Importing Project Source Overview

39 Launching The Application Select the project com.ingres.demoapp Context Menu: Run As…  Eclipse Application

40 Launching the Application: Example

41 Running The Application Example

42 Ingres Functionality Demonstrated Simple SELECT CountryDAO: getCountries() Dynamic SELECT AirportDAO: getRegionsByCountry() Stored Procedure AirportDAO: getAirportsByRegion()

43 Calling An Ingres Stored Procedure

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

45 Questions? Answers!

46 Introducing Eclipse DTP for Ingres An Introduction GIUA Juni 2007 J. Peel Ingres Corp Danke schön!