1 Introduction to Java Development with IDS Jean Georges Perrin IIUG GreenIvory.com JGP.net Tuesday, October 3 rd 2006 09:00 – 10:00. Platform: IDS, Java.

Slides:



Advertisements
Similar presentations
Connecting to Databases. connecting to DB DB server typically a standalone application Server runs on localhost for smaller sites –i.e. Same machine as.
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Web Services Development made easy Olivier Le Diouris Principal Product Manager.
Sergio Ferreira MoreData I16 Thursday, October 12, :30 a.m. – 11:30 a.m. Platform: Informix How to call Informix 4gl code from J2EE.
Distributed Application Development B. Ramamurthy.
Object Oriented Programming Java Java’s JDBC Allows access to any ANSI SQL-2 DBMS Does its work in terms of SQL The JDBC has classes that represent:
Advanced Java Programming – Eran Toch Methodologies in Information System Development Tutorial: Advanced Java Programming and Database connection Eran.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
Session-01. Hibernate Framework ? Why we use Hibernate ?
ODBC and JDBC What are they – libraries of function calls that support SQL statements Why do we need them –Provide a way for an application to communicate.
JDBC Java API for Database Connectivity. Layout of this recitation Introduction to JDBC API JDBC Architecture Understanding the design of JDBC API –Classes.
Creating Data Access Services Presented by Ashraf Memon Presented by Ashraf Memon.
UFCE4Y UFCE4Y-20-3 Components and Services Julia Dawson.
Jean Georges Perrin IIUG Monday, October 2 nd :30 – 14:30. Platform: IDS, EGL 4GL to EGL – Hype or Reality Session: I02.
1 INTRO TO BUSINESS COMPONENTS FOR JAVA (BC4J) Matt Fierst Computer Resource Team OracleWorld Session
1 CSC 440 Database Management Systems JDBC This presentation uses slides and lecture notes available from
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:
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Beginning Databases with JDBC Mike Bradley Adapted from and notes by Kevin Parker, Ph.D.
E-COMMERCE JOBS This project (Project number: HU/01/B/F/PP ) is carried out with the financial support of the Commssion of the European Communities.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Introduction to Java Development with IDS Jean Georges Perrin IIUG I04 Tuesday, October 3 rd :00 – 10:00. Platform: IDS, Java.
Dr. Magdi AMER Unit 2 Introduction to Database. Intro Many programs need to save information on disk. The role of DB system is to provide a layer of abstraction.
Georgia Institute of Technology Making Text for the Web part 5 Barb Ericson Georgia Institute of Technology March 2006.
MySQL, Java, and JDBC CSE 3330 Southern Methodist University.
JAVA Database Access. JDBC The Java Database Connectivity (JDBC) API is the industry standard for database- independent connectivity between the Java.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write 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.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
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.
Stored procedures1 Stored procedures and functions Procedures and functions stored in the database.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
Hibernate 3.0. What is Hibernate Hibernate is a free, open source Java package that makes it easy to work with relational databases. Hibernate makes it.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
Introduction to PHP Development with IDS Jean Georges Perrin IIUG I13 Tuesday, October 4 th :15 – 17:15. Platform: IDS, PHP.
CF101: Welcome to ColdFusion Simon Horwith CTO, Etrilogy Ltd.
JDBC Database Programming in Java Prepared by., Mrs.S.Amudha AP/SWE.
Java and Databases. JDBC Architecture Java Application JDBC API Data Base Drivers AccessSQL Server DB2InformixMySQLSybase.
EXAMPLE I An application showing JDBC access to Cloudscape.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
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.
CSI 3125, Preliminaries, page 1 JDBC. CSI 3125, Preliminaries, page 2 JDBC JDBC stands for Java Database Connectivity, which is a standard Java API (application.
Access Databases from Java Programs via JDBC Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Basics of JDBC Session 14.
ThinStructure: An Overview Support for ThinStructure demonstration. Jean Georges Perrin – Annandale, 21 st April 2004.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 8: Applications Programming for Relational Databases Instructor’s.
Introduction to JDBC Instructor: Mohamed Eltabakh 1.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
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.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Instructor: Jinze Liu Fall /8/2016Jinze University of Kentucky 2 Database Project Database Architecture Database programming.
Database Activity CEMC Steps 1. Verify Data Tools Platform is installed in Eclipse 2. Configure a Connection to Derby Create necessary table for.
The Holmes Platform and Applications
DEPTT. OF COMP. SC & APPLICATIONS
Java Access to RDB Relational databases (RDBs) dominate today, due to:
Lec - 14.
ODBC, OCCI and JDBC overview
Yii Framework – The Major Pros and Cons
HW#4 Making Simple BBS Using JDBC
Prof: Dr. Shu-Ching Chen TA: Sheng Guan
Interacting with Database
Bolat Azamat, Kim Dongmin
Java Chapter 6 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

1 Introduction to Java Development with IDS Jean Georges Perrin IIUG GreenIvory.com JGP.net Tuesday, October 3 rd :00 – 10:00. Platform: IDS, Java

2 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

3 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

4 Who am I? My Unix box usually answers…

5 Who am I (outside of a Unix box)? Jean Georges Perrin Development tools (xGL, Java EE, PHP) Works with Informix products since ’97 IIUG board member since ’02 Lives in Strasbourg, France

6 A little more… Application developer, started with Visual Basic, in the early 90s In the web since 1994 Move to 4GL in 1997 Goals: Webizing all things I touched (business apps, catalogs and i-4GL…) Find the ease of use of Visual Basic

7 And you… Who knows 4GL? Who knows Java? Who thinks Java is difficult? Who knows.net?

8 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

9 Architecture Data ApplicationJDBC Driver

10 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

11 Requirements #1 - IDS (from v7.x, but also works on OnLine and SE) Where: #2 - Java (Java SDK v5.x) Where: #3 - JDBC driver (IBM Informix JDBC 3.0) Where: #4 - Option: Eclipse (v3.2.1) Where:

12 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

13 Your very first cup of Java Hello, world… in Java Use of “javac” Use of “java” Code snippet: package org.iiug.test; public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world..."); } Source code is self organizing in packages Modules are organized in classes main {…} is MAIN … END MAIN “Hello, world…” is always the same, in any language… fglpc fglgo

14 Java Pros & Cons Object Oriented (OO) development Event driven programming model User Interface (UI) & Business Logic (BL) tightly linked Open architecture, open standards General purpose development language Industry standard Looks like “hype” to developers

15 4GL Pros & Cons Procedural development “Controlled” events UI and BL somehow separated (.per &.4gl) Proprietary solution Business apps development language Not a standard in industry Hard to attract new developers

16 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

17 JDBC Types of driver (annoying theory) Standard way of talking to a database (forget about SQL/J) Use a URL, for IBM Informix: jdbc:informix-sqli://popeye:1526/stores_demo: informixserver=ol_popeye; user=informix; password=informix

18 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

19 Your first application using the Command Prompt Understand the role of the “CLASSPATH” Full source code (copy / paste): import java.sql.*; public class MyFirstJDBCConnection { public static void main(String[] args) { // Define my local variables Connection myConnection; Statement myStatement; ResultSet myResultSet; // Loading driver try { System.out.println(">> Loading the driver"); Class.forName("com.informix.jdbc.IfxDriver"); } // end try catch (ClassNotFoundException e) { System.out.println("ERROR: Failed to load IBM Informix JDBC driver."); return; } // end catch

20 Your first application (2) try { // Connection to database System.out.println(">> Connecting to the database"); myConnection = DriverManager.getConnection ("jdbc:informix-sqli://popeye:1526/stores_demo: informixserver=ol_popeye;user=informix;password=informix", "", ""); // Statement creation System.out.println(">> Creating the statement"); myStatement = myConnection.createStatement(); // Resultset creation & execution System.out.println(">> Executing the query"); myResultSet = myStatement.executeQuery ("SELECT fname, lname, customer_num FROM customer ORDER BY lname"); // Outputting the result System.out.println(">> Step 4 - Dumping data"); while (myResultSet.next()) { System.out.println ( myResultSet.getString("fname") + myResultSet.getString("lname") + " (" + myResultSet.getString("customer_num") + ")"); }

21 Your first application (3) // Cleaning System.out.println(">> Cleaning"); myResultSet.close(); myStatement.close(); myConnection.close(); } // end try catch (SQLException e) { System.out.println("ERROR: SQL exception: " + e.getMessage()); e.printStackTrace(); return; } // end catch } // end main } // end class

22 Declaring objects to use Code snippet: The “Connection” is the real connection to the database, it is (re)created each time. Except when using “connection pooling”. The “Statement” is the real orders or queries to the database. The “ResultSet” contains a link to the data. // Define my local variables Connection myConnection; Statement myStatement; ResultSet myResultSet; Connection = DATABASE Statement = STATEMENT ResultSet = ARRAY OF RECORD / CURSOR

23 Loading the driver Code snippet: Drivers are uniquely named, for IBM Informix: // Loading driver try { System.out.println(">> Loading the driver"); Class.forName("com.informix.jdbc.IfxDriver"); } // end try catch (ClassNotFoundException e) { System.out.println("ERROR: Failed to load IBM Informix JDBC driver."); return; } // end catch com.informix.jdbc.IfxDriver

24 Connecting to the database Code snippet: // Connection to database System.out.println(">> Connecting to the database"); myConnection = DriverManager.getConnection ("jdbc:informix-sqli://popeye:1526/stores_demo: informixserver=ol_popeye;user=informix;password=informix", "", "");

25 Statement & Execution Code snippet: // Statement creation System.out.println(">> Creating the statement"); myStatement = myConnection.createStatement(); // Resultset creation & execution System.out.println(">> Executing the query"); myResultSet = myStatement.executeQuery ("SELECT fname, lname, customer_num FROM customer ORDER BY lname");

26 Looping around Code snippet: // Outputting the result System.out.println(">> Step 4 - Dumping data"); while (myResultSet.next()) { System.out.println ( myResultSet.getString("fname") + myResultSet.getString("lname") + " (" + myResultSet.getString("customer_num") + ")"); }

27 Cleaning Code snippet: Not only cleaning Exception Handling! // Cleaning System.out.println(">> Cleaning"); myResultSet.close(); myStatement.close(); myConnection.close(); } // end try catch (SQLException e) { System.out.println("ERROR: SQL exception: " + e.getMessage()); e.printStackTrace(); return; } // end catch } // end main } // end class

28 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

29 Your first application using Eclipse Create a project Add the library Create the class Run it

30 Agenda Who am I? Architecture Requirements Your very first cup of Java JDBC Your first application using the Command Prompt Your first application using Eclipse Your first application using a framework

31 Your first application using a framework Goals of a framework Ease of use Small learning curve Database connectivity Business logic

32 BlueGazelle Open Source framework Soon to be downloadable from

33 BlueGazelle Source Code Code snippet: Database myDatabase = null; Record myRecord = null; Record myRow = null; int count = 0; int i = 0; try { myDatabase = Databases.connect("stores_demo"); myRecord = myDatabase.createRecordFromSelect("SELECT fname, lname, customer_num FROM customer ORDER BY lname"); count = myRecord.getCount(); for (i = 0; i < count; i++) { myRow = myRecord.getRecordAt(i); System.out.println(myRow.getString("fname") + myRow.getString("lname") + " (" + myRow.getString("customer_num") + ")"); } catch (Exception e) { System.out.println("ERROR: Exception raised: " + e.getMessage()); e.printStackTrace(); } // end catch

34 Conclusion Java offers a standard way of accessing data. Java is working in a distributed environment. Frameworks simplify the developers’ life.

35 Complexity & Features Level of complexity / feature of languages over time Easy Difficult 4GL PHP OO in PHP 4 Zend Framework? PHP 5 J2EE Java SE 5 Eclipse Java Java EE 5

36 And now… Come to see me in San Jose (May 2007) Full Java Educational Seminar (you need to stand me for 3 hours) “Introduction to EJB3 dev. with IDS and Viper” I think I have a session or two on XML (Give me good marks so I can be selected as best speaker of the conference and beat Darryl, Lester and Art - previous speakers and enter Hall of Fame).

37 And now (seriously)… Download Eclipse (I guess you all have IDS already) Get a book (O’Reilly has quite a few great books) Join the development-tools forum on IIUG web site Get started with a few examples Come back to me

38 Introduction to Java Development with IDS Thanks for your patience Come back to me…