CS-GY 6083: Principles of Database Systems
main
main
  • Introduction
  • DBMS Basics
    • Introduction to DBMS
    • Why use a DBMS instead of a File System?
    • Levels of Abstraction
    • Instances and Schemas
  • Data Models
    • Introduction to Data Models
    • Database Languages
    • Database Design
  • DBMS Internals
    • Introduction to DBMS Internals
    • Storage Manager
    • Query Processor
    • Transaction Management
    • Database Users
    • Database Architecture
  • DBMS History
  • Some Popular Database Systems
  • OLTP, OLAP, and Data Mining
  • Databases vs. Information Retrieval
  • The Entity-Relationship Model - Details
    • Introduction
    • Cardinality Constraints
    • ER Diagram Components
    • ER Diagram to Relational Schema
    • Design Issues
  • The Relational Model - Details
    • Relations
    • Keys
    • Relational Query Languages
      • Relational Algebra
      • Relational Calculus
      • Relative Expressive Power
    • Relational Operators
  • SQL
    • Introduction to SQL
    • Domain Types in SQL
    • DDL Commands
      • Creating a Table
      • Alter and Drop
    • DML Commands
      • Basic Query Structure
      • Select
      • From
      • Where
      • Joins
      • Rename
      • String Operations
      • Ordering
      • Set Operations
      • Group By and Having
      • Nested Subqueries
      • Test for Empty Relations
      • Test for Duplicate Tuples
      • Derived Relations
      • With
      • Database Modification
    • Intermediate SQL
      • Joins Revisited
      • Views
      • Transactions
      • Integrity Constraints
      • More SQL Data Types and Schemas
        • Other Features
      • Authorization
    • Advanced SQL
      • Accessing SQL From a Programming Language
        • ODBC and JDBC
        • Embedded SQL
        • PHP
        • Some Security Issues
      • Accessing Metadata
      • Text Operations
        • Like
        • Contains
      • Cursors
      • Functions and Procedures
        • Procedural Constructs
        • External Language Routines
      • Triggers
      • Ranking
      • Windowing
      • OLAP
Powered by GitBook
On this page
  • ODBC
  • JDBC

Was this helpful?

  1. SQL
  2. Advanced SQL
  3. Accessing SQL From a Programming Language

ODBC and JDBC

ODBC (Open Database Connectivity) and JDBC (Java Database Connectivity) serve as APIs for a program to interact with a database server.

In general, the application must make calls to:

  1. connect with the database server

  2. send SQL commands to the database server

  3. fetch tuples of result one-by-one into program variables

ODBC

ODBC works with C, C++, C# and Visual Basic (other APIs such as ADO.NET sit on top of ODBC).

ODBC is the standard for application programs communicating with a database server.

The API will:

  1. open a connection with a database

  2. send queries and updates

  3. get back results

ODBC can be used with applications such as GUIs, spreadsheets etc.

JDBC

JDBC works with Java.

Along with supporting various features for querying and updating data, and for retrieving query results, JDBC also supports metadata retrieval i.e. retrieving information about the database such as relations present in the database and the names and types of relation attributes.

JDBC connects with the database as follows:

  1. open a connection

  2. create a “Statement” object

  3. execute queries using the Statement object to send queries and fetch results

  4. exception mechanism to handle errors

PreviousAccessing SQL From a Programming LanguageNextEmbedded SQL

Last updated 4 years ago

Was this helpful?