java语言程序设计 进阶篇 原书第八版 课件 PPT(第三十七章)

  • 格式:ppt
  • 大小:274.50 KB
  • 文档页数:60

下载文档原格式

  / 60
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1
Objectives
To
understand the concept of database and database management systems (§37.2). To understand the relational data model: relational data structures, constraints, and languages (§37.2). To use SQL to create and drop tables, and to retrieve and modify data (§37.3). To learn how to load a driver, connect to a database, execute statements, and process result sets using JDBC (§37.4). To use prepared statements to execute precompiled SQL statements (§37.5). To use callable statements to execute stored SQL procedures and functions (§37.6). To explore database metadata using the DatabaseMetaData and ResultSetMetaData interfaces (§37.7).
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
6
Course Table
Relation/Table Name Columns/Attributes
Course Table Tuples/ Rows
courseId 11111 11112 11113 11114 11115 11116 11117 11118
subjectId CSCI CSCI CSCI CSCI MATH MATH EDUC ITEC
courseNumber 1301 1302 3720 4750 2750 3750 1111 1344
title Introduction to Java I Introduction to Java II Database Systems Rapid Java Application Calculus I Calculus II Reading Database Administration
numOfCredits 4 3 3 3 5 5 3 3
Application Programs System Users Database Management System (DBMS)
e.g., Access, MySQL, Oracle, and MS SQL Server
database
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Structure defines the representation of the data. Integrity imposes constraints on the data. Language provides the means for accessing and manipulating data.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
2
来自百度文库
What is a Database System?
Application Users
8
Enrollment Table
Enrollment Table ssn 444111110 444111110 444111110 444111111 444111111 444111111 444111112 444111112 444111112 444111113 444111113 444111114 444111115 444111115 444111116 444111117 444111118 444111118 444111118 courseId 11111 11112 11113 11111 11112 11113 11114 11115 11116 11111 11113 11115 11115 11116 11111 11111 11111 11112 11113 dateRegistered 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 2004-03-19 grade A B C D F A B C D A A B F F D D A D B
3
Database Application Systems
Application Users
Application Programs
Database Management System

Database Management System


database
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
Chapter 37 Java Database Programming
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
5
Relational Structure
A relational database consists of a set of relations. A relation has two things in one: a schema and an instance of the schema. The schema defines the relation and an instance is the content of the relation at a given time. An instance of a relation is nothing more than a table with rows and named columns. For convenience with no confusion, we refer instances of relations as just relations or tables.
9
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
Table vs. File
NOTE: A table or a relation is not same as a file. Most of the relational database systems store multiple tables in a file.
4
Rational Database and Relational Data Model
Most of today’s database systems are relational database systems, based on the relational data model. A relational data model has three key A relational data model has three key components: structure, integrity and languages.
1969-04-29 101 Washington St. 31435
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807
7
Student Table
Student Table ssn 444111110 444111111 444111112 444111113 444111114 444111115 444111116 444111117 444111118 444111119 444111120 firstName Jacob John George Frank Jean Josh Josh Joy Toni Patrick Rick mi lastName R K K E K R R P R R R Smith Stevenson Smith Jones Smith Woo Smith Kennedy Peterson Stoneman Carter phone 9129219434 9129219434 9129213454 9125919434 9129219434 7075989434 9129219434 9129229434 9129229434 9129229434 9125919434 birthDate street zipCode deptID BIOL BIOL CS BIOL CHEM CHEM BIOL CS MATH MATH BIOL 1985-04-09 99 Kingston Street 31435 null 100 Main Street 31411 31419 31411 31411 31411 31411 31412 31412 31411 1974-10-10 1200 Abercorn St. 1970-09-09 100 Main Street 1970-02-09 100 Main Street 1970-02-09 555 Franklin St. 1973-02-09 100 Main Street 1974-03-19 103 Bay Street 1964-04-29 103 Bay Street 1986-04-09 19 West Ford St.