PL/SQL Server Pages (Web Programming with PL/SQL)

Slides:



Advertisements
Similar presentations
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Advertisements

Web Programming with PL/SQL Erdogan Dogdu Georgia State University Computer Science Department
In this lecture, you will learn: ❑ How to link between pages of your site ❑ How to link to other sites ❑ How to structure the folders on your web site.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Stored procedures Procedural programming in Microsoft SQL Server 1Stored procedures.
The Web Warrior Guide to Web Design Technologies
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Introduction to PL/SQL Chapter 9. Objectives Explain the need for PL/SQL Explain the benefits of PL/SQL Identify the different types of PL/SQL blocks.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 9 JavaServer Pages (JSP) (Based on Møller.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
Chapter 5 Java Script And Forms JavaScript, Third Edition.
IDK0040 Võrgurakendused I harjutus 06: PHP: Introduction Deniss Kumlander.
Building a Web-based Test Registration System Using ASP and SQL Gao Chao Department of Information Technology Vaasa Polytechnic Wolffintie 30, 65200, Finland.
Week 9 PHP Cookies and Session Introduction to JavaScript.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Introduction to ASP.NET 1www.tech.findforinfo.com.
Copyright  Oracle Corporation, All rights reserved. 3 Creating Procedures.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
JavaScript Syntax, how to use it in a HTML document
Stored Procedures. Definition a stored procedure is a set of Structured Query Language (SQL) statements with an assigned name that's stored in the database.
XP Tutorial 8 Adding Interactivity with ActionScript.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Implementing The Middle Tier These slides.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
1 HTML forms (cont.)
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
Creating PHP Pages Chapter 5 PHP Structure and Syntax.
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Creating Procedures. PL/SQL Program Construct Tools Constructs Anonymous Block Application procedures or functions Application packages Application Triggers.
JAVA SERVER PAGES -by Rubeena Memon Deepti Jain Jaya Thakar Jisha Vettuventra.
ASP Syntax Y.-H. Chen International College Ming-Chuan University Fall, 2004.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
5 Copyright © 2004, Oracle. All rights reserved. PL/SQL Server Pages.
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
ASP Mr. Baha & Dr.Husam Osta  What is ASP?  Internet Information Services  How Does ASP Differ from HTML?  What can ASP do for you?  ASP Basic.
Brief Look InTo JavaScript Dr. Thomas Hicks Computer Science Department Trinity University.
D Copyright © 2009, Oracle. All rights reserved. Using SQL*Plus.
PHP using MySQL Database for Web Development (part II)
Introduction to Dynamic Web Programming
Active Server Pages Computer Science 40S.
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Using SQL*Plus.
Web Page Development Tools
PHP.
Web Page Development Tools
Tutorial 10: Programming with javascript
PHP an introduction.
Presentation transcript:

PL/SQL Server Pages (Web Programming with PL/SQL) Erdogan Dogdu Georgia State University Computer Science Department edogdu@cs.gsu.edu http://db.gsu.edu/~edogdu

Content Disadvantages of Web Toolkit PL/SQL Server Pages Syntax Loading PSP Pages Example

Disadvantages of Web Toolkit PL/SQL Web Toolkit (htp, htf) generates HTML code form PL/SQL programs. Generating nice web pages is difficult, you cannot author PL/SQL programs in Frontpage. Solution is PSP (next)

PL/SQL Server Pages (PSP) Author web pages using script-friendly HTML authoring tools. Drop in PL/SQL code within HTML code using scripting tag <% %>. In short: Web Toolkit: generate HTML from PL/SQL PSP: embedded PL/SQL within HTML

Syntax of PL/SQL Server Pages Same script tag syntax as in ASP and JSP: <% … %> PSP files should have .psp extension Can be as simple as an HTML page (no PL/SQL script) Specifying the scripting language <%@ page language="PL/SQL" %>

Syntax of PL/SQL Server Pages Parameter passing <%@ plsql parameter="varname" %> Returned document type <%@ page contentType="MIMEtype" %> Such as text/xml, text/plain, image/jpeg Stored procedure name <%@ page procedure="procname" %>

Loading PL/SQL Server Pages Loading psp document to Oracle loadpsp [ -replace ] -user username/password[@connect_string] [ include_file_name ... ] [ error_file_name ] psp_file_name ...

More Syntax Statements Expression Conditional blocks <% PL/SQL Statement; [ PL/SQL Statement; ] … %> Expression <%= PL/SQL Expression %> Conditional blocks <% if condition then %> [HTML code] <% else %> <% end if; %>

More Syntax Including files PL/SQL declarations <%@ include file="path name" %> PL/SQL declarations <%! PL/SQL declaration; [ PL/SQL declaration; ] ... %>

PSP Example: Grade Book First page: get_access.psp Overview: Allows login to application <%@ page language="PL/SQL" %> <%@ plsql procedure="get_access" %> <HTML> <HEAD> <TITLE>Get password</TITLE> <H1>Grade Book Access Page</H1> </HEAD> (cont. next slide)

PSP Example: Grade Book <BODY> <FORM ACTION="<%=owa_util.get_owa_service_path%>start_session" METHOD="POST"> <BR> Today is <%=to_char(sysdate, 'Day')%>, <%=to_char(sysdate, 'Dd / Mon / YYYY HH:MI AM')%> <BR><BR> (cont. next slide)

PSP Example: Grade Book <TABLE><TR> <TD><STRONG>USER ID: </STRONG></TD> <TD><INPUT TYPE="text" NAME="usid" SIZE="20" MAXLENGTH="50"></TD> </TR> <TR> <TD><STRONG>PASSWORD: </STRONG></TD> <TD><INPUT TYPE="password" NAME="passwd" SIZE="20" MAXLENGTH="50"></TD> </TR></TABLE> <INPUT TYPE="submit" VALUE=" Proceed "> <INPUT TYPE="reset" VALUE="Reset"> </FORM></BODY></HTML>

PSP Example: Grade Book

Form Processing This form processing program does not generate any HTML code. Therefore, we leave it as a PL/SQL program (start_session.sql) create or replace procedure start_session( usid in varchar2 DEFAULT NULL, passwd in varchar2 DEFAULT NULL) AS … begin select A.userid, A.password, A.lastAccess, A.authority into user_buffer, passwd_buffer, time_buffer, auth_buffer from users A where upper(A.userid)=upper(start_session.usid); end start_session;

Form Processing in PSP Example: <%@ page language="PL/SQL" %> <%@ plsql procedure="teacher_menu" %> <%@ plsql parameter="u_access" type="varchar2" default="null" %> <%@ plsql parameter="userid" type="varchar2" default="null" %> …