Introduction JDBC 4.1. Bok, Jong Soon

Similar documents
JDBC. Sun Microsystems has included JDBC API as a part of J2SDK to develop Java applications that can communicate with databases.

JDBC SHORT NOTES. Abstract This document contains short notes on JDBC, their types with diagrams. Rohit Deshbhratar [ address]

About Database Adapters

JDBC. Oracle ODBC SP API SP API. SQL server C function calls. SQL server ODBC SP API. Oracle DSN Oracle ODBC Oracle

Enterprise Java Unit 1- Chapter 6 Prof. Sujata Rizal

JDBC Drivers Type. JDBC drivers implement the defined interfaces in the JDBC API for interacting with your database server.

DQpowersuite. Superior Architecture. A Complete Data Integration Package

(C) Global Journal of Engineering Science and Research Management

QuickSpecs. ISG Navigator for Universal Data Access M ODELS OVERVIEW. Retired. ISG Navigator for Universal Data Access

UNIT-3 Java Database Client/Server

Client/Server-Architecture

Database connectivity (I) ()

Database Server. 2. Allow client request to the database server (using SQL requests) over the network.

Kyle Brown Knowledge Systems Corporation by Kyle Brown and Knowledge Systems Corporation

Database System Concepts and Architecture

Top 50 JDBC Interview Questions and Answers

Database System Concepts and Architecture. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Overview. Database Application Development. SQL in Application Code. SQL in Application Code (cont.)

Database Application Development

Database Application Development

JDBC Today C HAPTER 1 INTRODUCTION

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2-1

Testing JDBC Applications Using DataDirect Test for JDBC

Database System Concepts and Architecture

Introducing the SAS ODBC Driver

Questions and Answers. A. A DataSource is the basic service for managing a set of JDBC drivers.

ITP 140 Mobile Technologies. Databases Client/Server

Several major software companies including IBM, Informix, Microsoft, Oracle, and Sybase have all released object-relational versions of their

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies

SAS ODBC Driver. Overview: SAS ODBC Driver. What Is ODBC? CHAPTER 1

Lecture 2. Introduction to JDBC

PESIT Bangalore South Campus

CSE 308. Database Issues. Goals. Separate the application code from the database

ArcSDE 8.1 Questions and Answers

How to Configure Informix Connect and ODBC

The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets

OBJECT-RELATIONAL COMPONENT APPROACHES: A COMPARISON

CBRN Data Import/Export Tool (CDIET) Presented by: Darius Munshi

Programming in Java

Creating Enterprise and WorkGroup Applications with 4D ODBC

Chapter 1 An introduction to relational databases and SQL

Fundamentals of Information Systems, Seventh Edition

Java and the Java DataBase Connectivity (JDBC) API. Todd Kaufman April 25, 2002

Oracle Database Heterogeneous Connectivity User Guide

Chapter 3 DB-Gateways

e-pg Pathshala Subject: Computer Science Paper: Web Technology Module: JDBC INTRODUCTION Module No: CS/WT/26 Quadrant 2 e-text

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

JDBC 3.0. Java Database Connectivity. 1 Java

Why use a database? You can query the data (run searches) You can integrate with other business systems that use the same database You can store huge

Chapter 2 FEATURES AND FACILITIES. SYS-ED/ Computer Education Techniques, Inc.

History of Enterprise Java

JDBC - INTERVIEW QUESTIONS

Migrating 4GL Applications

Overview. ❶ Short introduction to the company. ❶ Short history of database and DBMS. ❶ What is the next DBMS s generation? ❶ Introduction to Tamino

Crystal Reports. Overview. Contents. Open Database Connectivity (ODBC)

Chapter 3 DB-Gateways

Store and Manage Data in a DBMS With ArcView Database Access. Presented By: Andrew Arana & Canserina Kurnia

1. PhP Project. Create a new PhP Project as shown below and click next

Database Applications

IBM QMF for Windows for IBM iseries, V7.2 Business Intelligence Starts Here!

SAP Automation (BC-FES-AIT)

UNIT III - JDBC Two Marks

SQL in a Server Environment

Unit 3 - Java Data Base Connectivity

COMMUNICATION PROTOCOLS

Database Fundamentals Chapter 1

CS108 Lecture 18: Databases and SQL

Elixir Data Designer User Manual

Crystal Reports 2008 with Service Pack 0

1Z Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions

DBC. Database Connectivity

Java Training For Six Weeks

Overview Guide. Mainframe Connect 15.0

Practical Database Design Methodology and Use of UML Diagrams Design & Analysis of Database Systems

DBMS (FYCS) Unit - 1. A database management system stores data in such a way that it becomes easier to retrieve, manipulate, and produce information.

JDBC [Java DataBase Connectivity]

The DCOM Connector HELP.BCMIDDCOM. Release 4.6C

J2EE Internet Store An Example of Building an Enterprise Web Application

Hyperion System 9 BI+ Analytic Services

Database Server. Database Database Database

Asst.Prof.Eng. IOAN-GHEORGHE RAŢIU, PhD Asst.Prof. NICOLETA DAVID. George Bariţiu University, Braşov

Discuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity

JDBC 2.0 (Java Database Connectivity)

Lecture #14 ADVANCED DATABASE SYSTEMS. // // Spring 2018

Designing a Distributed System

The functions performed by a typical DBMS are the following:

Intoduction to JDBC (Java Database Connectivity-- Connecting to DBMS)

Introduction To Web Architecture

Cincom Smalltalk. ObjectStudio. Database User s Guide P ObjectStudio 8.3

It Is a Difficult Question! The Goal of This Study. Specification. The Goal of This Study. History. Existing Benchmarks

BusinessObjects Data Services XI 3.1 SP1 for Windows

Hyperion System 9 Financial Management release

Database Application Development

Unify NXJ が サポートする構成 Release 12

You write standard JDBC API application and plug in the appropriate JDBC driver for the database the you want to use. Java applet, app or servlets

1. Data Model, Categories, Schemas and Instances. Outline

Persisting Result Sets as XML Data Files

Java J Course Outline

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 8 Advanced SQL

Database Programming With JDBC & Java: Developing Multi-Tier Applications (Java (O'Reilly)) By George Reese READ ONLINE

Transcription:

Introduction JDBC 4.1 Bok, Jong Soon javaexpert@nate.com www.javaexpert.co.kr

What is the JDBC TM Stands for Java TM Database Connectivity. Is an API (included in both J2SE and J2EE releases) Provides Cross-DBMS connectivity to a wide range of SQL database Access to other tabular data sources such as spreadsheets or flat files. The JDBCTM API provides universal data access from the JavaTM programming language. Sun drew upon the successful aspects of one such API, ODBC.

JDBC Architecture

Open DataBase Connectivity (ODBC) Was developed to create a single standard for database access in the Windows environment. Does not translate well into the Java world. Is a C API that requires intermediate APIs for other languages.

The JDBC API versus ODBC ODBC is not appropriate for direct use. Calls from Java to native C code have a number of drawbacks in the security, implementation, robustness, and automatic portability of applications. A literal translation of the ODBC C API into a Java API would not be desirable. Java has not pointers, and ODBC makes copious use of them. ODBC is hard to learn. It mixes simple and advanced features together, and it has complex options even for simple queries. A Java programmer using JDBC does not need to worry about either memory management or data byte alignment.

The JDBC API Packages Provides programmatic access to relational data from the Java programming language. Can be used to interact with multiple data sources in a distributed, heterogeneous environment. Introduce in January 1997. java.sql javax.sql Automatically get both packages when you download the Java TM 2 Platform, Standard Edition, Version 7 (J2SE TM )

The JDBC API versus ODBC (Cont.) A Java API like JDBC is needed in order to enable a pure Java solution. When ODBC is used, the ODBC driver manager and drivers must be manually installed on every client machine. When the JDBC driver is written completely in Java, JDBC code is automatically installable, portable, and secure on all Java platforms, from network computers to mainframes. The JDBC 3.0 API includes functionality that is not available with ODBC. ODBC does not support SQL99 data types, autogenerated keys, or savepoints.

Two-tier Model

Two-tier Model (Cont.) Talks directly to the data source. Requires a JDBC driver that can communicate with the particular data source being accessed. The data source may be located on another machine to which the user is connected via a network. Is referred to as a client/server configuration.

Three-tier Model

Three-tier Model (Cont.) Commands are sent to a middle tier of services, which then sends the commands to the data source. The data source processes the commands and sends the results back to the middle tier, which then sends them to the user. The middle tier makes it possible to maintain control over access and the kinds of updates that can be corporate data. Another advantage is that it simplifies the deployment of applications.

SQL Conformance Problems : SQL is not yet as standard as one would like. Data types used by different DBMSs sometimes vary, and the variations can be significant. Although most DBMSs use a standard form of SQL for basic functionality, they do not conform to the more recently defined standard SQL syntax or semantics for more advanced functionality. Not all databases support stored procedures or outer joins, and those that do are not always consistent with each other. Support for SQL99 features and data types varies greatly.

SQL Conformance (Cont.) Solutions with JDBC : To define a set of generic SQL type identifiers in the class java.sql.types. To allow any query string to be passed through to an underlying DBMS driver. To provide ODBC-style escape clauses. Provides descriptive information about the DBMS by means of the interface DatabaseMetaData so that applications can adapt to the requirements and capabilities of each DBMS. A JDBC driver must support at least ANSI SQL92 Entry Level.

JDBC Driver Types

JDBC Driver Types (Cont.) JDBC-ODBC bridge driver plus ODBC driver The Sun Microsystems bridge product provides JDBC access via ODBC drivers. Note that ODBC binary code, and in many cases database client code, must be loaded on each client machine that uses this driver. Using ODBC requires configuring on your system a Data Source Name (DSN) that represents the target database. When Java first came out, this was a useful driver because most databases only supported ODBC access.

JDBC Driver Types (Cont.) JDBC-ODBC bridge driver plus ODBC driver

JDBC Driver Types (Cont.) Native-API partly Java driver This kind of driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, IBM DB2, or other DBMSs. Note that, like the bridge driver, this style of driver requires that some operating system-specific binary code be loaded on each client machine. Calls are converted into native C/C++ API calls which are unique to the database. These drivers typically provided by the database vendo rs and used in the same manner as the JDBC-ODBC B ridge, the vendor-specific driver must be installed on e ach client machine.

JDBC Driver Types (Cont.) Native-API partly Java driver

JDBC Driver Types (Cont.) JDBC-Net pure Java driver A three-tier approach is used to accessing databases. The JDBC clients use standard network sockets to communicate with an middleware application server. The socket information is then translated by the middleware application server into the call format required by the DBMS, and forwarded to the database server. This kind of driver is extremely flexible, since it requires no code installed on the client and a single driver can actually provide access to multiple databases.

JDBC Driver Types (Cont.) JDBC-Net pure Java driver

JDBC Driver Types (Cont.) Native-protocol pure Java driver This kind of driver converts JDBC calls directly into the network protocol used by DBMSs. This allows a direct call from the client machine to the DBMS server and is an excellent solution for intranet access. Several that are now available include Oracle, Sybase, IBM DB2, Borland InterBase, and Microsoft SQL Server.

JDBC Driver Types (Cont.) Native-protocol pure Java driver

JDBC Driver Types (Cont.)

Which Driver Should be Used? If you are accessing one type of database, such as Oracle, Sybase, or IBM, the preferred driver type is 4. If your Java application is accessing multiple types of databases at the same time, type 3 is the preferred driver. Type 2 drivers are useful in situations where a type 3 or type 4 driver is not available yet for your database. The type 1 driver is not considered a deployment-level driver and is typically used for development and testing purposes only.

JDBC Driver Types (Cont.) Driver Category All Java Network Connection JDBC-ODBC Bridge No Direct Native API as basic No Direct JDBC-Net Client, Yes server, Maybe Indirect Native protocol as basic Yes Direct

Related Resources JDBC TM Home http://www.oracle.com/technetwork/java/javase/jdbc/in dex.html Java DB Home http://docs.oracle.com/javadb/index_jdk8.html JDBC TM Database Access Tutorial http://docs.oracle.com/javase/tutorial/jdbc/