Creating and using Persistent Data From before – Where does the data come from? – Why is it kept? – How is it used? Affects design and implementation choices.

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
JDBC. JDBC (Java Database Connectivity): JDBC is an API for the Java programming language that defines how a client may access a database. It provides.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
1 Lecture 29 More on JDBC Overview  Objectives of this lecture  JDBC and its Drivers  Connecting to Databases (Java’s Connection class)  Querying a.
Java database Programming JDBC Trademarked name of a Java API that supports Java programs that access relational databases Stand for Java DataBase Connectivity.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
SQLLite and Java CS-328 Dick Steflik. SQLLite Embedded RDBMS ACID Compliant Size – about 257 Kbytes Not a client/server architecture –Accessed via function.
The Java Persistence API Edel Sherratt. Contents Revisit applications programming Using Java Persistence API.
Data Access Patterns. Motivation Most software systems require persistent data (i.e. data that persists between program executions). In general, distributing.
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 Section 6 Embedded SQL. 6-2 CA306 Embedded SQL Section Content 6.1Embedded SQL 6.2Java Database Connectivity 6.3Web Databases.
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
June 1, 2000 Object Oriented Programming in Java (95-707) Java Language Basics 1 Lecture 8 Object Oriented Programming in Java Advanced Topics Java Database.
© Wang Bin 2004 JDBC ----Java Database Connectivity.
Beginning Databases with JDBC Mike Bradley Adapted from and notes by Kevin Parker, Ph.D.
Database Programming in Java Corresponds with Chapter 32, 33.
Views, Indexes and JDBC/JSP tutorial Professor: Dr. Shu-Ching Chen TA: Haiman Tian 1.
ANDROID CONTENT PROVIDERS Peter Liu School of ICT, Seneca College.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
I Copyright © 2004, Oracle. All rights reserved. Introduction Copyright © 2004, Oracle. All rights reserved.
ABC Insurance Co. Paul Barry Steve Randolph Jing Zhou CSC8490 Database Systems & File Management Dr. Goelman Villanova University August 2, 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,
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.
Android Storage. There are several options for storage of data with Android We can put data into a preferences file. We can put data into a ‘normal’ file.
JDBC  The JDBC (Java Database Connectivity) API helps a Java program to access a database in a standard way  JDBC is a specification that tells the.
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
FEN Introduction to the database field:  Applications, concepts and terminology Seminar: Introduction to relational databases.
Index and JDBC/JSP tutorial Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
1 1 EPCC 2 Curtin Business School & Edinburgh University Management School Michael J. Jackson 1 Ashley D. Lloyd 2 Terence M. Sloan 1 Enabling Access to.
© 2005 Prentice Hall10-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
JDBC Enterprise Systems Programming. JDBC  Java Database Connectivity  Database Access Interface provides access to a relational database (by allowing.
Copyright © 2002 ProsoftTraining. All rights reserved. Building Database Client Applications Using JDBC 2.0.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
Computer Science [3] Java Programming II - Laboratory Course Lab 9: Accessing Databases with JDBC Instructions on Setting Accesses Connecting to and Querying.
1 CS 430 Database Theory Winter 2005 Lecture 14: Additional SQL Topics.
THE WEBMASTERS: SENG + WAVERING.  On account of construction, we will be having class in room 1248 next week.
12/6/2015B.Ramamurthy1 Java Database Connectivity B.Ramamurthy.
Li Tak Sing COMPS311F. Database programming JDBC (Java Database Connectivity) Java version of ODBC (Open Database Connectivity) ODBC provides a standard.
UNIT III - JDBC JDBC Overview – JDBC implementation – Connection class – Statements - Catching Database Results, handling database Queries. Networking–
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
SQLite DB Storing Data in Android RAVI GAURAV PANDEY 1.
Basics of JDBC Session 14.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 8: Applications Programming for Relational Databases Instructor’s.
Fundamentals of MyBATIS
Introduction to JDBC Instructor: Mohamed Eltabakh 1.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
Database Overview What is a database? What types of databases are there? How are databases more powerful than spreadsheets?
Intro to JDBC Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL.
Hoi Le. Why database? Spreadsheet is not good to: Store very large information Efficiently update data Use in multi-user mode Hoi Le2.
CHAPTER 9 File Storage Shared Preferences SQLite.
JDBC Statements The JDBC Statement, CallableStatement, and PreparedStatement interfaces define the methods and properties that enables to send SQL or PL/SQL.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
By: Eliav Menachi.  On Android, all application data (including files) are private to that application  Android provides a standard way for an application.
Introduction to Database Programming with Python Gary Stewart
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Data Storage in Android Димитър Н. Димитров. Why talk about data? Why not 3D graphics or network connectivity? Data as fundamental term in computer science.
Database: JDBC Overview
Web Technologies IT230 Dr Mohamed Habib.
Database JDBC Overview CS Programming Languages for Web Applications
JDBC.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
JDBC – ODBC DRIVERS.
Java Database Connectivity
Chapter 10 ADO.
Java API for Database Connectivity
JDBC Example.
Storing and Processing Sensor Networks Data in Public Clouds
Presentation transcript:

Creating and using Persistent Data From before – Where does the data come from? – Why is it kept? – How is it used? Affects design and implementation choices – Modelling choices – Storage choices – Applications programming

Influence of source Data volume Rate of arrival

Why the data is kept Human reasons for storing data Who needs it? Does it matter if others see it? Does it matter if it is lost or corrupted? How closely does it need to model reality? Does it need to be up-to-date?

Data usage How frequently is the data updated? How frequently is it queried? Are there patterns of use?

Other factors Budget Platform Licensing Level of support required

Modelling choices Entity-relationship model Object model Name-value pairs

Contacts See Contact.java at ng/CourseNotes/current/CS12230/code/1- week1-in-lab/0-simple-examples/Contact.java ng/CourseNotes/current/CS12230/code/1- week1-in-lab/0-simple-examples/Contact.java What if we want the contacts data to persist?

Contact – OO model UML class diagram Attributes name and phone Operation toString()

Contact – ER model Just the attributes No operations Still a UML class diagram

Key-value pairs Name is the key Phone is the value Data model is a kind of persistent hash table

Storage choices Text file Spreadsheet Browser Database – Relational – Object oriented – NoSQL – Native XML – …

Browser HTML5 localStorage localStorage.setItem(key, value) localStorage.getItem(key) For offline use, use appcache Benefits Limitations Example

SQLite Create the SQLite database Use a shell tool – a convenient way to create the database in the first place Or write a program

Applications Programming with SQL/CLI Obtain a handle on the database Send SQL queries to the database management system using query functions Process the results of those queries – Results are tables and must be transformed into types that the application program can use

Java JDBC image from accessed 15/Oct/2012http://

Java JDBC Driver manager provides implementations of Connection, Statement and ResultSet Connection acts as database handle Statement enables creation and execution of SQL queries ResultSet maintains a cursor that enables access to current row of data returned by query

SQLite with Java JDBC Suppose you have a database and a jdbc driver In your Java program – Initialize the jdbc driver Class.forName("org.sqlite.JDBC"); causes org.sqlite.JDBC to be loaded at runtime – Get a connection this.connection = DriverManager.getConnection("jdbc:sqlite:"+dbname); – Use the connection to send SQL queries to the database Contacts example

Java Persistence API Alternative to call level interface Work directly with the object oriented data model We’ll revisit this later in the course

Summary First think about – Where the data comes from – Why the data is stored – How it is to be used Then think about – Data models – Data storage options – Applications programming