Types of Databases. Types of Databases. Types of Databases. Databases and Web. Databases and Web. Relational databases may also have indexes

Similar documents
SQL: Programming. Announcements (September 25) Motivation. CPS 116 Introduction to Database Systems. Pros and cons of SQL.

ERwin and JDBC. Mar. 6, 2007 Myoung Ho Kim

Database Application Programs PL/SQL, Java and the Web

Database Programming Overview. COSC 304 Introduction to Database Systems. Database Programming. JDBC Interfaces. JDBC Overview

DATABASE DESIGN I - 1DL300

Instructor: Jinze Liu. Fall 2008

SQL: Programming Midterm in class next Thursday (October 5)

Inf 202 Introduction to Data and Databases (Spring 2010)

You write standard JDBC API application and plug in the appropriate JDBC driver for the database the you want to use. Java applet, app or servlets

JDBC Architecture. JDBC API: This provides the application-to- JDBC Manager connection.

DataBase Lab JAVA-DATABASE CONNECTION. Eng. Haneen El-masry

CPET 581 E-Commerce & Business Technologies. Topics

JAVA AND DATABASES. Summer 2018

COMP102: Introduction to Databases, 23

The Web Application Developer s. Red Hat Database. View. October 30, Webcast. Patrick Macdonald, Fernando Nasser. Red Hat Database Engineering

Outline. Lecture 10: Database Connectivity -JDBC. Java Persistence. Persistence via Database

INTRODUCTION TO JDBC - Revised spring

BUSINESS INTELLIGENCE LABORATORY. Data Access: Relational Data Bases. Business Informatics Degree

Working with Databases and Java

Cyrus Shahabi Computer Science Department University of Southern California C. Shahabi

Application Programming for Relational Databases

INTRODUCTION TO JDBC - Revised Spring

ICOM 5016 Database Systems. Database Users. User Interfaces and Tools. Chapter 8: Application Design and Development.

Wentworth Institute of Technology COMP570 Database Applications Fall 2014 Derbinsky. SQL Programming. Lecture 8. SQL Programming

The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets

Lab # 9. Java to Database Connection

CSC System Development with Java. Database Connection. Department of Statistics and Computer Science. Budditha Hettige

Java Applets, etc. Instructor: Dmitri A. Gusev. Fall Lecture 25, December 5, CS 502: Computers and Communications Technology

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

Visit for more.

Advanced Programming Techniques. Database Systems. Christopher Moretti

Java Database Connectivity

SQream Connector JDBC SQream Technologies Version 2.9.3

Calling SQL from a host language (Java and Python) Kathleen Durant CS 3200

Servlet 5.1 JDBC 5.2 JDBC

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies

JDBC [Java DataBase Connectivity]

Kyle Brown Knowledge Systems Corporation by Kyle Brown and Knowledge Systems Corporation

Database Application Development

Unit 3 - Java Data Base Connectivity

e-pg Pathshala Subject: Computer Science Paper: Web Technology Module: JDBC INTRODUCTION Module No: CS/WT/26 Quadrant 2 e-text

Accessing a database from Java. Using JDBC

Programming the World Wide Web by Robert W. Sebesta

Database Applications

Programming in Java

CMPUT 391 Database Management Systems. JDBC in Review. - Lab 2 -

Databases 2012 Embedded SQL

JDBC. Sun Microsystems has included JDBC API as a part of J2SDK to develop Java applications that can communicate with databases.

( A ) 8. If the address of an array is stored in $value, how do you get the values of this array? (B) \$value (C) &$value (D) $$value

Discuss setting up JDBC connectivity. Demonstrate a JDBC program Discuss and demonstrate methods associated with JDBC connectivity

Running SQL in Java and PHP

DB I. 1 Dr. Ahmed ElShafee, Java course

UNIT 3 XML DATABASES

CSCI/CMPE Object-Oriented Programming in Java JDBC. Dongchul Kim. Department of Computer Science University of Texas Rio Grande Valley

This lecture. Databases - JDBC I. Application Programs. Database Access End Users

O ne of the most important features of JavaServer

Server-side Web Programming

JAVA SYLLABUS FOR 6 WEEKS

Accessing databases in Java using JDBC

Announcements. SQL: Part IV. Transactions. Summary of SQL features covered so far. Fine prints. SQL transactions. Reading assignments for this week

JDBC, Transactions. Niklas Fors JDBC 1 / 38

CS WEB TECHNOLOGY

SQL in a Server Environment

Logging and Recovery. 444 Section, April 23, 2009

Web Architecture AN OVERVIEW

Running SQL in Java and PHP

Part I: Stored Procedures. Introduction to SQL Programming Techniques. CSC 375, Fall 2017

JDBC 3.0. Java Database Connectivity. 1 Java

COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA

CSE 336. Introduction to Programming. for Electronic Commerce. Why You Need CSE336

13 Creation and Manipulation of Tables and Databases

APPLYING INTERACTIVE WEB PAGES

SQL DML and DB Applications, JDBC

Planning and Designing Your Site p. 109 Design Concepts p. 116 Summary p. 118 Defining Your Site p. 119 The Files Panel p. 119 Accessing Your Remote

KINGS COLLEGE OF ENGINEERING 1

XML Metadata Standards and Topic Maps

JDBC Drivers Type. JDBC drivers implement the defined interfaces in the JDBC API for interacting with your database server.

Introduction to Information Systems

Advances in Programming Languages

Asst.Prof.Eng. IOAN-GHEORGHE RAŢIU, PhD Asst.Prof. NICOLETA DAVID. George Bariţiu University, Braşov

Tutorial: Using Java/JSP to Write a Web API

MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065)

Web Systems & Technologies: An Introduction

Tiers (or layers) Separation of concerns

Alpha College of Engineering and Technology. Question Bank

a. Jdbc:ids://localhost:12/conn?dsn=dbsysdsn 21. What is the Type IV Driver URL? a. 22.

Environment Settings on SIT

Chapter 1 An introduction to relational databases and SQL

Advances in Programming Languages

Developing Applications with Java EE 6 on WebLogic Server 12c

Bruce Moore Fall 99 Internship September 23, 1999 Supervised by Dr. John P.

13. Databases on the Web

Syllabus INFO-GB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Web based Applications, Tomcat and Servlets - Lab 3 -

Oracle Exam 1z0-809 Java SE 8 Programmer II Version: 6.0 [ Total Questions: 128 ]

UNIT-3 Java Database Client/Server

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

Software Paradigms (Lesson 10) Selected Topics in Software Architecture

SQL Environment: Module Types. System Aspects of SQL. SQL Environment: Introduction. SQL Environment: Introduction. SQL Environment: Privileges

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Transcription:

Types of Databases Relational databases contain stuctured data tables, columns, fixed datatype for each column Text databases are available for storing non-structured data typically text databases store collections of non-connected documents search of data is speeded up with search indexes like indexes on books - cover the whole text index item = (keyword, document,.., {weight, position ) there may be many index items pointing to the same document documents are usually fairly static -> index items related to a document do not usually change. Types of Databases Relational databases may also have indexes an index is made over a single column or a collection of columns index item = (value, internal_rowid) column values are typically dynamic -> index items deleted and added (often). Within one index there is only one index item pointing to a certain row. Types of Databases A typical query in a relational databases find rows that have specific values in certain colums find books where author= Smith A typical query in text databases find documents that contain specific keywords find documents that contain keyword Smith and author Text database queries are vague you might miss the documents and get documents you do not want Story of Smith, Author: Jones (retrieved - not wanted) Story of Jones, written by Smith (missed) The relational database query is semantically exact the name Smith has to be in column author - you get what you ask for Information available in Web may currently be considered mostly as a large distributed text database limited indexes (search engines) links connect documents Web material may be viewed with a browser. Most of the text in HTML-format, but also other formats are available (e.g. pdf) HTML -language defines the technical structure for the document (titles, paragraps, tables, lists, etc.) abstract layout - browser determines the actual layout Documents stored using standard file management systems. Local Web servers are configured to find the documents based on universal resource identifiers (URI)

HTML is an application of SGML-standard (general markup language) SGML- defines how to mark elements Elements are represented between begin and end marks <element_type> element </element_type> in HTML: <h1>level 1 header</h1> <table> <tr><td>table_element</td> </tr> </table> HTML-document may currently contain text, images, audio, video, executables HTML-document is readable anywhere - only browser is needed storable anywhere Internet/intranet server needed to provide access The problem with HTML-pages is to locate the information needed We are not able to use SQL-style queries select information from document_base where topic = needed_topic HTML does not mark topics but technical structures The queries on HTML-pages correspond to SQL-query select URI from document_base where document_content like %keyword% ; We usually retrieve huge number of documents most out of our interest Various search engines sort the result differently no order, newest ones first, most referred ones first XML is a meta-level standard for topic based markup. It is a simplification of SGML elements marked like in SGML We may define XML-based presentation languages for document types. Construction plan XML (CPML) might have elements like <general_plan>, <electricity_plan>,<building>,<room>, <ceiling>, <wall>, <window>, etc. XML does not define how to present the document (not even abstractly as HTML) The presentation may be defined with a separate definition (style sheet). There may be many presentations for the same document type. XML-capable browser should be able to show the document according to the style sheet.

XML makes it possible to use topics in searches select URL from CPML_document_base where tile in constructionplan.roof.materal Searches like the above assume new types of search engines and indexes WWW-pages hypertext in HTML-language text, images, hypelinks Static pages written once, changes must be made manually keeping pages up to date is a problem maintaining pages is hard if the same information is provided in many pages Its hard to find the information if the user does not share stuctural model of the author. Structuring the information in many ways causes maintenance problems WWW ja tietokannat Generation of a web-page Use generated pages for easy maintenance: Pages are generated with s using data stored in the (relational) database according to a schedule always when data is changed once a week,... When requested (=when somebody asks for the data) When pages are generated for each request, users actually activate a in the server CGI (common gateway interface), Java Servlet, ASP activation techniques Client page link (+ parameters) Generated page Server Sever side s The to be activated may receive parameters as written in URI book.search?isbn=0-123456-67-1&lang=fin as entered in HTML-form The to be activated may do anything (register an order, generate the answer for a request, charge 1M euros from users bank account,...) Sever side s Server side s may be written by any ming language Perl is common is CGI technique is used Java is very popular too (as servlets) There are techniques that combine the HTML-text and code in the same file JSP (Java Server Pages) ASP (Active server pages, Microsoft) PHP

Writing s to process a database Databases may be used in s written in various ming languages. Two approaches embedded SQL - pre-compiler based Use of a connection library - API, application ming Interface native dbms supplier libraries independent interfaces ODBC (C style), JDBC (Java) Embedded SQL Marked SQL- statements embedded among ming language (esim( C+SQL) Compiled Programming language compiler Precompiler Software library Programming language statements and calls for database library functions (SQL given as parameters) Connection library approach Connection library approach A general API must be used with a database magement system specific driver API library General interface (applies for any dbms) Driver (to operate with a specific dbms) Compiled Programming language compiler Programming language statements and calls for database library functions (SQL given as parameters) Program defines which driver to use Query processing in a Register a driver Start a session Build the query Execute the query Process the result Activate next row No Process the activate row more Done Quit the session // Example - uses solid db // path for driver must be included in CLASSPATH: import java.sql.*; import java.io.*; public class Esim1 { public static void main(string args[]) throws Exception { String url = jdbc:oracle:thin@db.cs.helsinki.fi:1521:test ; // This url identifies a database in db.cs.helsinki.fi Connection con; String query = "select code, course.name AS KNI, credits, "+ teacher.name AS OPNI " + "from course, teacher " + "where course.lecturer= teacher.teacherid " + "order by OPNI, KNI"; Statement stmt;

try { Class.forName forname(: oracle. (: oracle.jdbc.oracledriver"); catch(java java.lang.classnotfoundexception e) { // Driver not found. System.err.print("ClassNotFoundException ClassNotFoundException: : "); System.err.println println(e. (e.getmessage()); try { // start a session con = DriverManager.getConnection getconnection(url,, "info", "expert"); // make execution environment stmt = con.createstatement createstatement(); // Variable ope is used for keeping book on previous // teacher String ope =" "; // print header println( Teaching tasks:"); println(); // execute the query ResultSet rs = stmt.executequery executequery(query); // process the result while (rs( rs.next()) { // next row, getstring gets information from active row String opn = rs.getstring getstring(" ("OPNI"); // print empty row if teacher changes if (ope( ope.equals(.equals(opn)) { println(" " + rs.getstring getstring("kni")+ " (" + rs.getint getint("koodi")+")"); else { println(); ope= opn; println(ope); println(" " + rs.getstring getstring("kni")+" ("+rs rs.getint("koodi")+")");