Java JDBC API. A Java API To Access almost any kind of tabular data To Access almost any kind of tabular data Trademarked (not an acronym) Trademarked.

Slides:



Advertisements
Similar presentations
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Advertisements

Distributed Application Development B. Ramamurthy.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
ODBC and JDBC Aggie Hoversten CSCI Fall 1999.
JDBC Overview Autumn 2001 Lecturer: C. DeJong. Relational Databases widespread use used via SQL (Structured Query Language) freely available powerful.
Integration case study Week 8 – Lecture 1. Enrolment request (Workstation) Application server Database server Database New University Student Record System.
1 Lecture 29 More on JDBC Overview  Objectives of this lecture  JDBC and its Drivers  Connecting to Databases (Java’s Connection class)  Querying a.
Database Management Systems 1 Xintao Wu Oracle Programming Instructor: Xintao Wu.
Database Management Systems 1 Xintao Wu Oracle Programming Instructor: Xintao Wu.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
Web-based Software Development - An introduction.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Dale Roberts 8/24/ Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
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.
Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and client-side Oracle JDBC drivers provide the same basic functionality.
Helena Pomezná, ciz034 St. skupina: L392 FEI, VŠB-TUO Ak. rok. 2002/2003 Download:
Database Management Systems 1 Oracle Programming.
JDBC. What is JDBC JDBC is an acronym for –Java Data Base Connectivity. It allows java/jsp program to connect to any database.
CSE470 Software Engineering Fall Database Access through Java.
C# A 1 CSC 298 Introduction to C#. C# A 2 What to expect in this class  Background: knowledge of an object oriented language of the C++, Java, … family.
JDBC. JDBC Drivers JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
Designing and Developing WS B. Ramamurthy. Plans We will examine the resources available for development of JAX-WS based web services. We need an IDE,
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
CS 405G: Introduction to Database Systems Database programming.
Module Overview n Module Title: OO Programming n Module Code: MIT3446 n Module Value: 3.0 n Duration: 15 weeks n Class-Contact Hours: Lecture15 hrs n Lab/Tutor30hrs.
Overview of JDBC and Pro*C 1 CSE 5330 – Database Systems.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Java + XML. Java 2 Enterprise Edition Server Side java Servlets JSP JavaBeans Web Services Database jdbc.
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.1 Basics of Java Produced by Harvey Peters, 2008 Copyright.
Stored procedures1 Stored procedures and functions Procedures and functions stored in the database.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
Java Database Connectivity. Java and the database Database is used to store data. It is also known as persistent storage as the data is stored and can.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
We will talking about story of JAVA language. By Kristsada Songpartom.
CT1513 Introduction To java © A.AlOsaimi.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
PHP Workshop ‹#› PHP Data Object (PDO). PHP Workshop ‹#› What is PDO? PDO is a PHP extension to formalise PHP's database connections by creating a uniform.
Java and Databases. JDBC Architecture Java Application JDBC API Data Base Drivers AccessSQL Server DB2InformixMySQLSybase.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
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.
Database Connectivity and Server-Side Scripting Chapter 12.
Java – in context Main Features From Sun Microsystems ‘White Paper’
ViaSQL Technical Overview. Viaserv, Inc. 2 ViaSQL Support for S/390 n Originally a VSE product n OS/390 version released in 1999 n Identical features.
JDBC Chapter 1 JDBC Introduction
Intro to JDBC Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL.
Introduction to Programming 1 1 2Introduction to Java.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Applications Active Web Documents Active Web Documents.
Web-based Software Development - An introduction
Accessing the Database Server: ODBC, OLE DB, and ADO
Advanced Web Automation Using Selenium
HW#4 Making Simple BBS Using JDBC
Introduction Enosis Learning.
Prof: Dr. Shu-Ching Chen TA: Sheng Guan
Introduction Enosis Learning.
Mr. Harish Sharma Asst. Professor Dept. of CA & IT SGRRITS Dehradun
JDBC – ODBC DRIVERS.
Introduction CSC 111.
ODBC and JDBC.
Chap 1. Getting Started Objectives
Presentation transcript:

Java JDBC API

A Java API To Access almost any kind of tabular data To Access almost any kind of tabular data Trademarked (not an acronym) Trademarked (not an acronym) A set of classes and interfaces written in Java A set of classes and interfaces written in Java Supports all dialects of SQL Supports all dialects of SQL Goes beyond SQL: makes it possible to interact with other kinds of data sources such as files containing tabular data Goes beyond SQL: makes it possible to interact with other kinds of data sources such as files containing tabular data

Features Can access almost any data source Can access almost any data source Can run on any platform with a Java Virtual Machine Can run on any platform with a Java Virtual Machine

Examples Possible to publish a web page containing an applet that uses information obtained from a remote data source Possible to publish a web page containing an applet that uses information obtained from a remote data source A company can connect all employees (using a collection of Windows, Mac, UNIX machines) to internal databases through an intranet A company can connect all employees (using a collection of Windows, Mac, UNIX machines) to internal databases through an intranet One can write a single program to send SQL statements to, e.g., an Oracle DB, a Sybase DB, and IBM DB2 DB. One can write a single program to send SQL statements to, e.g., an Oracle DB, a Sybase DB, and IBM DB2 DB.

What Does the Java API Do? 1. Establish a connection with a data source 2. Send queries and update statements to the data source 3. Process the results

Code Snippet Connection con = DriverManager.getConnection( “myLogin”, “myPasswd”); “myLogin”, “myPasswd”); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(“select lname from employee”); while (rs.next()) System.out.println(rs.getString(1)); System.out.println(rs.getString(1)); stmt.close(); stmt.close();

JDBC is similar to ODBC An API for accessing data stores An API for accessing data stores But But It is partly written in C and so loses Java’s portability, security It is partly written in C and so loses Java’s portability, security JDBC is simpler than ODBC JDBC is simpler than ODBC JDBC is written in Java for Java applications JDBC is written in Java for Java applications

JDBC Application (2-Tier Model) Java Application JDBC DBMS

JDBC Applet (3-Tier Model) Browser (Java Applet) Java Program JDBC DBMS

Java Strengths Java is portable Java is portable Java is object-oriented Java is object-oriented Large library of classes and interfaces Large library of classes and interfaces Examples Examples Applets Applets Graphics Graphics Sql Sql Security Security

Continued Java makes it easier to write correct code Java makes it easier to write correct code Automatic garbage collection Automatic garbage collection No pointers No pointers Strong typing Strong typing Exception handling Exception handling Simplicity (no templates or multiple inheritance) Simplicity (no templates or multiple inheritance)

Continued Security Features Security Features Memory layout is determined at run-time (unlike c/c++ where compiler makes layout decisions) Memory layout is determined at run-time (unlike c/c++ where compiler makes layout decisions) Therefore, a programmer can’t look at a class def. and figure out how it might be laid out Therefore, a programmer can’t look at a class def. and figure out how it might be laid out JVM checks incoming code for forged pointers, access restrictions JVM checks incoming code for forged pointers, access restrictions Classes from across the network can’t be substituted for built-in classes Classes from across the network can’t be substituted for built-in classes Built-in classes can’t accidentally reference classes from across the network. Built-in classes can’t accidentally reference classes from across the network.