Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.

Slides:



Advertisements
Similar presentations
Database System Concepts and Architecture
Advertisements

Lecture plan Information retrieval (from week 11)
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Ten: Managing Databases with SQL Server 2008.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
Fundamentals, Design, and Implementation, 9/e SI654 Database Application Design Instructor: Dragomir R. Radev Winter 2005.
Introduction to Web Database Processing
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Introduction to Web Interface Technology (CSE2030)
Fundamentals, Design, and Implementation, 9/e Chapter 7 Using SQL in Applications.
Integration case study Week 8 – Lecture 1. Enrolment request (Workstation) Application server Database server Database New University Student Record System.
Fundamentals, Design, and Implementation, 9/e Chapter 1 Introduction to Database Processing.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
Java database Programming JDBC Trademarked name of a Java API that supports Java programs that access relational databases Stand for Java DataBase Connectivity.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Managing Concurrency in Web Applications. DBI 2007 HUJI-CS 2 Intersection of Concurrent Accesses A fundamental property of Web sites: Concurrent accesses.
Transaction Management and Concurrency Control
Database Management Systems (DBMS)
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Java Server Programming Jeff Schmitt Towson University October 15, 1998.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
Database Management Systems 1 Oracle Programming.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Database Programming in Java Corresponds with Chapter 32, 33.
Modern Software Technologies Java™, J2EE™, JSP™, JDBC™ by Radoslav Tr. Ivanov
JDBC. JDBC Drivers JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Midterm Exam Chapters 1,2,3,5, 6,7 (closed book) March 11, 2014.
12-CRS-0106 REVISED 8 FEB 2013 CSG2H3 Object Oriented Programming.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
1cs Intersection of Concurrent Accesses A fundamental property of Web sites: Concurrent accesses by multiple users Concurrent accesses intersect.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
Fundamentals, Design, and Implementation, 9/e by David M. Kroenke BSA206 Database Management Systems Lecture 21: Databases and the Web Chapters 12, 13.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Java Database Connectivity. Java and the database Database is used to store data. It is also known as persistent storage as the data is stored and can.
Jsp (Java Server Page) Is a server side program.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
+ Connecting to the Web Chapter 7. + Chapter Objectives Understand and be able to set up Web database processing Learn the basic concepts of Extensible.
Java JDBC API. A Java API To Access almost any kind of tabular data To Access almost any kind of tabular data Trademarked (not an acronym) Trademarked.
DataBases and SQL INFSY 547 Spring Course Wrap Up April 12: Complete Work on Servlets Review of Team Projects Close of Portfolio Work April 19:
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
JSP Server Integrated with Oracle8i Project2, CMSC691X Summer02 Ching-li Peng Ying Zhang.
Database Connectivity and Server-Side Scripting Chapter 12.
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
ViaSQL Technical Overview. Viaserv, Inc. 2 ViaSQL Support for S/390 n Originally a VSE product n OS/390 version released in 1999 n Identical features.
1 Database Management Systems (II) Chapter 14. JDBC, Java Server Pages, and MySQL © 2005 by Dr. F. Lin.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
Intro to JDBC Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL.
Database Processing Applications Chapter Seven DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 7 th Edition.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Java High level programming language ◦ Sun Microsystems ◦ ORACLE acquired Java Development Kit – JDK Java Runtime Environment – JRE Java Virtual Machine.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Web Technologies IT230 Dr Mohamed Habib.
PHP / MySQL Introduction
Database Processing Applications
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/2 Copyright © 2004 JDBC  JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/3 Copyright © 2004 Java Servlet and Applet  An applet is a compiled, machine-independent, Java bytecode program that is transmitted to a browser via HTTP and is invoked using the HTTP protocol  A servlet is a Java program that is invoked on the server to respond to HTTP requests  Type 3 and Type 4 drivers can be used for both applets and servlets  Type 2 drivers can be used only in servlets

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/4 Copyright © 2004 JDBC Components

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/5 Copyright © 2004 Using JDBC 1. Load the driver –The driver class libraries need to be in the CLASSPATH for the Java compiler and for the Java virtual machine –Class.forName(string).newInstance(); 2. Establish a connection to the database –Connection conn = DriverManager.getConnection(string); –A connection string includes the literal jdbc:, followed by the name of the driver and a URL to the database

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/6 Copyright © 2004 Using JDBC (cont.) 3. Create a statement –Statement stmt = conn.createStatement(); 4. Execute the statement –ResultSet rs = stmt.executeQuery(querystring); –Int result = stmt.executeUpdate(updatestring); –ResultSetMetaData rsMeta = rs.getMetaData();  Both compiled queries and stored procedures can be processed via JDBC using PreparedStatement and CallableStatement objects

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/7 Copyright © 2004 Java Server Pages  Java Server Pages (JSP) provide a means to create dynamic Web pages using HTML, XML, and Java  JSP pages provide the capabilities of a full object-oriented language to the page developer –Neither VBScript nor JavaScript can be used in a JSP –JSPs are compiled into machine-independent bytecode

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/8 Copyright © 2004 JSP Compilation Process

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/9 Copyright © 2004 JSP Pages and Servlets  JSPs are compiled as subclasses of the HTTPServlet class –Consequently, small snippets of code can be placed in a JSP, as well as complete Java programs  To use JSPs, the Web server must implement the Java Servlet 2.1+ and Java Server Pages 1.0+ specifications –Apache Tomcat, an open source product from the Jakarta Project, implements these specifications –Tomcat can work in conjunction with Apache or can operate as a standalone Web server for testing purposes

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/10 Copyright © 2004 Using JSP processor  When using JSP processor, e.g. Tomcat, the JDBC drivers, JSP pages, and any Java beans must be located in specified directories  When a JSP is requested, Tomcat ensures that the most recent page is used –If an uncompiled newer version is available, Tomcat will automatically cause it to be parsed and compiled  There is a maximum of one JSP in memory at a time, and JSP requests are executed as a thread of the servlet processor and not as a separate process  The Java code in a JSP can load invoke a compiled Java bean

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/11 Copyright © 2004 MySQL  MySQL is an open source DBMS that runs on UNIX, Linux, and Windows  MySQL is easy to use, relatively inexpensive (no license fee), and can provide fast query processing  Limitations –MySQL does not support views, stored procedures, or triggers –Referential integrity can be defined, but it is not enforced by MySQL

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/12 Copyright © 2004 MySQL (cont.)  MySQL maintains a data dictionary in a database named mysql  The user and db tables can be queried to determine user permissions  To access MySQL from JDBC, the user account must be granted access to the database, either from any location or from a TCP/IP address that represents the local computer

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/13 Copyright © 2004 Concurrency Control  MySQL provides limited support for concurrent processing –There is no support for transactions, i.e., no COMMIT or ROLL BACK statements or transaction isolation  MySQL locks at the table level –This may cause throughput problem –Shared read locks are obtained when processing SELECT statements –Exclusive locks are obtained when processing INSERT, UPDATE, or DELETE

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/14 Copyright © 2004 Concurrency Control (cont.)  Users can surround transaction logic with LOCK TABLES and UNLOCK TABLES commands  Deadlock is prevented by allowing, at most, one lock statement to be open at a time  Dirty reads are possible if some applications roll back their own work and do not surround their activity with table locks

Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 14/15 Copyright © 2004 Backup and Recovery  MySQL provides limited backup and recovery facilities  There is a backup utility that augments the operating system copy utilities  MySQL maintains a log of commands processed but no before and after images, nor data values from bulk updates or deletions  To restore a database, an older version of the database is copied back, and the commands in the log are reapplied

Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL