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.

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.
Java Database Connectivity (JDBC). 2/24 JDBC (Java DataBase Connectivity) - provides access to relational database systems JDBC is a vendor independent.
Distributed Application Development B. Ramamurthy.
Introduction to ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Static vs. Dynamic Web Pages.NET Framework Installing ASP.NET First.
SQL (Structured Query Language) X/OPEN Call Level Interface For SQL ODBC (Open DataBase Connectivity) API JDBC (Java DataBase Connectivity) API SQL (Structured.
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:
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
1 Lecture 29 More on JDBC Overview  Objectives of this lecture  JDBC and its Drivers  Connecting to Databases (Java’s Connection class)  Querying a.
CSE 190: Internet E-Commerce Lecture 13: Database code.
Java database Programming JDBC Trademarked name of a Java API that supports Java programs that access relational databases Stand for Java DataBase Connectivity.
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
JDBC Java API for Database Connectivity. Layout of this recitation Introduction to JDBC API JDBC Architecture Understanding the design of JDBC API –Classes.
JAVA JDBC JAVA JDBC Java Database Programming Lamiaa Said.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 11. DATABASE CONNECTIVITY IN JAVA JDBC Programming JDBC (Java Database Connectivity) is the specification of a.
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
JDBC / ODBC JDBC is the java API that facilitate interaction of a java application with the DBMS. FIRST APPROACH:
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.
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
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.
JDBC Java Database Connectivity. What is an RDBMS? Relational database management system. There are other kinds of DBMS. Access is a GUI on a JET RBDMS.
Helena Pomezná, ciz034 St. skupina: L392 FEI, VŠB-TUO Ak. rok. 2002/2003 Download:
ADO Connect Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Jaeki Song JAVA Lecture 11 Java Database Connectivity.
A Memo for the Starting of CS-framework Yulin Tian 1. Install the packages of the CS ; 2. Set the environment variable “DIM_DNS_NODE” ; 3. Register an.
CSE470 Software Engineering Fall Database Access through Java.
Lecture On Database Analysis and Design By- Jesmin Akhter Lecturer, IIT, Jahangirnagar University.
Java Database Connectivity (JDBC) Introduction to JDBC JDBC is a simple API for connecting from Java applications to multiple databases. Lets you smoothly.
Database Programming in Java Corresponds with Chapter 32, 33.
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.
CIS 270—Application Development II Chapter 25—Accessing Databases with JDBC.
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.
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
JDBC Tutorial MIE456 - Information Systems Infrastructure II Vinod Muthusamy November 4, 2004.
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 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
JDBC. JDBC stands for Java Data Base Connectivity. JDBC is different from ODBC in that – JDBC is written in Java (hence is platform independent, object.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture12: Accessing Databases.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
COMP201 Java Programming Topic 15: Database Connectivity JDBC Reading: Chapter 4, Volume 2.
WEB/DB1 DATABASE PROGRAMMING 3JDBC by the ASU Scholars.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Java Database Connectivity (JDBC). Topics 1. The Vendor Variation Problem 2. SQL and Versions of JDBC 3. Creating an ODBC Data Source 4. Simple Database.
JDBC Database Programming in Java Prepared by., Mrs.S.Amudha AP/SWE.
JDBC. Java.sql.package The java.sql package contains various interfaces and classes used by the JDBC API. This collection of interfaces and classes enable.
Adding an ODBC source ODBC is Windows’ way of talking to a database Start->Settings-> Control Panel-> ODBC Data Sources Do not try this until I send you.
Copyright © Curt Hill Connectivity Communicating with the Database.
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.
RAD to Database Connection Glenn Campbell
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
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.
Basics of JDBC Session 14.
JDBC - Java Database Connectivity. JDBC provides Java applications with access to most database systems via SQL The architecture and API closely resemble.
Ch. NoNameMarks 01AWT24 02Networking18 03JDBC20 04Swing18 05Servlet20 Advance Java Programming.
1 Database Management Systems (II) Chapter 14. JDBC, Java Server Pages, and MySQL © 2005 by Dr. F. Lin.
W04 Connecting 3rd Party Application to ODBC
JDBC Database Management Database connectivity
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
JAVA DATABaSE CONNECTIVITY
Java API for Database Connectivity
Plug-In Architecture Pattern
Presentation transcript:

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 with a database Why are they good –interoperability

ODBC (Open Database Connectivity) Application Driver Manager ODBC interface Driver A Driver B Driver C DS ADS B DS C

Adding an ODBC source Purpose: register a data source How-to (Windows 2000) –Start->Settings->Control Panel-> Administrative Tools->Data Sources(ODBC) NB: You need to register a new SQL server before you create the DSN

Further steps…. Select the System DSN tab Click add and choose SQL server (usually the bottom driver listed). Click Finish.

Further steps…. Chose identification entered by the user. Note: this is not the default option, so pay attention Enter the ID and password I gave you Agree with everything else in the wizard Test the data source and if your test succeeds, hit OK

JDBC (Java Database Connectivity) What is it: –Java classes that allow an app to communicate with a database Three types of JDBC drivers: –Proprietary –Bridge Drivers (e.g. JDBC-ODBC) –JDBC-Net

How does it work JDBC-ODBC bridge ODBC driver So, how does it work? You need to load the bridge driver and get a connection from the driver manager

Confusing? Let’s look at some code import java.sql.*; Class FirstTry{ public static void main(String[] args){ try{ String url=“jdbc:odbc:myDSN”; /*load the driver from Sun.Even if you don’t understand this, this line is always the same*/ Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”); //get a connection Connection con=DriverManager.getConnection(url,”userID”,”password”); }catch….

How does it fit together Note the DSN in the database url—it is the ODBC DSN JDBC is just a way for Java applications to do what ASP does with ODBC.

What next Well, just have fun. Check out Sun’s API for the sql package See Sun’s tutorial on JDBC

The Front End Web pages: static/dynamic Techniques for creating dynamic content : –CGI (Perl), ASP, JSP Requests, Responses and Headers –HTTP: simple, stateless. Client(I.e.browser) requests, web server responds Requests can be of several types(methods): usually GET and POST

ADO Set of objects to modify and access data through OLE DB interface: Connection, Command,Recordset,Error Application uses ADO which talks to OLE DB provider for ODBC, which loads the right ODBC driver. Note: providers represent diverse sources of data, pick the right one