Real SQL Programming 1

Size: px
Start display at page:

Download "Real SQL Programming 1"

Transcription

1 Real 1 We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional programs using SQL to interact with a database. 1 These slides have been adapted from those used by Jeff Ullman.

2 Options There are 3 ways in which programs are combined with SQL: 1. Code in a specialized language is stored in the database itself (e.g., PSM, PL/SQL). 2. SQL statements are embedded in a host language (e.g., C, Java). 3. Connection tools are used to allow a conventional language to access a database (e.g., CLI, JDBC, /PDO).

3 The first method is often called stored procedures : PSM, or persistent stored modules, allows us to store procedures as database schema elements. PSM = a mixture of conventional statements (if, while, etc.) and SQL. Lets us do things we cannot do in SQL alone. We can CREATE PROCEDUREs, e.g., and then CALL them from within SQL queries.

4 The second method uses embedded SQL: Key idea: A preprocessor turns SQL statements into procedure calls that fit with the surrounding host-language code. All embedded SQL statements begin with EXEC SQL, so the preprocessor can find them easily.

5 Shared Variables To connect SQL and the host-language program, the two parts must share some variables. Declarations of shared variables are bracketed by: EXEC SQL BEGIN DECLARE SECTION; <host-language declarations> EXEC SQL END DECLARE SECTION;

6 Use of Shared Variables In SQL, the shared variables must be preceded by a colon. They may be used as constants provided by the host-language program. They may get values from SQL statements and pass those values to the host-language program. In the host language, shared variables behave like any other variable.

7 Example: Looking Up Prices We will use C with embedded SQL to sketch the important parts of a function that obtains a beer and a bar, and looks up the price of that beer at that bar. Assumes the database contains the Sells(bar, beer, price) relation.

8 Example: C Plus SQL EXEC SQL BEGIN DECLARE SECTION; char thebar[21], thebeer[21]; float theprice; EXEC SQL END DECLARE SECTION; /* obtain values for thebar and thebeer */ EXEC SQL SELECT price INTO :theprice FROM Sells WHERE bar = :thebar AND beer = :thebeer; /* do something with theprice */

9 Need for Dynamic SQL Most applications use specific queries and modification statements to interact with the database. The preprocessor compiles EXEC SQL... statements into specific procedure calls and produces an ordinary host-language program that uses a library. What about situations in which query statements themselves are assembled by the host language, perhaps using user input? This gives rise to dynamic SQL.

10 Dynamic SQL Usually consists of two steps (SQL statements): 1. Preparing a query: EXEC SQL PREPARE <query-name> FROM <text of the query>; 2. Executing a query: EXEC SQL EXECUTE <query-name>; Prepare = optimize query. Prepare once, execute many times. If we are only going to execute the query once, we can combine the PREPARE and EXECUTE steps into one, using: EXEC SQL EXECUTE IMMEDIATE <text>;

11 Host/SQL Interfaces Via Libraries The third approach to connecting databases to conventional languages is to use library calls. C + CLI Java + JDBC + PDO We will only consider + PDO.

12 Three-Tier Architecture for Web Access A common environment for using a database over the Web has three tiers of processors: 1. Web servers talk to the user. 2. Application servers execute the business logic. 3. servers get what the application servers need from the database.

13 Example: Amazon holds the information about products, customers, etc. Business logic includes things like what do I do after someone clicks checkout? Answer: Show the how will you pay for this? screen.

14 SQL/CLI Instead of using a preprocessor (as in embedded SQL), we can use a library of functions. The library for C is called SQL/CLI = Call-Level Interface. s preprocessor will translate the EXEC SQL... statements into CLI or similar calls, anyway.

15 : Hypertext Preprocessor () is an open-source, server-side scripting language It is interpreted, so no possibility of using EXEC SQL and a preprocessor. Can be embedded within HTML on a web page in order to generate dynamic content. uses <?php and?> delimiters for code. delimiters differentiate the code from static HTML. DB library is called PDO ( Data Objects). Variables (which must start with $) don t have to be declared and are not strongly typed. web server needs to have installed.

16 Making a Connection Example: <?php $dbhost = mysql:host=mysqlsrv.dcs.bbk.ac.uk; dbname=... ; $dbuser =... ; $dbpass =... ; $db = new PDO($dbhost, $dbuser, $dbpass);...?> We want to connect to a mysql server, and need to give the name of the machine it runs on. We need to specify the database name (dbname). The user name and password are also required. PDO object allows us to open a connection to the database specified by the values of the variables.

17 Executing an SQL Statement Example: <?php... $db = new PDO($dbhost, $dbuser, $dbpass); $result = $db->query( "select count(*) from Drinkers");...?> The query method applies to a connection object. It takes a string argument and returns a result. Could be an error code or the relation returned by the query.

18 Retrieving a Query Result Example: $count = $result->fetchcolumn(0); print ("There are $count rows in Drinkers."); The result of a query is the set of rows returned. In our example, only one row is returned, with one column (the count). Method fetchcolumn applies to the result, and fetchcolumn(0) returns the value of the first column. This can then be output using the print function. This output is returned by the web server to the browser which requested the page.

19 String Values solves a problem for languages that commonly construct strings as values: How do I tell whether a substring needs to be interpreted as a variable and replaced by its value? solution: Double quotes means replace; single quotes means don t. Example: $100 = "one hundred dollars"; $sue = You owe me $100. ; $joe = "You owe me $100."; Value of $sue is You owe me $100. Value of $joe is You owe me one hundred dollars.

20 Complete Example <html> <body> <h2>counting the number of drinkers</h2> <p> <?php $dbhost = mysql:host=mysqlsrv.dcs.bbk.ac.uk;dbname=.. $dbuser =... ; $dbpass =... ; $db = new PDO($dbhost, $dbuser, $dbpass); $result = $db->query("select count(*) from Drinkers"); $count = $result->fetchcolumn(0); print ("There are $count rows in Drinkers.");?> </p> </body> </html>

21 Example Explained Notice that the code is embedded in HTML. Whatever is output by the script (using print will be embedded in the HTML in place of the script source code. The file is accessible as ac.uk/~ptw/teaching/dbm/php/db1.php. Creating a link to this URL, or entering it as an address into a browser will result in the DCS web server executing the code.

22 Processing a Set of Rows (1) Say the query in our program is: $result = $db->query( "select * from Drinkers"); This returns a number of rows, so we use a while loop. We want to output the rows as an HTML table. So we need to output HTML table tags <table> and </table> before and after the script. Each time around the while loop, we output HTML row tags <tr> and </tr>. We also need an inner (for) loop to output each column value, inside HTML <td> and </td> tags.

23 Processing a Set of Rows (2) while ($row = $result->fetch()) { print ("<tr>"); for ($i = 0; $i < $result->columncount(); $i++) { print ("<td> $row[$i] </td>"); } print ("</tr>"); } fetch() method fetches the next row as an array. columncount() returns the number of columns. $row[$i] is the value of the i th column of the current row. The file is accessible as ac.uk/~ptw/teaching/dbm/php/db2.php.

24 Processing a Set of Rows (3) The HTML generated by the script is as follows: <html> <body> <h1>the Drinkers Table</h1> <table border= 2 > <tr><td> Alice </td><td> Islington </td></tr> <tr><td> Bob </td><td> Bloomsbury </td></tr> <tr><td> Carol </td><td> Islington </td></tr> <tr><td> Dave </td><td> Bloomsbury </td></tr> <tr><td> Eve </td><td> Stratford </td></tr> </table> </body> </html>

25 Arrays Two kinds: numeric and associative. Numeric arrays are ordinary, indexed 0, 1,... Example: $a = array("paul", "George", "John", "Ringo"); Then $a[0] is "Paul", $a[1] is "George", and so on.

26 Associative Arrays Elements of an associative array $a are pairs x => y, where x is a key string and y is any value. If x => y is an element of $a, then $a[x] is y. uses associative arrays for retrieving the data that users enter into HTML forms.

27 Retrieving User Input Let s say we want to allow users to enter the name of the database table whose contents they wish to be displayed. We can use an HTML form, with a field (text box) where they can enter the table name. The value they enter must be sent to the web server along with the request to run a script. The script must be able to retrieve this value and use it as part of an SQL query.

28 An HTML Form The HTML form is available at ac.uk/~ptw/teaching/dbm/php/db.html and the source code used on it is explained on the following slides.

29 HTML Form Explained <form action="db3.php" method="get"> Table: <input type="text" name="tablename" /> <input type="submit" /> </form> The form element has an action attribute which specifies the URL of the script (...db3.php) to be run. The form element has a method attribute which specifies that the HTTP GET method is to be used. This will send the user s input appended to the URL of the script and separated by a? (a so-called query string ). The form has two input elements, one representing a text box; the other a submit button. The name of the text box is tablename.

30 Processing User Input... $table = $_GET[ tablename ]; print ("<h1>the $table Table</h1>"); $query = "select * from $table"; $result = $db->query($query);... The rest of the script is as before. $_GET is a built-in associative array, indexed by the names of the text boxes used on the form. Each value is whatever the user typed into the corresponding text box. If the user typed Pubs (without the quotes) into the text box named tablename on the form, then $_GET[ tablename ] will be replaced by Pubs (without the quotes).

31 Using Prepared Statements The query method executes an SQL statement immediately. PDO can also prepare and execute statements separately. Prepared statements have some advantages: Statement strings can contain placeholders rather than literal data values (see next slide). A prepared statement can be executed repeatedly without the need for the DBMS to work out an execution plan each time.

32 Placeholders in SQL Statements Where users are expected to provide values for SQL statements at run-time, placeholders can be used. Anonymous placeholders are indicated by? characters in the SQL query string. The program then associates values with these by providing an array of values. Named placeholders are indicated by a name preceded by a colon, e.g., :location. Values are associated with named placeholders by using either an associative array or the bindparam method.

33 Anonymous Placeholders $query = "select price from Sells where pub=? and beer=?"; $stmt = $db->prepare($query); $pub = $_GET[ pub ]; $beer = $_GET[ beer ]; $stmt->execute(array($pub, $beer)); $row = $stmt->fetch(); print ("<h2>the $pub sells $beer for $row[0]</h2>"); Query finds the price of a given beer sold by a given pub ( script db4.php). The text boxes in the form are named pub and beer. The value of $_GET[ pub ] is associated with the first? in the query, while the value of $_GET[ beer ] is associated with the second?.

34 Named Placeholders (1) $query = "insert into Pubs (name, location) values (:name, :location)"; $stmt = $db->prepare($query); $pub = $_GET[ pub ]; $location = $_GET[ location ]; $stmt->bindparam( :name, $pub); $stmt->bindparam( :location, $location);... SQL statement inserts a pub name and location into Pubs ( script db5.php). The text boxes in the form are named pub and location. The placeholders are :name and :location. bindparam binds each placeholder (parameter) to a value (from the form).

35 Named Placeholders (2)... if ($stmt->execute()) print ("<h2>the $pub in $location inserted</h2>"); else { print ("<h2>failed to insert the $pub in $location</h2>"); print_r($stmt->errorinfo()); } execute returns a Boolean, indicating success or failure. errinfo() returns an array of error information. print_r displays information about a variable in readable form.

Real SQL Programming. Embedded SQL Call-Level Interface Java Database Connectivity

Real SQL Programming. Embedded SQL Call-Level Interface Java Database Connectivity Real SQL Programming Embedded SQL Call-Level Interface Java Database Connectivity 1 SQL in Real Programs We have seen only how SQL is used at the generic query interface --- an environment where we sit

More information

SQL and Programming Languages. SQL in Programming Languages. Applications. Approaches

SQL and Programming Languages. SQL in Programming Languages. Applications. Approaches SQL and Programming Languages SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8.4 of Garcia-Molina The user does not want to execute SQL

More information

Real SQL Programming. Persistent Stored Modules (PSM) PL/SQL Embedded SQL

Real SQL Programming. Persistent Stored Modules (PSM) PL/SQL Embedded SQL Real SQL Programming Persistent Stored Modules (PSM) PL/SQL Embedded SQL 1 SQL in Real Programs We have seen only how SQL is used at the generic query interface --- an environment where we sit at a terminal

More information

Jeffrey D. Ullman Anfang von: CS145 - Herbst 2004 - Stanford University Online unter: www.odbms.org. Folien mit weißem Hintergrund wurden hinzugefügt!

Jeffrey D. Ullman Anfang von: CS145 - Herbst 2004 - Stanford University Online unter: www.odbms.org. Folien mit weißem Hintergrund wurden hinzugefügt! Jeffrey D. Ullman Anfang von: CS145 - Herbst 2004 - Stanford University Online unter: www.odbms.org Folien mit weißem Hintergrund wurden hinzugefügt! Real SQL Programming Embedded SQL Call-Level Interface

More information

CS346: Database Programming. http://warwick.ac.uk/cs346

CS346: Database Programming. http://warwick.ac.uk/cs346 CS346: Database Programming http://warwick.ac.uk/cs346 1 Database programming Issue: inclusionofdatabasestatementsinaprogram combination host language (general-purpose programming language, e.g. Java)

More information

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications Chapter 13 SQL Programming Introduction to SQL Programming Techniques Database applications Host language Java, C/C++/C#, COBOL, or some other programming language Data sublanguage SQL SQL standards Continually

More information

Programming Database lectures for mathema

Programming Database lectures for mathema Programming Database lectures for mathematics students April 25, 2015 Functions Functions are defined in Postgres with CREATE FUNCTION name(parameter type,...) RETURNS result-type AS $$ function-body $$

More information

Course Objectives. Database Applications. External applications. Course Objectives Interfacing. Mixing two worlds. Two approaches

Course Objectives. Database Applications. External applications. Course Objectives Interfacing. Mixing two worlds. Two approaches Course Objectives Database Applications Design Construction SQL/PSM Embedded SQL JDBC Applications Usage Course Objectives Interfacing When the course is through, you should Know how to connect to and

More information

SQL Programming. CS145 Lecture Notes #10. Motivation. Oracle PL/SQL. Basics. Example schema:

SQL Programming. CS145 Lecture Notes #10. Motivation. Oracle PL/SQL. Basics. Example schema: CS145 Lecture Notes #10 SQL Programming Example schema: CREATE TABLE Student (SID INTEGER PRIMARY KEY, name CHAR(30), age INTEGER, GPA FLOAT); CREATE TABLE Take (SID INTEGER, CID CHAR(10), PRIMARY KEY(SID,

More information

Internet Technologies

Internet Technologies QAFQAZ UNIVERSITY Computer Engineering Department Internet Technologies HTML Forms Dr. Abzetdin ADAMOV Chair of Computer Engineering Department aadamov@qu.edu.az http://ce.qu.edu.az/~aadamov What are forms?

More information

Short notes on webpage programming languages

Short notes on webpage programming languages Short notes on webpage programming languages What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is a markup language A markup language is a set of

More information

PHP Tutorial From beginner to master

PHP Tutorial From beginner to master PHP Tutorial From beginner to master PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

More information

Introduction to Server-Side Programming. Charles Liu

Introduction to Server-Side Programming. Charles Liu Introduction to Server-Side Programming Charles Liu Overview 1. Basics of HTTP 2. PHP syntax 3. Server-side programming 4. Connecting to MySQL Request to a Static Site Server: 1. Homepage lookup 2. Send

More information

HTML Forms and CONTROLS

HTML Forms and CONTROLS HTML Forms and CONTROLS Web forms also called Fill-out Forms, let a user return information to a web server for some action. The processing of incoming data is handled by a script or program written in

More information

Novell Identity Manager

Novell Identity Manager AUTHORIZED DOCUMENTATION Manual Task Service Driver Implementation Guide Novell Identity Manager 4.0.1 April 15, 2011 www.novell.com Legal Notices Novell, Inc. makes no representations or warranties with

More information

Constraints, Triggers, and Database Programming Information Systems Q2, 2010. Ira Assent

Constraints, Triggers, and Database Programming Information Systems Q2, 2010. Ira Assent Constraints, Triggers, and Database Programming Information Systems Q2, 2010 Ira Assent Last Lecture More SQL Joins using more than one relation Set operations Subqueries Full relation queries Database

More information

Web Programming with PHP 5. The right tool for the right job.

Web Programming with PHP 5. The right tool for the right job. Web Programming with PHP 5 The right tool for the right job. PHP as an Acronym PHP PHP: Hypertext Preprocessor This is called a Recursive Acronym GNU? GNU s Not Unix! CYGNUS? CYGNUS is Your GNU Support

More information

TCP/IP Networking, Part 2: Web-Based Control

TCP/IP Networking, Part 2: Web-Based Control TCP/IP Networking, Part 2: Web-Based Control Microchip TCP/IP Stack HTTP2 Module 2007 Microchip Technology Incorporated. All Rights Reserved. Building Embedded Web Applications Slide 1 Welcome to the next

More information

Java and Databases. COMP514 Distributed Information Systems. Java Database Connectivity. Standards and utilities. Java and Databases

Java and Databases. COMP514 Distributed Information Systems. Java Database Connectivity. Standards and utilities. Java and Databases Java and Databases COMP514 Distributed Information Systems Java Database Connectivity One of the problems in writing Java, C, C++,, applications is that the programming languages cannot provide persistence

More information

HTML Tables. IT 3203 Introduction to Web Development

HTML Tables. IT 3203 Introduction to Web Development IT 3203 Introduction to Web Development Tables and Forms September 3 HTML Tables Tables are your friend: Data in rows and columns Positioning of information (But you should use style sheets for this) Slicing

More information

Forms, CGI Objectives. HTML forms. Form example. Form example...

Forms, CGI Objectives. HTML forms. Form example. Form example... The basics of HTML forms How form content is submitted GET, POST Elements that you can have in forms Responding to forms Common Gateway Interface (CGI) Later: Servlets Generation of dynamic Web content

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Database Programming. Week 10-2. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford

Database Programming. Week 10-2. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford Database Programming Week 10-2 *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford SQL in Real Programs We have seen only how SQL is used at the generic query

More information

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs HTML Form Widgets Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back to the web server Forms allow web servers to generate

More information

SQL: Programming. Introduction to Databases CompSci 316 Fall 2014

SQL: Programming. Introduction to Databases CompSci 316 Fall 2014 SQL: Programming Introduction to Databases CompSci 316 Fall 2014 2 Announcements (Tue., Oct. 7) Homework #2 due today midnight Sample solution to be posted by tomorrow evening Midterm in class this Thursday

More information

SQL Injection for newbie

SQL Injection for newbie SQL Injection for newbie SQL injection is a security vulnerability that occurs in a database layer of an application. It is technique to inject SQL query/command as an input via web pages. Sometimes we

More information

Chapter 9, More SQL: Assertions, Views, and Programming Techniques

Chapter 9, More SQL: Assertions, Views, and Programming Techniques Chapter 9, More SQL: Assertions, Views, and Programming Techniques 9.2 Embedded SQL SQL statements can be embedded in a general purpose programming language, such as C, C++, COBOL,... 9.2.1 Retrieving

More information

CS412 Interactive Lab Creating a Simple Web Form

CS412 Interactive Lab Creating a Simple Web Form CS412 Interactive Lab Creating a Simple Web Form Introduction In this laboratory, we will create a simple web form using HTML. You have seen several examples of HTML pages and forms as you have worked

More information

Designing for Dynamic Content

Designing for Dynamic Content Designing for Dynamic Content Course Code (WEB1005M) James Todd Web Design BA (Hons) Summary This report will give a step-by-step account of the relevant processes that have been adopted during the construction

More information

A table is a collection of related data entries and it consists of columns and rows.

A table is a collection of related data entries and it consists of columns and rows. CST 250 MySQL Notes (Source: www.w3schools.com) MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables.

More information

Online Multimedia Winter semester 2015/16

Online Multimedia Winter semester 2015/16 Multimedia im Netz Online Multimedia Winter semester 2015/16 Tutorial 04 Major Subject Ludwig-Maximilians-Universität München Online Multimedia WS 2015/16 - Tutorial 04-1 Today s Agenda Repetition: Sessions:

More information

PROJECT REPORT OF BUILDING COURSE MANAGEMENT SYSTEM BY DJANGO FRAMEWORK

PROJECT REPORT OF BUILDING COURSE MANAGEMENT SYSTEM BY DJANGO FRAMEWORK PROJECT REPORT OF BUILDING COURSE MANAGEMENT SYSTEM BY DJANGO FRAMEWORK by Yiran Zhou a Report submitted in partial fulfillment of the requirements for the SFU-ZU dual degree of Bachelor of Science in

More information

PHP Authentication Schemes

PHP Authentication Schemes 7 PHP Authentication Schemes IN THIS CHAPTER Overview Generating Passwords Authenticating User Against Text Files Authenticating Users by IP Address Authenticating Users Using HTTP Authentication Authenticating

More information

07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers

07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers 1 About Forms For a website to be successful, it is important to be able to get feedback from visitors to your site. This could be a request for information, general comments on your site or even a product

More information

JavaScript Basics & HTML DOM. Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com

JavaScript Basics & HTML DOM. Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com JavaScript Basics & HTML DOM Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com 2 Disclaimer & Acknowledgments Even though Sang Shin is a full-time employee

More information

Further web design: HTML forms

Further web design: HTML forms Further web design: HTML forms Practical workbook Aims and Learning Objectives The aim of this document is to introduce HTML forms. By the end of this course you will be able to: use existing forms on

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along

More information

CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University

CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems SQL Programming Li Xiong Department of Mathematics and Computer Science Emory University 1 A SQL Query Joke A SQL query walks into a bar and sees two tables. He walks up to them

More information

Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB

Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB 21.1 Advanced Tornado Advanced Tornado One of the main reasons we might want to use a web framework like Tornado is that they hide a lot of the boilerplate stuff that we don t really care about, like escaping

More information

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI SaaS Hosting Automation is a JAVA SaaS Enablement infrastructure that enables web hosting services

More information

FORM-ORIENTED DATA ENTRY

FORM-ORIENTED DATA ENTRY FORM-ORIENTED DATA ENTRY Using form to inquire and collect information from users has been a common practice in modern web page design. Many Web sites used form-oriented input to request customers opinions

More information

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ CTIS 256 Web Technologies II Week # 1 Serkan GENÇ Introduction Aim: to be able to develop web-based applications using PHP (programming language) and mysql(dbms). Internet is a huge network structure connecting

More information

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia smith@backendmedia.com

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia smith@backendmedia.com Lukas Smith database abstraction layers in PHP BackendMedia 1 Overview Introduction Motivation PDO extension PEAR::MDB2 Client API SQL syntax SQL concepts Result sets Error handling High level features

More information

SQL Injection Attack Lab Using Collabtive

SQL Injection Attack Lab Using Collabtive Laboratory for Computer Security Education 1 SQL Injection Attack Lab Using Collabtive (Web Application: Collabtive) Copyright c 2006-2011 Wenliang Du, Syracuse University. The development of this document

More information

JavaScript and Dreamweaver Examples

JavaScript and Dreamweaver Examples JavaScript and Dreamweaver Examples CSC 103 October 15, 2007 Overview The World is Flat discussion JavaScript Examples Using Dreamweaver HTML in Dreamweaver JavaScript Homework 3 (due Friday) 1 JavaScript

More information

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC MyOra 3.0 SQL Tool for Oracle User Guide Jayam Systems, LLC Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL

More information

Working with forms in PHP

Working with forms in PHP 2002-6-29 Synopsis In this tutorial, you will learn how to use forms with PHP. Page 1 Forms and PHP One of the most popular ways to make a web site interactive is the use of forms. With forms you can have

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the

More information

XHTML Forms. Form syntax. Selection widgets. Submission method. Submission action. Radio buttons

XHTML Forms. Form syntax. Selection widgets. Submission method. Submission action. Radio buttons XHTML Forms Web forms, much like the analogous paper forms, allow the user to provide input. This input is typically sent to a server for processing. Forms can be used to submit data (e.g., placing an

More information

Writing Scripts with PHP s PEAR DB Module

Writing Scripts with PHP s PEAR DB Module Writing Scripts with PHP s PEAR DB Module Paul DuBois paul@kitebird.com Document revision: 1.02 Last update: 2005-12-30 As a web programming language, one of PHP s strengths traditionally has been to make

More information

Talking to Databases: SQL for Designers

Talking to Databases: SQL for Designers Biography Sean Hedenskog Talking to Databases: SQL for Designers Sean Hedenskog Agent Instructor Macromedia Certified Master Instructor Macromedia Certified Developer ColdFusion / Dreamweaver Reside in

More information

SQL Injection. SQL Injection. CSCI 4971 Secure Software Principles. Rensselaer Polytechnic Institute. Spring 2010 ...

SQL Injection. SQL Injection. CSCI 4971 Secure Software Principles. Rensselaer Polytechnic Institute. Spring 2010 ... SQL Injection CSCI 4971 Secure Software Principles Rensselaer Polytechnic Institute Spring 2010 A Beginner s Example A hypothetical web application $result = mysql_query(

More information

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence Web Development Owen Sacco ICS2205/ICS2230 Web Intelligence Introduction Client-Side scripting involves using programming technologies to build web pages and applications that are run on the client (i.e.

More information

Database Programming with PL/SQL: Learning Objectives

Database Programming with PL/SQL: Learning Objectives Database Programming with PL/SQL: Learning Objectives This course covers PL/SQL, a procedural language extension to SQL. Through an innovative project-based approach, students learn procedural logic constructs

More information

Database Access via Programming Languages

Database Access via Programming Languages Database Access via Programming Languages SQL is a direct query language; as such, it has limitations. Some reasons why access to databases via programming languages is needed : Complex computational processing

More information

Viewing Form Results

Viewing Form Results Form Tags XHTML About Forms Forms allow you to collect information from visitors to your Web site. The example below is a typical tech suupport form for a visitor to ask a question. More complex forms

More information

COSC 6397 Big Data Analytics. 2 nd homework assignment Pig and Hive. Edgar Gabriel Spring 2015

COSC 6397 Big Data Analytics. 2 nd homework assignment Pig and Hive. Edgar Gabriel Spring 2015 COSC 6397 Big Data Analytics 2 nd homework assignment Pig and Hive Edgar Gabriel Spring 2015 2 nd Homework Rules Each student should deliver Source code (.java files) Documentation (.pdf,.doc,.tex or.txt

More information

Java Application Developer Certificate Program Competencies

Java Application Developer Certificate Program Competencies Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle

More information

SQL is capable in manipulating relational data SQL is not good for many other tasks

SQL is capable in manipulating relational data SQL is not good for many other tasks Embedded SQL SQL Is Not for All SQL is capable in manipulating relational data SQL is not good for many other tasks Control structures: loops, conditional branches, Advanced data structures: trees, arrays,

More information

Government Girls Polytechnic, Bilaspur

Government Girls Polytechnic, Bilaspur Government Girls Polytechnic, Bilaspur Name of the Lab: Internet & Web Technology Lab Title of the Practical : Dynamic Web Page Design Lab Class: CSE 6 th Semester Teachers Assessment:20 End Semester Examination:50

More information

Database System Concepts

Database System Concepts Chapter 8(+4): Application Design and Development APIs Web Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2010/2011 Slides (fortemente) baseados nos slides oficiais do

More information

SQL Injection Attack Lab

SQL Injection Attack Lab Laboratory for Computer Security Education 1 SQL Injection Attack Lab Copyright c 2006-2010 Wenliang Du, Syracuse University. The development of this document is funded by the National Science Foundation

More information

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL INFORMATION BROCHURE OF Certificate Course in Web Design Using PHP/MySQL National Institute of Electronics & Information Technology (An Autonomous Scientific Society of Department of Information Technology,

More information

Asset Management. By: Brian Johnson

Asset Management. By: Brian Johnson Asset Management By: Brian Johnson A Design Freeze Submitted to the Faculty of the Information Engineering Technology Program in Partial Fulfillment of the Requirements for the Degree of Bachelor of Science

More information

AD-HOC QUERY BUILDER

AD-HOC QUERY BUILDER AD-HOC QUERY BUILDER International Institute of Information Technology Bangalore Submitted By: Bratati Mohapatra (MT2009089) Rashmi R Rao (MT2009116) Niranjani S (MT2009124) Guided By: Prof Chandrashekar

More information

Building a Customized Data Entry System with SAS/IntrNet

Building a Customized Data Entry System with SAS/IntrNet Building a Customized Data Entry System with SAS/IntrNet Keith J. Brown University of North Carolina General Administration Chapel Hill, NC Introduction The spread of the World Wide Web and access to the

More information

Example. Represent this as XML

Example. Represent this as XML Example INF 221 program class INF 133 quiz Assignment Represent this as XML JSON There is not an absolutely correct answer to how to interpret this tree in the respective languages. There are multiple

More information

<option> eggs </option> <option> cheese </option> </select> </p> </form>

<option> eggs </option> <option> cheese </option> </select> </p> </form> FORMS IN HTML A form is the usual way information is gotten from a browser to a server HTML has tags to create a collection of objects that implement this information gathering The objects are called widgets

More information

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form. Practice Problems: These problems are intended to clarify some of the basic concepts related to access to some of the form controls. In the process you should enter the problems in the computer and run

More information

3M Information Technology

3M Information Technology 3M Information Technology IT Customer Relationship Management Applications Web Services Toolkit User Guide Custom Web Lead Capture Submit Lead Last Updated: 23-FEB-07 Page 1 of 33 (Last Modified: 2/24/2007

More information

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2 Berner Fachhochschule, Technik und Informatik Advanced Web Technology 10) XSS, CSRF and SQL Injection Dr. E. Benoist Fall Semester 2010/2011 Table of Contents Cross Site Request Forgery - CSRF Presentation

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to

More information

Java Server Pages and Java Beans

Java Server Pages and Java Beans Java Server Pages and Java Beans Java server pages (JSP) and Java beans work together to create a web application. Java server pages are html pages that also contain regular Java code, which is included

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

Data Transfer Tips and Techniques

Data Transfer Tips and Techniques Agenda Key: Session Number: System i Access for Windows: Data Transfer Tips and Techniques 8 Copyright IBM Corporation, 2008. All Rights Reserved. This publication may refer to products that are not currently

More information

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language: Database Access from a Programming Language Database Access from a Programming Language: Java s JDBC Werner Nutt Introduction to Databases Free University of Bozen-Bolzano 2 Database Access from a Programming Language Two Approaches 1. Embedding

More information

Database Access from a Programming Language:

Database Access from a Programming Language: Database Access from a Programming Language: Java s JDBC Werner Nutt Introduction to Databases Free University of Bozen-Bolzano 2 Database Access from a Programming Language Two Approaches 1. Embedding

More information

CGI Programming. What is CGI?

CGI Programming. What is CGI? CGI Programming What is CGI? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost any language can produce CGI programs even C++ (gasp!!)

More information

LogLogic General Database Collector for Microsoft SQL Server Log Configuration Guide

LogLogic General Database Collector for Microsoft SQL Server Log Configuration Guide LogLogic General Database Collector for Microsoft SQL Server Log Configuration Guide Document Release: Septembere 2011 Part Number: LL600066-00ELS100000 This manual supports LogLogic General Database Collector

More information

Perl/CGI. CS 299 Web Programming and Design

Perl/CGI. CS 299 Web Programming and Design Perl/CGI CGI Common: Gateway: Programming in Perl Interface: interacts with many different OSs CGI: server programsprovides uses a well-defined users with a method way to to gain interact access with to

More information

The Web Web page Links 16-3

The Web Web page Links 16-3 Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Write basic HTML documents Describe several specific HTML tags and their purposes 16-1 Chapter Goals

More information

Developing XML Solutions with JavaServer Pages Technology

Developing XML Solutions with JavaServer Pages Technology Developing XML Solutions with JavaServer Pages Technology XML (extensible Markup Language) is a set of syntax rules and guidelines for defining text-based markup languages. XML languages have a number

More information

HTML Forms. Pat Morin COMP 2405

HTML Forms. Pat Morin COMP 2405 HTML Forms Pat Morin COMP 2405 HTML Forms An HTML form is a section of a document containing normal content plus some controls Checkboxes, radio buttons, menus, text fields, etc Every form in a document

More information

2- Forms and JavaScript Course: Developing web- based applica<ons

2- Forms and JavaScript Course: Developing web- based applica<ons 2- Forms and JavaScript Course: Cris*na Puente, Rafael Palacios 2010- 1 Crea*ng forms Forms An HTML form is a special section of a document which gathers the usual content plus codes, special elements

More information

Chapter 22 How to send email and access other web sites

Chapter 22 How to send email and access other web sites Chapter 22 How to send email and access other web sites Murach's PHP and MySQL, C22 2010, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Install and use the PEAR Mail package to send email

More information

JavaScript: Arrays. 2008 Pearson Education, Inc. All rights reserved.

JavaScript: Arrays. 2008 Pearson Education, Inc. All rights reserved. 1 10 JavaScript: Arrays 2 With sobs and tears he sorted out Those of the largest size... Lewis Carroll Attempt the end, and never stand to doubt; Nothing s so hard, but search will find it out. Robert

More information

Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

Database 10g Edition: All possible 10g features, either bundled or available at additional cost. Concepts Oracle Corporation offers a wide variety of products. The Oracle Database 10g, the product this exam focuses on, is the centerpiece of the Oracle product set. The "g" in "10g" stands for the Grid

More information

Web Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE

Web Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE Enterprise Application Development using J2EE Shmulik London Lecture #6 Web Programming II JSP (Java Server Pages) How we approached it in the old days (ASP) Multiplication Table Multiplication

More information

Part II of The Pattern to Good ILE. with RPG IV. Scott Klement

Part II of The Pattern to Good ILE. with RPG IV. Scott Klement Part II of The Pattern to Good ILE with RPG IV Presented by Scott Klement http://www.scottklement.com 2008, Scott Klement There are 10 types of people in the world. Those who understand binary, and those

More information

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World COSC 304 Introduction to Systems Introduction Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca What is a database? A database is a collection of logically related data for

More information

15-415 Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System

15-415 Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System 15-415 Database Applications Recitation 10 Project 3: CMUQFlix CMUQ s Movies Recommendation System Project Objective 1. Set up a front-end website with PostgreSQL back-end 2. Allow users to login, like

More information

Web and e-business Technologies

Web and e-business Technologies ActivePotato Corporation www.activepotato.com Web and e-business Technologies By Rohit Chugh rohit.chugh@activepotato.com For the IEEE Ottawa Chapter June 2, 2003 2003 by Rohit Chugh 1 Agenda Web Technologies

More information

Oracle For Beginners Page : 1

Oracle For Beginners Page : 1 Oracle For Beginners Page : 1 Chapter 24 NATIVE DYNAMIC SQL What is dynamic SQL? Why do we need dynamic SQL? An Example of Dynamic SQL Execute Immediate Statement Using Placeholders Execute a Query Dynamically

More information

Now that we have discussed some PHP background

Now that we have discussed some PHP background WWLash02 6/14/02 3:20 PM Page 18 CHAPTER TWO USING VARIABLES Now that we have discussed some PHP background information and learned how to create and publish basic PHP scripts, let s explore how to use

More information

Inserting the Form Field In Dreamweaver 4, open a new or existing page. From the Insert menu choose Form.

Inserting the Form Field In Dreamweaver 4, open a new or existing page. From the Insert menu choose Form. Creating Forms in Dreamweaver Modified from the TRIO program at the University of Washington [URL: http://depts.washington.edu/trio/train/howto/page/dreamweaver/forms/index.shtml] Forms allow users to

More information

It is highly recommended that you are familiar with HTML and JavaScript before attempting this tutorial.

It is highly recommended that you are familiar with HTML and JavaScript before attempting this tutorial. About the Tutorial AJAX is a web development technique for creating interactive web applications. If you know JavaScript, HTML, CSS, and XML, then you need to spend just one hour to start with AJAX. Audience

More information

MASTERTAG DEVELOPER GUIDE

MASTERTAG DEVELOPER GUIDE MASTERTAG DEVELOPER GUIDE TABLE OF CONTENTS 1 Introduction... 4 1.1 What is the zanox MasterTag?... 4 1.2 What is the zanox page type?... 4 2 Create a MasterTag application in the zanox Application Store...

More information

Product: DQ Order Manager Release Notes

Product: DQ Order Manager Release Notes Product: DQ Order Manager Release Notes Subject: DQ Order Manager v7.1.25 Version: 1.0 March 27, 2015 Distribution: ODT Customers DQ OrderManager v7.1.25 Added option to Move Orders job step Update order

More information

By Glenn Fleishman. WebSpy. Form and function

By Glenn Fleishman. WebSpy. Form and function Form and function The simplest and really the only method to get information from a visitor to a Web site is via an HTML form. Form tags appeared early in the HTML spec, and closely mirror or exactly duplicate

More information

WEB DATABASE PUBLISHING

WEB DATABASE PUBLISHING WEB DATABASE PUBLISHING 1. Basic concepts of WEB database publishing (WEBDBP) 2. WEBDBP structures 3. CGI concepts 4. Cold Fusion 5. API - concepts 6. Structure of Oracle Application Server 7. Listeners

More information