Interacting With Data Databases.

Slides:



Advertisements
Similar presentations
PHP II Interacting with Database Data. The whole idea of a database-driven website is to enable the content of the site to reside in a database, and to.
Advertisements

PHP (2) – Functions, Arrays, Databases, and sessions.
ASP Application Development Session 3. Topics Covered Using SQL Statements for: –Inserting a tuple –Deleting a tuple –Updating a tuple Using the RecordSet.
Introduction to Web Database Processing
Object-Oriented Application Development Using VB.NET 1 Chapter 13 Introduction to Data Access Classes and Persistence.
4/8/99 C. Edward Chow Page 1 Active Server Page It is a server-side scripting environment for creating dynamic content. ASP are files with.asp extension,
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Chapter 4: Database Management. Databases Before the Use of Computers Data kept in books, ledgers, card files, folders, and file cabinets Long response.
Attribute databases. GIS Definition Diagram Output Query Results.
MIS2502: Data Analytics MySQL and SQL Workbench David Schuff
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Computing for Bioinformatics Introduction to databases What is a database? Database system components Data types DBMS architectures DBMS systems available.
JDBC Java Database Connectivity. What is an RDBMS? Relational database management system. There are other kinds of DBMS. Access is a GUI on a JET RBDMS.
 Introduction Introduction  Purpose of Database SystemsPurpose of Database Systems  Levels of Abstraction Levels of Abstraction  Instances and Schemas.
ASP.NET Programming with C# and SQL Server First Edition
Interacting With Data Week 8 Connecting to the database Creating recordsets Interacting with the database.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
Java Database Connectivity (JDBC) Introduction to JDBC JDBC is a simple API for connecting from Java applications to multiple databases. Lets you smoothly.
Database 20/2/12 Connection. 
Database Programming in Java Corresponds with Chapter 32, 33.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Server Side Programming ASP1 Server Side Programming Database Integration (cont.) Internet Systems Design.
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
Simple Database.
CS 474 Database Design and Application Terminology Jan 11, 2000.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Database Management. ICT5 Database Administration (DBA) The DBA’s tasks will include the following: 1. The design of the database. After the initial design,
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Programming Games in Visual Basic: Data base Catch up questions Data base: generalities & specifics on Visual Basic links Lab: work on projects.
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
MET280: Computing for Bioinformatics Introduction to databases What is a database? Not a spreadsheet. Data types and uses DBMS (DataBase Management System)
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
System Initialization 1)User starts application. 2)Client loads settings. 3)Client loads contact address book. 4)Client displays contact list. 5)Client.
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.
Instructor: Dema Alorini Database Fundamentals IS 422 Section: 7|1.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
Chapter 10: The Data Tier We discuss back-end data storage for Web applications, relational data, and using the MySQL database server for back-end storage.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
Database Management Systems.  Database management system (DBMS)  Store large collections of data  Organize the data  Becomes a data storage system.
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
JDBC. Java.sql.package The java.sql package contains various interfaces and classes used by the JDBC API. This collection of interfaces and classes enable.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Chapter 10 Database Management. Data and Information How are data and information related? p Fig Next processing data stored on disk Step.
Database Access Using JDBC BCIS 3680 Enterprise Programming.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
JDBC CS 260 Database Systems. Overview  Introduction  JDBC driver types  Eclipse project setup  Programming with JDBC  Prepared statements  SQL.
Database Connectivity What is ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a Microsoft Active-X component.
CIS 250 Advanced Computer Applications Database Management Systems.
Instructor: Pavlos Pavlikas1 How Data is Stored Chapter 8.
Introduction to Databases Angela Clark University of South Alabama.
Labtest.ASP Notes. INSERT STATUS INSERT STATUS
PREPARED BY: PN. SITI HADIJAH BINTI NORSANI. LEARNING OUTCOMES: Upon completion of this course, students should be able to: 1. Understand the structure.
Object-Oriented Application Development Using VB.NET 1 Chapter 13 Introduction to Data Access Classes and Persistence.
Using databases ActiveX Data Objects (ADO) Connecting to a database Reading data from a database Inserting, updating and deleting records Using databases.
MYSQL AND MYSQL WORKBENCH MIS2502 Data Analytics.
1 Management Information Systems M Agung Ali Fikri, SE. MM.
Introduction to Database Programming with Python Gary Stewart
JDBC Database Management Database connectivity
IS444: Modern tools for applications development
mysql and mysql workbench
IS444: Modern tools for applications development
ICT Database Lesson 1 What is a Database?.
Chapter 27 WWW and HTTP.
DATABASES WHAT IS A DATABASE?
Database Connections.
Presentation transcript:

Interacting With Data Databases

Database Management System Store, manage, retrieve data Applies database and security rules DBMS Server Computation, Replication/Backup Interprets SQL Queries DBMS is a group of software applications designed to provide a variety of functions for Data and the applications that access the data.

Structure of a Data Table Table Name Students Column (Field) Studentno Name Address Phone Row (Record) 11462534 White 9 White St 783-5643 44376789 Brown 6 Brown Rd 656-2222 23390765 Smith 2 Smith St 222-5858 Information is added to data table on a Row by Row basis Table names and Column names are case sensitive

Databases Two main types of Database structures used in this course. The Flat File model and the Relational Model. Flat File – Based on a single table. Simple but inefficient for complex data storage and retrieval. Relational – multiple tables in single database More efficient, but harder to create and organize. Has been the standard model for several decades.

Database (Flat File) - Data Table The Flat File data model relies on a single table to hold all data about a particular subject. The data table can become very large and difficult to manage The common Telephone Book is a classic example of a Flat-File database Very few serious applications rely on this database model.

Flat-File Model Students Columns are duplicated, increasing table size Studentno Name Address Phone Course1 Mark1 Course2 Mark2 11462534 White 9 White St 783-5643 INT213 75 DCN286 65 44376789 Brown 6 Brown Rd 656-2222 IOS110 55 ULI101 72 23390765 Smith 2 Smith St 222-5858 IOS110 70 HWD101 80 In complex databases, the Flat-File model cannot avoid duplication of Column data. Searching, updating and deleting data becomes very difficult

How Data Flows ODBC Connection Interpreter (DSN) (Translates client request so DBMS understands what the client wants) Client Browser Sends Recordset request by way of Connection Object Sends and receives Query request by way of Recordset Object Database Management System (Applies rules and searches for data) Data Tables (contains all information) Search for Data (SQL query) Create recordset based on data found Recordsets (contains copy of information requested by client)

How Data Flows ODBC Connection Interpreter (DSN) (Translates client request so DBMS understands what to do) Open Database Connectivity provides a standard software interface to different database management systems (DBMS). Software applications can communicate with different DBMSs without altering their applications by using drivers provided by Database system vendors DSNs (data source name) are set up to use drivers, either by; 1) accessing the ODBC applet in the control panel or, 2) writing a DSN-less connection string (handy when you do not have access to the control panel or when the O/S does not have a control panel) A Connection Object is created which allows the application to connect to the database System

Creating The Connection Object How Data Flows Creating The Connection Object The Connection Object can be created either as a DSN or DSN-less connection DSN Connection <% ‘create the object (DSN already set in the control panel) that will connect to the database Set conn = CreateObject (“ADODB.Connection”) ‘ open the connection conn.Open “INT213con” %> DSN-less Connection <% ‘create the object without DSN being setup in control panel Set conn = CreateObject (“ADODB.Connection”) ‘ create the connection conn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" &_ "DBQ=C:\Inetpub\wwwroot\INT213db.mdb“ ‘Open the connection conn.Open %>

Recordsets (contains information requested by client) Recordset Object Recordsets (contains information requested by client) Recordset Object sends a query to the database system using the Connection Object. The DBMS processes the query and returns the data requested in the form of Rows and Columns (just like an Excel spreadsheet). The Recordset and the data it contains is a copy (snapshot) of the data from the data tables. It is held in RAM on the client system. This data can be displayed, altered, deleted, etc. Any changes are sent back to the server using the Recordset Object The actual data tables will not be affected by changes until the Recordset is written back to the Data Tables.

Recordset Object Creating Recordsets 'set SQL statement that will search for all data in the database Table you created in Access sql = "SELECT * FROM students" 'Establish the recordset which will hold a copy of the retrieved data in memory Set rs = Server.CreateObject("ADODB.RecordSet") 'Open the recordset using the Server connection rs.Open sql, conn

The Whole Thing - Together <% Option Explicit %> <% Dim conn, rs, sql, path, StuNo, StuPhone Set conn = Server.CreateObject("ADODB.Connection") ‘Open the connection conn.Open “INT213con” 'set SQL statement that will search for all data in the database Table you created in Access sql = "SELECT * FROM students" 'Establish the recordset which will hold a copy of the retrieved data in memory Set rs = Server.CreateObject("ADODB.RecordSet") 'Open the recordset using the Server connection rs.Open sql, conn Place the data into variables before closing the Recordset. StuNo = rs(“Studentno”) StuPhone = rs(“Phone”) 'Close the connection to Server and Recordset rs.close set rs = nothing conn.close set conn = nothing %>

SQL Looking for Data in All the Right Places Using the Students Table, lets see what some SQL queries can do Select * From Students Select * From Students Where Studentno <> 44376789 Select Phone, Name From Students Order By Studentno Select * From Students Order by Name DESC SQL is the language of Database Systems. It is extremely powerful, but the logic of its’ use is easy to understand. SQL is a course in itself, so we will only deal with very basic issues in this course.

Combining SQL with Form Data Dynamic web sites require input from users who want specific data from a database. To retrieve this data it will be necessary to combine an SQL statement with the Request object. Data = “Select * from Students Where Name = ‘” & Request(”txtname”) & “’” Note the Single quotes. They protect the double quotes that are added by the Text Box. The single quotes act as an extra set of double quotes.