Java Database Connectivity

Size: px
Start display at page:

Download "Java Database Connectivity"

Transcription

1 Java Database Connectivity INTRODUCTION Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India.

2 Agenda Introduction Product Components Architecture Drivers Processing SQL Summary Refrences

3 Introduction Java API for database-independent connectivity between the Java programming language and a wide range of databases

4 Introduction Helps to write Java applications that manage these three programming activities: Connect to a data source, like a database Send queries and update statements to the database Retrieve and process the results received from the database in answer to your query

5 Product Components The JDBC API java.sql javax.sql JDBC Driver Manager DataSource JDBC Test Suite JDBC-ODBC Bridge

6 Architecture 2-tier 3-tier N-tier

7 Architecture 2-tier SRC:

8 Architecture 2-tier (cont.) Client connects directly to server e.g. HTTP, Pro: simple Con: fat client inflexible

9 Architecture 3-tier SRC:

10 Pros Architecture 3-tier (cont.) Flexible Specialization: presentation / business logic / data management Can cache queries Can implement proxies and firewalls Cons Higher complexity Higher maintenance Lower network efficiency More parts to configure

11 Architecture N-tier N-tier data applications are data applications that are separated into multiple tiers Presentation Tier/Middle Tier/Data Tier Adapted from:

12 Drivers Type 1: JDBC-ODBC Bridge Driver Type 2: JDBC-Native API SRC:

13 Driver (cont.) Type 3: JDBC-Net pure Java (Network Protocol) Type 4: 100% pure Java (Native-protocol) SRC:

14 Video

15 Simplicity Simplicity is the ultimate sophistication. Leonardo da Vinci Simplest explanation is the right explanation. Occam's razor Everything must be made as simple as possible, but not simpler. Albert Einstein

16 Processing SQL 1. Establishing a connection. 2. Create a statement. 3. Execute the query. 4. Process the Result. 5. Close the connection.

17 Processing SQL (cont.) Establish Connection Create Statement Execute Query Process Result Close Connection

18 Processing SQL Establish Connection Establish Connection Datasource Create Statement DriverManager Register the driver Execute Query Connect to the database Process Result Close Connection

19 Processing SQL Establish Connection (cont.) Register Class.forName(drivername) Connect DriverManager.getConnection(URL) jdbc:<subprotocol>:<subname> Protocol Subprotocol Database identifier jdbc:mysql://localhost:3306/students

20 Processing SQL Establish Connection (cont.) class.forname( com.mysql.jdbc.driver ); Connection con=drivermanager.getconnection( jdbc:mysql://localhost:3306/students, root, passwd );

21 Processing SQL Establish Connection (cont.) import java.sql.*; class Select { public static void main( String argv[] ) { try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/students"; Connection con = DriverManager.getConnection(url, "root","password"); } } } catch (Exception e) { e.printstacktrace(); }

22 Processing SQL Create Statement Establish Connection Create Statement Statement stmt = con.createstatement(); Execute Query Process Result Close Connection

23 Processing SQL Execute Query Establish Connection Create Statement executequery() Execute Query ExecuteUpdate() Process Result ResultSet rs = stmt.executequery(statement); int count = stmt.executeupdate(statement); Close Connection

24 Processing SQL Execute Query (cont.) Select statement ResultSet rset = stmt.executequery ("select *from BTCSE"); Delete statement int rowcount = stmt.executeupdate ("delete from BTCSE where student_section = A );

25 Processing SQL Execute Query (cont.) import java.sql.*; class Select { public static void main( String argv[] ) { try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/students"; Connection con = DriverManager.getConnection(url, "root","password");. Statement stmt=con.createstatement(); String sql = "select * from BTCSE"; ResultSet rs=stmt.executequery(sql);... } catch (Exception e) { e.printstacktrace(); } } }

26 Processing SQL Process Result Establish Connection Create Statement Execute Query ResultSet Process Result Others Close Connection

27 Processing SQL Process Result ResultSet 1. Step through the ResultSet. while (rs.next()) { } 2. Use getxxx() to get each column value. String val = rs.getstring(colname); String val = rs.getstring(colindex); while (rset.next()) { String enrollment = rset.getstring( enrollment_number"); String stdname = rset.getstring(2); // Process or display the data }

28 Processing SQL Process Result (cont.) import java.sql.*; class Select { public static void main( String argv[] ) { try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/students"; Connection con = DriverManager.getConnection(url, "root","password"); Statement stmt=con.createstatement(); String sql = "select * from students"; ResultSet rs=stmt.executequery(sql); while ( rs.next() ) System.out.println(rs.getString( 1 )+","+rs.getstring( 2 ));. } catch (Exception e) { e.printstacktrace(); } } }

29 Processing SQL Close Connection Establish Connection Create Statement Execute Query Close the ResultSet Process Result Close the Statement Close Connection Close the Connection

30 Processing SQL Close Connection (cont.) 1. Close the ResultSet object. rs.close(); 2. Close the Statement object. stmt.close(); 3. Close the connection. con.close();

31 Program Example package advancedjava.jdbc; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.statement; public class SelectRecords { public static void main(string argv[]) { Connection con = null; Statement stmt = null; ResultSet rs = null; try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/students"; con = DriverManager.getConnection(url, "root", "password"); String sql = "select * from btcse"; stmt = con.createstatement(); rs = stmt.executequery(sql); System.out.println("Enrollment\tName\tSection"); while (rs.next()) { System.out.println(rs.getString(1) + "\t" + rs.getstring(2) + "\t" + rs.getint(3)); } rs.close(); stmt.close(); con.close(); } catch (Exception e) { System.out.println("** Error on data select. ** " + e); } } }

32 Summary

33 Reference JDBC Database Access

34 Thank You Questions???

Java Database Connectivity

Java Database Connectivity Java Database Connectivity PROGRAMMING Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. s.imtiyaz@jamiahamdard.ac.in Agenda PreparedStatement

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Fall 2010 An introductory course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/ht10/ Manivasakan Sabesan Uppsala Database Laboratory Department of Information

More information

Databases 2012 Embedded SQL

Databases 2012 Embedded SQL Databases 2012 Christian S. Jensen Computer Science, Aarhus University SQL is rarely written as ad-hoc queries using the generic SQL interface The typical scenario: client server database SQL is embedded

More information

Java Database Connectivity

Java Database Connectivity Java Database Connectivity ADVANCED FEATURES Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. s.imtiyaz@jamiahamdard.ac.in Agenda Scrollable

More information

SQL: Programming. Announcements (September 25) Motivation. CPS 116 Introduction to Database Systems. Pros and cons of SQL.

SQL: Programming. Announcements (September 25) Motivation. CPS 116 Introduction to Database Systems. Pros and cons of SQL. SQL: Programming CPS 116 Introduction to Database Systems Announcements (September 25) 2 Homework #2 due this Thursday Submit to Yi not through Jun s office door Solution available this weekend No class

More information

JDBC Architecture. JDBC API: This provides the application-to- JDBC Manager connection.

JDBC Architecture. JDBC API: This provides the application-to- JDBC Manager connection. JDBC PROGRAMMING JDBC JDBC Java DataBase Connectivity Useful for database driven applications Standard API for accessing relational databases Compatible with wide range of databases Current Version JDBC

More information

CSC System Development with Java. Database Connection. Department of Statistics and Computer Science. Budditha Hettige

CSC System Development with Java. Database Connection. Department of Statistics and Computer Science. Budditha Hettige CSC 308 2.0 System Development with Java Database Connection Budditha Hettige Department of Statistics and Computer Science Budditha Hettige 1 From database to Java There are many brands of database: Microsoft

More information

SQream Connector JDBC SQream Technologies Version 2.9.3

SQream Connector JDBC SQream Technologies Version 2.9.3 SQream Connector JDBC 2.9.3 SQream Technologies 2019-03-27 Version 2.9.3 Table of Contents The SQream JDBC Connector - Overview...................................................... 1 1. API Reference............................................................................

More information

ERwin and JDBC. Mar. 6, 2007 Myoung Ho Kim

ERwin and JDBC. Mar. 6, 2007 Myoung Ho Kim ERwin and JDBC Mar. 6, 2007 Myoung Ho Kim ERwin ERwin a popular commercial ER modeling tool» other tools: Dia (open source), Visio, ConceptDraw, etc. supports database schema generation 2 ERwin UI 3 Data

More information

SQL: Programming Midterm in class next Thursday (October 5)

SQL: Programming Midterm in class next Thursday (October 5) Announcements (September 28) 2 Homework #1 graded Homework #2 due today Solution available this weekend SQL: Programming Midterm in class next Thursday (October 5) Open book, open notes Format similar

More information

Visit for more.

Visit  for more. Chapter 6: Database Connectivity Informatics Practices Class XII (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra, PGT (Comp.Sc.)

More information

Accessing databases in Java using JDBC

Accessing databases in Java using JDBC Accessing databases in Java using JDBC Introduction JDBC is an API for Java that allows working with relational databases. JDBC offers the possibility to use SQL statements for DDL and DML statements.

More information

MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065)

MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065) MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065) DATABASE CONNECTIVITY TO MYSQL Level- I Questions 1. What is the importance of java.sql.*; in java jdbc connection?

More information

Database Programming Overview. COSC 304 Introduction to Database Systems. Database Programming. JDBC Interfaces. JDBC Overview

Database Programming Overview. COSC 304 Introduction to Database Systems. Database Programming. JDBC Interfaces. JDBC Overview COSC 304 Introduction to Database Systems Database Programming Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Database Programming Overview Most user interaction with

More information

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

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 JDBC Stands for Java Database Connectivity, is an API specification that defines the following: 1. How to interact with database/data-source from Java applets, apps, servlets 2. How to use JDBC drivers

More information

JDBC 3.0. Java Database Connectivity. 1 Java

JDBC 3.0. Java Database Connectivity. 1 Java JDBC 3.0 Database Connectivity 1 Contents 1 JDBC API 2 JDBC Architecture 3 Steps to code 4 Code 5 How to configure the DSN for ODBC Driver for MS-Access 6 Driver Types 7 JDBC-ODBC Bridge 8 Disadvantages

More information

Instructor: Jinze Liu. Fall 2008

Instructor: Jinze Liu. Fall 2008 Instructor: Jinze Liu Fall 2008 Database Project Database Architecture Database programming 2 Goal Design and implement a real application? Jinze Liu @ University of Kentucky 9/16/2008 3 Goal Design and

More information

Java Database Connectivity (JDBC) 25.1 What is JDBC?

Java Database Connectivity (JDBC) 25.1 What is JDBC? PART 25 Java Database Connectivity (JDBC) 25.1 What is JDBC? JDBC stands for Java Database Connectivity, which is a standard Java API for database-independent connectivity between the Java programming

More information

DB I. 1 Dr. Ahmed ElShafee, Java course

DB I. 1 Dr. Ahmed ElShafee, Java course Lecture (15) DB I Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, Java course Agenda 2 Dr. Ahmed ElShafee, Java course Introduction Java uses something called JDBC (Java Database Connectivity) to connect to databases.

More information

Unit 3 - Java Data Base Connectivity

Unit 3 - Java Data Base Connectivity Two-Tier Database Design The two-tier is based on Client-Server architecture. The direct communication takes place between client and server. There is no mediator between client and server. Because of

More information

UNIT-3 Java Database Client/Server

UNIT-3 Java Database Client/Server UNIT-3 Java Database Client/Server TOPICS TO BE COVERED 3.1 Client-Server Design: Two-Tier Database Design, Three-Tier Database Design 3.2 The JDBC API: The API Components, Database Creation, table creation

More information

SQL in a Server Environment

SQL in a Server Environment SQL in a Server Environment Vaidė Narváez Computer Information Systems January 13th, 2011 The Three-Tier Architecture Application logic components Copyright c 2009 Pearson Education, Inc. Publishing as

More information

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

The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets Course Name: Advanced Java Lecture 13 Topics to be covered The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets Introducing

More information

COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA

COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA OUTLINE Postgresql installation Introduction of JDBC Stored Procedure POSTGRES INSTALLATION (1) Extract the source file Start the configuration

More information

DataBase Lab JAVA-DATABASE CONNECTION. Eng. Haneen El-masry

DataBase Lab JAVA-DATABASE CONNECTION. Eng. Haneen El-masry In the name of Allah Islamic University of Gaza Faculty of Engineering Computer Engineering Department ECOM 4113 DataBase Lab Lab # 9 JAVA-DATABASE CONNECTION El-masry 2013 Objective In this lab, we turn

More information

Enterprise Java Unit 1- Chapter 6 Prof. Sujata Rizal

Enterprise Java Unit 1- Chapter 6 Prof. Sujata Rizal Introduction JDBC is a Java standard that provides the interface for connecting from Java to relational databases. The JDBC standard is defined by Sun Microsystems and implemented through the standard

More information

BUSINESS INTELLIGENCE LABORATORY. Data Access: Relational Data Bases. Business Informatics Degree

BUSINESS INTELLIGENCE LABORATORY. Data Access: Relational Data Bases. Business Informatics Degree BUSINESS INTELLIGENCE LABORATORY Data Access: Relational Data Bases Business Informatics Degree RDBMS data access 2 Protocols and API ODBC, OLE DB, ADO, ADO.NET, JDBC JDBC Programming Java classes java.sql

More information

This lecture. Databases - JDBC I. Application Programs. Database Access End Users

This lecture. Databases - JDBC I. Application Programs. Database Access End Users This lecture Databases - I The lecture starts discussion of how a Java-based application program connects to a database using. (GF Royle 2006-8, N Spadaccini 2008) Databases - I 1 / 24 (GF Royle 2006-8,

More information

Introduction to JDBC. JDBC: Java Database Connectivity. Why Access a Database with Java? Compilation. Six Steps. Packages to Import

Introduction to JDBC. JDBC: Java Database Connectivity. Why Access a Database with Java? Compilation. Six Steps. Packages to Import Introduction to JDBC JDBC: Java Database Connectivity JDBC is used for accessing databases from Java applications Information is transferred from relations to objects and vice-versa databases optimized

More information

Remote Method Invocation

Remote Method Invocation Remote Method Invocation RMI Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. s.imtiyaz@jamiahamdard.ac.in 1 Agenda Introduction Creating

More information

Persistency Patterns. Repository and DAO

Persistency Patterns. Repository and DAO Persistency Patterns Repository and DAO 1 Repository pattern Basically, the Repository pattern just means putting a façade over your persistence system so that you can shield the rest of your application

More information

Database Application Development

Database Application Development Database Application Development Linda Wu (CMPT 354 2004-2) Topics SQL in application code Embedded SQL JDBC SQLJ Stored procedures Chapter 6 CMPT 354 2004-2 2 SQL in Application Code SQL commands can

More information

COMP102: Introduction to Databases, 23

COMP102: Introduction to Databases, 23 COMP102: Introduction to Databases, 23 Dr Muhammad Sulaiman Khan Department of Computer Science University of Liverpool U.K. 04 April, 2011 Programming with SQL Specific topics for today: Client/Server

More information

Cyrus Shahabi Computer Science Department University of Southern California C. Shahabi

Cyrus Shahabi Computer Science Department University of Southern California C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California shahabi@usc.edu 1 Overview JDBC Package Connecting to databases with JDBC Executing

More information

Application Programming for Relational Databases

Application Programming for Relational Databases Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California shahabi@usc.edu 1 Overview JDBC Package Connecting to databases with JDBC Executing

More information

Databases and JDBC. by Vlad Costel Ungureanu for Learn Stuff

Databases and JDBC. by Vlad Costel Ungureanu for Learn Stuff Databases and JDBC by Vlad Costel Ungureanu for Learn Stuff Working with Databases Create database using SQL scripts Connect to the database server using a driver Communicate with the database Execute

More information

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

Java and the Java DataBase Connectivity (JDBC) API. Todd Kaufman April 25, 2002 Java and the Java DataBase Connectivity (JDBC) API Todd Kaufman April 25, 2002 Agenda BIO Java JDBC References Q&A Speaker 4 years Java experience 4 years JDBC experience 3 years J2EE experience BS from

More information

Calling SQL from a host language (Java and Python) Kathleen Durant CS 3200

Calling SQL from a host language (Java and Python) Kathleen Durant CS 3200 Calling SQL from a host language (Java and Python) Kathleen Durant CS 3200 1 SQL code in other programming languages SQL commands can be called from within a host language (e.g., C++ or Java) program.

More information

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

e-pg Pathshala Subject: Computer Science Paper: Web Technology Module: JDBC INTRODUCTION Module No: CS/WT/26 Quadrant 2 e-text e-pg Pathshala Subject: Computer Science Paper: Web Technology Module: JDBC INTRODUCTION Module No: CS/WT/26 Quadrant 2 e-text Learning Objectives This module gives an introduction about Java Database

More information

Unit 2 JDBC Programming

Unit 2 JDBC Programming Q1. What is JDBC? Explain the types of JDBC drivers? Ans. What is JDBC? JDBC is an API, which is used in java programming for interacting with database. JDBC (Java DataBase Connection) is the standard

More information

How to program applications. CS 2550 / Spring 2006 Principles of Database Systems. SQL is not enough. Roadmap

How to program applications. CS 2550 / Spring 2006 Principles of Database Systems. SQL is not enough. Roadmap How to program applications CS 2550 / Spring 2006 Principles of Database Systems 05 SQL Programming Using existing languages: Embed SQL into Host language ESQL, SQLJ Use a library of functions Design a

More information

Logging and Recovery. 444 Section, April 23, 2009

Logging and Recovery. 444 Section, April 23, 2009 Logging and Recovery 444 Section, April 23, 2009 Reminders Project 2 out: Due Wednesday, Nov. 4, 2009 Homework 1: Due Wednesday, Oct. 28, 2009 Outline Project 2: JDBC ACID: Recovery Undo, Redo logging

More information

while (rs.next()) { String[] temp_array = {"","",""}; int prodid = rs.getint(1); temp_array[0] = ""+prodid;

while (rs.next()) { String[] temp_array = {,,}; int prodid = rs.getint(1); temp_array[0] = +prodid; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import java.util.arraylist; import java.util.scanner; public

More information

Working with Databases and Java

Working with Databases and Java Working with Databases and Java Pedro Contreras Department of Computer Science Royal Holloway, University of London January 30, 2008 Outline Introduction to relational databases Introduction to Structured

More information

PERSİSTENCE OBJECT RELATİON MAPPİNG

PERSİSTENCE OBJECT RELATİON MAPPİNG PERSİSTENCE Most of the applications require storing and retrieving objects in a persistent storage mechanism. This chapter introduces how to store and retrieve information in a persistent storage with

More information

Programming in Java

Programming in Java 320341 Programming in Java Fall Semester 2014 Lecture 16: Introduction to Database Programming Instructor: Slides: Jürgen Schönwälder Bendick Mahleko Objectives This lecture introduces the following -

More information

Servlet 5.1 JDBC 5.2 JDBC

Servlet 5.1 JDBC 5.2 JDBC 5 Servlet Java 5.1 JDBC JDBC Java DataBase Connectivity Java API JDBC Java Oracle, PostgreSQL, MySQL Java JDBC Servlet OpenOffice.org ver. 2.0 HSQLDB HSQLDB 100% Java HSQLDB SQL 5.2 JDBC Java 1. JDBC 2.

More information

Top 50 JDBC Interview Questions and Answers

Top 50 JDBC Interview Questions and Answers Top 50 JDBC Interview Questions and Answers 1) What is the JDBC? JDBC stands for Java Database Connectivity. JDBC is a Java API that communicates with the database and execute SQLquery. 2) What is a JDBC

More information

C:/Users/zzaier/Documents/NetBeansProjects/WebApplication4/src/java/mainpackage/MainClass.java

C:/Users/zzaier/Documents/NetBeansProjects/WebApplication4/src/java/mainpackage/MainClass.java package mainpackage; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import javax.ws.rs.core.context; import

More information

CSE 135. Three-Tier Architecture. Applications Utilizing Databases. Browser. App. Server. Database. Server

CSE 135. Three-Tier Architecture. Applications Utilizing Databases. Browser. App. Server. Database. Server CSE 135 Applications Utilizing Databases Three-Tier Architecture Located @ Any PC HTTP Requests Browser HTML Located @ Server 2 App Server JDBC Requests JSPs Tuples Located @ Server 1 Database Server 2

More information

JAVA AND DATABASES. Summer 2018

JAVA AND DATABASES. Summer 2018 JAVA AND DATABASES Summer 2018 JDBC JDBC (Java Database Connectivity) an API for working with databases in Java (works with any tabular data, but focuses on relational databases) Works with 3 basic actions:

More information

Topic 12: Database Programming using JDBC. Database & DBMS SQL JDBC

Topic 12: Database Programming using JDBC. Database & DBMS SQL JDBC Topic 12: Database Programming using JDBC Database & DBMS SQL JDBC Database A database is an integrated collection of logically related records or files consolidated into a common pool that provides data

More information

JDBC Java Database Connectivity is a Java feature that lets you connect

JDBC Java Database Connectivity is a Java feature that lets you connect Chapter 4: Using JDBC to Connect to a Database In This Chapter Configuring JDBC drivers Creating a connection Executing SQL statements Retrieving result data Updating and deleting data JDBC Java Database

More information

Lab # 9. Java to Database Connection

Lab # 9. Java to Database Connection Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 9 Java to Database Connection Eng. Haneen El-Masry December, 2014 2 Objective In this lab, we turn

More information

Database Application Development Part 2 - Chapter

Database Application Development Part 2 - Chapter Database Application Development Part 2 - Chapter 6.3-6.7 http://xkcd.com/327 -- CC BY-NC 2.5 Randall Munroe Comp 521 Files and Databases Fall 2014 1 Alternative Approach v Abstract Database interface

More information

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

1. PhP Project. Create a new PhP Project as shown below and click next 1. PhP Project Create a new PhP Project as shown below and click next 1 Choose Local Web Site (Apache 24 needs to be installed) Project URL is http://localhost/projectname Then, click next We do not use

More information

CMPUT 391 Database Management Systems. JDBC in Review. - Lab 2 -

CMPUT 391 Database Management Systems. JDBC in Review. - Lab 2 - CMPUT 391 Database Management Systems JDBC in Review - - Department of Computing Science University of Alberta What Is JDBC? JDBC is a programming interface JDBC allows developers using java to gain access

More information

Databases and SQL Lab EECS 448

Databases and SQL Lab EECS 448 Databases and SQL Lab EECS 448 Databases A database is an organized collection of data. Data facts are stored as fields. A set of fields that make up an entry in a table is called a record. Server - Database

More information

JDBC [Java DataBase Connectivity]

JDBC [Java DataBase Connectivity] JDBC [Java DataBase Connectivity] Introduction Almost all the web applications need to work with the data stored in the databases. JDBC is Java specification that allows the Java programs to access the

More information

JDBC Programming: Intro

JDBC Programming: Intro JDBC Programming: Intro Most interaction with DB is not via interactive interface Most people interact via 1. Application programs directly 2. Apps over the internet There are 3 general approaches to developing

More information

Java Database Connectivity

Java Database Connectivity Java Database Connectivity Introduction Java Database Connectivity (JDBC) provides a standard library for accessing databases. The JDBC API contains number of interfaces and classes that are extensively

More information

Enterprise Systems. Lecture 02: JDBC. Behzad BORDBAR

Enterprise Systems. Lecture 02: JDBC. Behzad BORDBAR Enterprise Systems Lecture 02: JDBC Behzad BORDBAR 22 Contents Running example Sample code for beginners Properties to configure Statements and ResultSet Pitfalls of using ResultSet getobject() vs. getxxx()

More information

Introduction to SQL & Database Application Development Using Java

Introduction to SQL & Database Application Development Using Java Introduction to SQL & Database Application Development Using Java By Alan Andrea The purpose of this paper is to give an introduction to relational database design and sql with a follow up on how these

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer About the Tutorial JDBC API is a Java API that can access any kind of tabular data, especially data stored in a Relational Database. JDBC works with Java on a variety of platforms, such as Windows, Mac

More information

1 of 6 11/08/2011 10:14 AM 1. Introduction 1.1. Project/Component Working Name: SJSAS 9.1, Support for JDBC 4.0 in JDBC RA, RFEs 1.2. Name(s) and e-mail address of Document Author(s)/Supplier: Jagadish

More information

Three-Tier Architecture

Three-Tier Architecture Three-Tier Architecture Located @ Any PC HTTP Requests Microsoft Internet Explorer HTML Located @ Your PC Apache Tomcat App Server Java Server Pages (JSPs) JDBC Requests Tuples Located @ DBLab MS SQL Server

More information

Types of Databases. Types of Databases. Types of Databases. Databases and Web. Databases and Web. Relational databases may also have indexes

Types of Databases. Types of Databases. Types of Databases. Databases and Web. Databases and Web. Relational databases may also have indexes Types of Databases Relational databases contain stuctured data tables, columns, fixed datatype for each column Text databases are available for storing non-structured data typically text databases store

More information

Chapter 13 JDBC And NOI

Chapter 13 JDBC And NOI Chapter 13 JDBC And NOI We've seen in the earlier chapters of this book how to use the Notes Object Interface (NOI) from Java programs (applications, Servlets, and Agents) to manipulate Domino objects

More information

Introduction to Databases

Introduction to Databases JAVA JDBC Introduction to Databases Assuming you drove the same number of miles per month, gas is getting pricey - maybe it is time to get a Prius. You are eating out more month to month (or the price

More information

Outline. Lecture 10: Database Connectivity -JDBC. Java Persistence. Persistence via Database

Outline. Lecture 10: Database Connectivity -JDBC. Java Persistence. Persistence via Database Outline Lecture 10: Database Connectivity -JDBC Persistence via Database JDBC (Java Database Connectivity) JDBC API Wendy Liu CSC309F Fall 2007 1 2 Java Persistence Persistence via Database JDBC (Java

More information

JDBC - INTERVIEW QUESTIONS

JDBC - INTERVIEW QUESTIONS JDBC - INTERVIEW QUESTIONS http://www.tutorialspoint.com/jdbc/jdbc_interview_questions.htm Copyright tutorialspoint.com Dear readers, these JDBC Interview Questions have been designed specially to get

More information

Chair of Software Engineering. Java and C# in Depth. Prof. Dr. Bertrand Meyer. Exercise Session 9. Nadia Polikarpova

Chair of Software Engineering. Java and C# in Depth. Prof. Dr. Bertrand Meyer. Exercise Session 9. Nadia Polikarpova Chair of Software Engineering Java and C# in Depth Prof. Dr. Bertrand Meyer Exercise Session 9 Nadia Polikarpova Quiz 1: scrolling a ResultSet (JDBC) How do you assess the following code snippet that iterates

More information

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

JDBC. Sun Microsystems has included JDBC API as a part of J2SDK to develop Java applications that can communicate with databases. JDBC The JDBC TM API is the application programming interface that provides universal data access for the Java TM platform. In other words, the JDBC API is used to work with a relational database or other

More information

Introduction to JDBC. Lecture 12

Introduction to JDBC. Lecture 12 Introduction to JDBC Lecture 12 1 Road Map Introduction to JDBC/JDBC Drivers Overview: Six Steps to using JDBC Example 1: Setting up Tables via JDBC Example 2: Inserting Data via JDBC Example 3: Querying

More information

Chapter 10 Java and SQL. Wang Yang

Chapter 10 Java and SQL. Wang Yang Chapter 10 Java and SQL Wang Yang wyang@njnet.edu.cn Outline Concern Data - File & IO vs. Database &SQL Database & SQL How Connect Java to SQL - Java Model for Database Java Database Connectivity (JDBC)

More information

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

JDBC SHORT NOTES. Abstract This document contains short notes on JDBC, their types with diagrams. Rohit Deshbhratar [ address] JDBC SHORT NOTES Abstract This document contains short notes on JDBC, their types with diagrams. Rohit Deshbhratar [Email address] JDBC Introduction: Java DataBase Connectivity, commonly known as JDBC,

More information

WEB SERVICES EXAMPLE 2

WEB SERVICES EXAMPLE 2 INTERNATIONAL UNIVERSITY HCMC PROGRAMMING METHODOLOGY NONG LAM UNIVERSITY Instructor: Dr. Le Thanh Sach FACULTY OF IT WEBSITE SPECIAL SUBJECT Student-id: Instructor: LeMITM04015 Nhat Tung Course: IT.503

More information

Part I: Stored Procedures. Introduction to SQL Programming Techniques. CSC 375, Fall 2017

Part I: Stored Procedures. Introduction to SQL Programming Techniques. CSC 375, Fall 2017 Introduction to SQL Programming Techniques CSC 375, Fall 2017 The Six Phases of a Project: Enthusiasm Disillusionment Panic Search for the Guilty Punishment of the Innocent Praise for non-participants

More information

UNIT III - JDBC Two Marks

UNIT III - JDBC Two Marks UNIT III - JDBC Two Marks 1.What is JDBC? JDBC stands for Java Database Connectivity, which is a standard Java API for databaseindependent connectivity between the Java programming language and a wide

More information

Advanced Programming Techniques. Database Systems. Christopher Moretti

Advanced Programming Techniques. Database Systems. Christopher Moretti Advanced Programming Techniques Database Systems Christopher Moretti History Pre-digital libraries Organized by medium, size, shape, content, metadata Record managers (1800s-1950s) manually- indexed punched

More information

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

JDBC Drivers Type. JDBC drivers implement the defined interfaces in the JDBC API for interacting with your database server. JDBC Drivers Type 1 What is JDBC Driver? JDBC drivers implement the defined interfaces in the JDBC API for interacting with your database server. For example, using JDBC drivers enable you to open database

More information

VanillaCore Walkthrough Part 1. Introduction to Database Systems DataLab CS, NTHU

VanillaCore Walkthrough Part 1. Introduction to Database Systems DataLab CS, NTHU VanillaCore Walkthrough Part 1 Introduction to Database Systems DataLab CS, NTHU 1 The Architecture VanillaDB JDBC/SP Interface (at Client Side) Remote.JDBC (Client/Server) Query Interface Remote.SP (Client/Server)

More information

CHAPTER 2 JDBC FUNDAMENTALS

CHAPTER 2 JDBC FUNDAMENTALS CHAPTER 2 JDBC FUNDAMENTALS OBJECTIVES After completing JDBC Fundamentals, you will be able to: Know the main classes in the JDBC API, including packages java.sql and javax.sql Know the difference between

More information

Database connectivity (II)

Database connectivity (II) Lecture (07) Database connectivity (II) Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, ACU Spring 2011, Distributed Systems Agenda Connecting DB 2 Dr. Ahmed ElShafee, ACU Spring 2011, Distributed Systems The

More information

Best Practices for Boosting Java Application Performance and Availability on IBM DB2

Best Practices for Boosting Java Application Performance and Availability on IBM DB2 Best Practices for Boosting Java Application Performance and Availability on IBM DB2 Pallavi Priyadarshini Architect, JCC DB2 Connect, IBM pallavipr@in.ibm.com Agenda DB2 JDBC driver architecture and ecosystem

More information

INTRODUCTION TO JDBC - Revised spring

INTRODUCTION TO JDBC - Revised spring INTRODUCTION TO JDBC - Revised spring 2004 - 1 What is JDBC? Java Database Connectivity (JDBC) is a package in the Java programming language and consists of several Java classes that deal with database

More information

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science mluckner@mini.pw.edu.pl http://www.mini.pw.edu.pl/~lucknerm } JDBC ("Java Database Connectivity ) is a set

More information

CS221 Lecture: Java Database Connectivity (JDBC)

CS221 Lecture: Java Database Connectivity (JDBC) CS221 Lecture: Java Database Connectivity (JDBC) Objectives: 1. To introduce using JDBC to access a SQL database revised 10/20/14 Materials: 1. Projectable of registration system architecture. 2. JDBC

More information

UNIT-VIII Introduction of Java Database Connectivity

UNIT-VIII Introduction of Java Database Connectivity UNIT-VIII Introduction of Java Database Connectivity JDBC - Java Database Connectivity. JDBC provides API or Protocol to interact with different databases. With the help of JDBC driver we can connect with

More information

IBM Netezza JDBC 연동가이드

IBM Netezza JDBC 연동가이드 개발및운영 IBM Netezza JDBC 연동가이드 2015. 08. 31 IBM Netezza JDBC 연동가이드 1. Netezza 개요 IBM Netezza 데이터웨어하우스어플라이언스는서버, 스토리지및데이터베이스를어플라이언스에통합하여빅데 이터에대한분석을수행합니다. 2. Netezza JDBC 연동방법 2.1 Netezza JDBC Driver nzjdbc3.jar

More information

The Web Application Developer s. Red Hat Database. View. October 30, Webcast. Patrick Macdonald, Fernando Nasser. Red Hat Database Engineering

The Web Application Developer s. Red Hat Database. View. October 30, Webcast. Patrick Macdonald, Fernando Nasser. Red Hat Database Engineering Red Hat Database The Web Application Developer s View Webcast October 30, 2001 Patrick Macdonald, Fernando Nasser Liam Stewart, Neil Padgett Red Hat Database Engineering Agenda Red Hat Database Web Interaction

More information

Database Access with JDBC. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark

Database Access with JDBC. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark Database Access with JDBC Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark jbb@ase.au.dk Overview Overview of JDBC technology JDBC drivers Seven basic steps in using JDBC Retrieving

More information

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

Database Programming. Week 9. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford Database Programming Week 9 *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford SQL in Real Programs We have seen only how SQL is used at the generic query interface

More information

INTRODUCTION TO JDBC - Revised Spring

INTRODUCTION TO JDBC - Revised Spring INTRODUCTION TO JDBC - Revised Spring 2006 - 1 What is JDBC? Java Database Connectivity (JDBC) is an Application Programmers Interface (API) that defines how a Java program can connect and exchange data

More information

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

Questions and Answers. A. A DataSource is the basic service for managing a set of JDBC drivers. Q.1) What is, in terms of JDBC, a DataSource? A. A DataSource is the basic service for managing a set of JDBC drivers B. A DataSource is the Java representation of a physical data source C. A DataSource

More information

SQL DML and DB Applications, JDBC

SQL DML and DB Applications, JDBC SQL DML and DB Applications, JDBC Week 4.2 Week 4 MIE253-Consens 1 Schedule Week Date Lecture Topic 1 Jan 9 Introduction to Data Management 2 Jan 16 The Relational Model 3 Jan. 23 Constraints and SQL DDL

More information

Java E-Commerce Martin Cooke,

Java E-Commerce Martin Cooke, Java E-Commerce Martin Cooke, 2002 1 Java Database Connectivity (JDBC) Plan Java database connectivity API (JDBC) Examples Advanced features JNDI JDBC 13/02/2004 Java E-Commerce Martin Cooke, 2003 2 Design

More information

Java application using JDBC to connect to a database.

Java application using JDBC to connect to a database. JDBC(JAVA DATABASE CONNECTIVITY) The Java JDBC API enables Java applications to connect to relational databases via a standard API, so your Java applications become independent (almost) of the database

More information

Content Services for JDBC Driver User Guide

Content Services for JDBC Driver User Guide Content Services for JDBC Driver User Guide Version 5.3 SP1 August 2005 Copyright 1994-2005 EMC Corporation. All rights reserved Table of Contents Preface... 7 Chapter 1 Introducing Content Services for

More information

JDBC, Transactions. Niklas Fors JDBC 1 / 38

JDBC, Transactions. Niklas Fors JDBC 1 / 38 JDBC, Transactions SQL in Programs Embedded SQL and Dynamic SQL JDBC Drivers, Connections, Statements, Prepared Statements Updates, Queries, Result Sets Transactions Niklas Fors (niklas.fors@cs.lth.se)

More information