MIT 1 204 - LECTURE NOTES (4 pages)

Previewing page 1 of 4 page document View the full content.
View Full Document

LECTURE NOTES



Previewing page 1 of actual document.

View the full content.
View Full Document
View Full Document

LECTURE NOTES

44 views

Lecture Notes


Pages:
4
School:
Massachusetts Institute of Technology
Course:
1 204 - Computer Modeling: From Human Mobility to Transportation Networks

Unformatted text preview:

Note most of this lecture has been removed due to copyright restrictions 1 204 Lecture 4 JDBC Code examples from JDBC API Tutorial and Reference JDBC API Package library of classes and methods to connect from a Java application to DBMS DBMS execute SQL statements and retrieve results SQL syntax primarily based on SQL 92 standard Standard set of error codes Standard way to connect and log on to DBMS Standard representation of data types Standard methods for data type conversions Standard methods to send SQL queries and receive result sets JDBC has level 1 4 functionality to deal with simple and sophisticated interfaces It can interface to files and other data sources as well 1 Transactions Group of operations often must be treated as atomic unit Start transaction Insert OrderHeader While more OrderDetail line items exist Select Part Update Part inventory Insert OrderDetail row Commit transaction if everything succeeds Roll back transaction if any error occurs In Order Header In OrderDetail Server crashes Disk crashes Network dies Etc Transaction properties ACID Atomicity y Either all of transactions are executed or all are rolled back Account transfer debit and credit both succeed or fail Consistency Only legal states can exist If order detail cannot be written order header is rolled back Isolation Results not seen by other transactions until the transaction is complete Account transfer debit and credit either both seen or neither is seen Durability Data is persistent even if hardware or software crashes What is written on the disk is correct Account balance is maintained 7 Transactions Multi user databases have other transaction issues Two database actions conflict if one or both are write it operations ti Examples E l off problems bl Lost updates 7 parts in inventory Transactions 1 and 2 simultaneously read 7 as the current quantity Transaction 1 finishes first adds 3 parts writes 10 as quantity Transaction 2 finishes second subtracts 5 parts writes 2 as quantity q



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view LECTURE NOTES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view LECTURE NOTES and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?