Database Access via Programming Languages



Similar documents
Chapter 9, More SQL: Assertions, Views, and Programming Techniques

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications

CS346: Database Programming.

Introductory Concepts

SQL and Programming Languages. SQL in Programming Languages. Applications. Approaches

DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC?

Programming Database lectures for mathema

Real SQL Programming 1

Consolidate by Migrating Your Databases to Oracle Database 11g. Fred Louis Enterprise Architect

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language:

Database Applications with VDBT Components

SQL: Programming. Introduction to Databases CompSci 316 Fall 2014

<Insert Picture Here> Move to Oracle Database with Oracle SQL Developer Migrations

Using SQL Developer. Copyright 2008, Oracle. All rights reserved.

Version Overview. Business value

Benchmarks of SQL Query Performance for ODBC and Oracle Call Interface

Embedded SQL. Unit 5.1. Dr Gordon Russell, Napier University

SequeLink Server for ODBC Socket

2015, André Melancia (Andy.PT) 1

ICOM 6005 Database Management Systems Design. Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 August 23, 2001

Latte Rapid Application Development. William Dunlap Product Manager Borland International

The Plan Today... System Calls and API's Basics of OS design Virtual Machines

CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University

Mimer SQL. Programmer s Manual. Version 8.2 Copyright 2000 Mimer Information Technology AB

DB2 Application Development and Migration Tools

InterBase 6. Embedded SQL Guide. Borland/INPRISE. 100 Enterprise Way, Scotts Valley, CA

Oracle Database. New Feature in Oracle Database 11g Release 2 ( ) Products Available on the Oracle Database Examples Media

12 Embedding SQL in Programming languages

Oracle Database. Products Available on the Oracle Database Examples Media. Oracle Database Examples. Examples Installation Guide 11g Release 2 (11.

ODBC Chapter,First Edition

1 File Processing Systems

SOLUTION BRIEF. Advanced ODBC and JDBC Access to Salesforce Data.

DataDirect XQuery Technical Overview

How to Configure Informix Connect and ODBC

More SQL: Assertions, Views, and Programming Techniques

Accessing SQL Server Data from Oracle on Linux. for FREE!

Embedded SQL programming

Elements of Advanced Java Programming

SQL and programming languages

Release: 1. ICADBS412A Build a database

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

LAMP Server A Brief Overview

PROGRESS DATADIRECT QA AND PERFORMANCE TESTING EXTENSIVE TESTING ENSURES DATA CONNECTIVITY THAT WORKS

Database Programming. Week *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford

Querying Databases Using the DB Query and JDBC Query Nodes

Course Objectives. Database Applications. External applications. Course Objectives Interfacing. Mixing two worlds. Two approaches

Oracle SQL Developer Migration

LISTSERV LDAP Documentation

Advantage Database Server or Microsoft SQL Server which one is right for you?

FOCUS ON: FDR/UPSTREAM S ONLINE DATABASE SOLUTIONS

Short notes on webpage programming languages

System requirements. Java SE Runtime Environment(JRE) 7 (32bit) Java SE Runtime Environment(JRE) 6 (64bit) Java SE Runtime Environment(JRE) 7 (64bit)

Client/server is a network architecture that divides functions into client and server

Achieving Database Interoperability Across Data Access APIs through SQL Up-leveling

SQL Pass-Through and the ODBC Interface

12 Embedding SQL in Programming languages

Oracle SQL Developer for Database Developers. An Oracle White Paper September 2008

ANDROID DEVELOPER RESUME USA

Why developers should use ODBC instead of native proprietary database interfaces

FileMaker 11. ODBC and JDBC Guide

SQL/PSM. Outline. Database Application Development Oracle PL/SQL. Why Stored Procedures? Stored Procedures PL/SQL. Embedded SQL Dynamic SQL

Migration to SQL Server With Ispirer SQLWays 6.0

Consulting. Personal Attention, Expert Assistance

TEST AUTOMATION FRAMEWORK

APPENDIX III - Role definitions and required skills, by category. Application Development Category

A Database Re-engineering Workbench

Data Sheet VISUAL COBOL WHAT S NEW? COBOL JVM. Java Application Servers. Web Tools Platform PERFORMANCE. Web Services and JSP Tutorials

Database System Architecture & System Catalog Instructor: Mourad Benchikh Text Books: Elmasri & Navathe Chap. 17 Silberschatz & Korth Chap.

Writing Scripts with PHP s PEAR DB Module

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

HP Vertica Integration with SAP Business Objects: Tips and Techniques. HP Vertica Analytic Database

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages

WHITE PAPER. Domo Advanced Architecture

The C Programming Language course syllabus associate level

Procase Consulting. APEX 4.1 Introduction. Oleg Mochkin

Failover Support. DataDirect Connect for ODBC Drivers. Introduction. Connection Failover

Module File Cache for NonStop SQL/MX

FileMaker 12. ODBC and JDBC Guide

Application Development Guide: Building and Running Applications

INTRODUCTION ADVANTAGES OF RUNNING ORACLE 11G ON WINDOWS. Edward Whalen, Performance Tuning Corporation

BarTender Integration Methods. Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER

LISTE DES DOCUMENTS ORACLE

WEB DATABASE PUBLISHING

OBJECTSTUDIO. Database User's Guide P

How To Develop A Web Dialog For An Org Database With A Database On A Computer (Oracle)

Basic Unix/Linux 1. Software Testing Interview Prep

DBX. SQL database extension for Splunk. Siegfried Puchbauer

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Microsoft Access is an outstanding environment for both database users and professional. Introduction to Microsoft Access and Programming SESSION

Sagent DataFlow Supported Databases

Generating XML from Relational Tables using ORACLE. by Selim Mimaroglu Supervisor: Betty O NeilO

White paper FUJITSU Software Enterprise Postgres

Transcription:

Database Access via Programming Languages SQL is a direct query language; as such, it has limitations. Some reasons why access to databases via programming languages is needed : Complex computational processing of the data. Specialized user interfaces. Access to more than one database at a time. Desirable features of such systems: Ease of use. Simplicity of implementation. Conformance to standards for existing programming languages and database query languages. Interoperability: the ability to use a common interface to diverse database systems. 20061107:slides10:page 1 of 9

A Closer Look at Interoperability Consider SQL: it is a standard direct query language which may be used with virtually any relational database system. Question: To what extent can a similar standard be attained which focuses upon embedding SQL-style query support within a powerful programming language? Some desirable properties: Make use of existing standards for database queries (e.g., SQL). Make use of existing standards for programming languages (e.g., C, C++, Ada, etc.) Make use of existing development environments for programming languages (e.g., Borland C++, Microsoft Visual C++, Anjuta DevStudio, CodeForge, etc.). Admit (possibly simultaneous) access to a diverse collection of database systems (e.g., Oracle, Sybase, Microsoft, Interbase products) usinga common syntax and semantics. Solutions should not depend upon characteristics of particular operating systems. Rather, they should be available on a variety of systems, such as Microsoft Windows, Mac OS, Linux, and UNIX, without having to depend upon the OS vendor for DBMS-specific support. 20061107:slides10:page 2 of 9

Vendor-specific solutions: Oracle PL/SQL: A proprietary PL/1-like language which supports the execution of SQL queries: Advantages: Many Oracle-specific features, not common to other systems, are supported. Performance may be optimized to Oraclebased systems. Disadvantages: Ties the applications to a specific DBMS. The application programmer must depend upon the vendor for the application development environment. It may not be available for all platforms. Microsoft VBA (Visual Basic for Applications) support for MS Access: Advantages: Uses the common Microsoft application language VBA. Disadvantages: Totally specific to Microsoft systems. Although they have some obvious advantages, these solutions do not embody interoperability. 20061107:slides10:page 3 of 9

Vendor-independent solutions based upon SQL: There are three basic strategies which may be considered: Embedded SQL SQL modules SQL call level interfaces. 20061107:slides10:page 4 of 9

Embedded SQL: In this strategy, calls to SQL statements are embedded in a host programming language, such as C. Such calls are tagged by a special marker, such as EXEC SQL. A preprocessor is invoked to convert the source program into a pure host-language program. The SQL calls are converted to host-language statements via a preprocessor. In static embedded SQL, table and attribute names must be declared in the source program. In dynamic embedded SQL, they may be provided at run time. There is an ISO standard for embedded SQL. Disadvantages: It is a real pain to debug preprocessed programs. The use of a program-development environment is compromised substantially. The preprocessor must be vendor and platform specific. A very simple example of a static embeded SQL program is shown on the next slide. 20061107:slides10:page 5 of 9

/* Skeleton example of embedded SQL in C */ #include <stdio.h> #include <stdlib.h> /* Include communications area */ EXEC SQL INCLUDE sqlca main () { EXEC SQL BEGIN DECLARE SECTION char Lname[16]; char SSN[10]; EXEC SQL END DECLARE SECTION EXEC SQL CONNECT company ; if (sqlca.sqlcode < 0) exit(-1); printf( Enter SSN: ); scanf( %s, SSN); EXEC SQL SELECT Lname FROM Employee WHERE SSN = :SSN; switch (sqlca.sqlcode) { case 0: printf( Last name is %s.\n, LName); break; case 100: printf( No last name for %s.\n, SSN); break; default: printf( SQL error %d.\n, sqlca.sqlcode); }; return(0); EXEC SQL DISCONNECT; }; 20061107:slides10:page 6 of 9

SQL Modules: In the module approach, invocations to SQL are made via libraries of procedures, rather than via preprocessing. Advantages over embedded SQL: Clean separation of SQL from the host programming language. Debugging is much more straightforward, since no preprocessor is involved. Disadvantages: The module libraries are specific to both the DBMS and programming languageand environment. Thus, portability is compromised greatly. Is there a standard for such systems??? Vaguely, PL/SQL is an example of such a system, although it does not really use PL/1 as the host language. Rather, it is an integrated system. JDBC is perhaps another example, using Java as the host language. Again, it is proprietary. 20061107:slides10:page 7 of 9

SQL Call-Level Interfaces: A call-level interface provides a libarary of functions for access to DBMS s. The DBMS drivers are stored separately;thus the library used by the programming language is DBMS independent. The programming language functions provided only an interface to the DBMS drivers. Advantages: The development environment is not tied to a particular DBMS, operating sytem, or even a particular development environment. Disadvantages: Some low-level optimization may be more dificult or impossible to achieve. Key example: The SQL CLI (X/Open CLI) Microsoft ODBC (Open Database Connectivity) The two are closely aligned. 20061107:slides10:page 8 of 9

An oversimplified picture of ODBC: API Call Operating System ODBC Manager Prog. Env. Oracle Driver Sybase Driver Access Driver Paradox Driver... SQL Server Driver System- Specific ODBC Drivers Local DB Mapping API Library ODBC: Company Type: MS Access File: F:\DB\c.mdb... ODBC: Course Type: Sybase File: F:\DB\x.syb 20061107:slides10:page 9 of 9