A web application serving queries on renewable energy sources and energy management topics database, built on JSP technology

Similar documents
CHAPTER 4: ARCHITECTURE AND SYSTEM DESIGN OF PROPOSED EXPERT SYSTEM: ESOA

Appendix A - Glossary(of OO software term s)

Agent-Enabling Transformation of E-Commerce Portals with Web Services

APPLYING INTERACTIVE WEB PAGES

A Web Based Registration system for Higher Educational Institutions in Greece: the case of Energy Technology Department-TEI of Athens

Advanced Java Programming

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p.

TOPLink for WebLogic. Whitepaper. The Challenge: The Solution:

Topics. From UI prototype... About user interfaces. ... via design to implementation. Pearson Education 2005 Chapter 7 (Maciaszek - RASD 2/e) 6

Pearson Education 2005 Chapter 7 (Maciaszek - RASD 2/e) 2

(C) Global Journal of Engineering Science and Research Management

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets

Chapter 2 FEATURES AND FACILITIES. SYS-ED/ Computer Education Techniques, Inc.

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

A Design of the Conceptual Architecture for a Multitenant SaaS Application Platform

Virtual Credit Card Processing System

CLIENT SERVER ARCHITECTURE:

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

MythoLogic: problems and their solutions in the evolution of a project

About the Authors. Who Should Read This Book. How This Book Is Organized

Web-based File Upload and Download System

Research and Application of Mobile Geographic Information Service Technology Based on JSP Chengtong GUO1, a, Yan YAO1,b

Fast Track to Java EE

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

Enterprise Java and Rational Rose - Part II

NetBeans IDE Field Guide

Ch04 JavaServer Pages (JSP)

Test On Line: reusing SAS code in WEB applications Author: Carlo Ramella TXT e-solutions

BEAWebLogic. Portal. Overview

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Component-Based Software Engineering. ECE493-Topic 5 Winter Lecture 26 Java Enterprise (Part D)

Pearson Education 2007 Chapter 7 (RASD 3/e)

National Language Support for Windows NT and AIX Now Available with IBM WebSphere Application Server V3.0.1, Standard Edition

Develop Unified SNMP, XML, CLI, and Web-based Management for Embedded Real-Time Systems with MIBGuide

Experiment No: Group B_2

INTRODUCTION TO Object Oriented Systems BHUSHAN JADHAV

Chapter 6 Enterprise Java Beans

Design Patterns for CGI Web Applications with Visual Basic

Critiquing technological strengths and limitations

ESPRIT Project N Work Package H User Access. Survey

(p t y) lt d. 1995/04149/07. Course List 2018

DAVID M. KROENKE and DAVID J. AUER. DATABASE CONCEPTS, 7 th Edition. Chapter Seven. Database Processing Applications. Chapter Objectives

1Z Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions

Table of Contents. Introduction... xxi

COURSE DETAILS: CORE AND ADVANCE JAVA Core Java

Oracle Fusion Middleware 11g: Build Applications with ADF I

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Enterprise JavaBeans. Layer:01. Overview

IBM Rational Application Developer for WebSphere Software, Version 7.0

Author - Ashfaque Ahmed

Web Architecture AN OVERVIEW

Inf 202 Introduction to Data and Databases (Spring 2010)

Developing Java TM 2 Platform, Enterprise Edition (J2EE TM ) Compatible Applications Roles-based Training for Rapid Implementation

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2

Jakarta Struts: An MVC Framework

Developing Java Servlets (Sams Professional) By James Goodwill READ ONLINE

Enterprise Java and Rational Rose -- Part I

Computational Detection of CPE Elements Within DNA Sequences

Y ou must have access to a JSP-compatible Web server

Leverage Rational Application Developer v8 to develop Java EE6 application and test with WebSphere Application Server v8

Browsing the Semantic Web

What s new in Mainframe Express 3.0

Version Overview. Business value

In the most general sense, a server is a program that provides information

Development of E-Institute Management System Based on Integrated SSH Framework

Chapter 2 Introduction

BEAWebLogic Server. Introduction to BEA WebLogic Server and BEA WebLogic Express

DOWNLOAD OR READ : JAVA EE 6 WEB COMPONENT DEVELOPER CERTIFIED EXPERT MARATHON 1Z0 899 PRACTICE PROBLEMS PDF EBOOK EPUB MOBI

Quantum, a Data Storage Solutions Leader, Delivers Responsive HTML5-Based Documentation Centers Using MadCap Flare

Customizing ArcIMS Using the Java Connector and Python

IBM WebSphere Application Server V3.5, Advanced Edition Expands Platform Support and Leverages the Performance of the Java 2 Software Development Kit

X100 ARCHITECTURE REFERENCES:

Developing Applications with Java EE 6 on WebLogic Server 12c

X-S Framework Leveraging XML on Servlet Technology

Discovering Computers Chapter 13 Programming Languages and Program Development

PRIMIX SOLUTIONS. Core Labs. Tapestry : Java Web Components Whitepaper

Professional JSP : Using JavaServer Pages, Servlets, EJB, JNDI, JDBC, XML, XSLT, And WML By Karl Avedal, Danny Ayers

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Database Applications

JDBC Today C HAPTER 1 INTRODUCTION

JDBC(TM) API Tutorial And Reference: Universal Data Access For The Java(TM) 2 Platform (2nd Edition) Download Free (EPUB, PDF)

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title

IBM WebSphere Application Server V3.5, Advanced Edition for Linux Extends Support to Red Hat, Caldera, SuSE, and TurboLinux

Tradeoffs and Guidelines for Selecting Technologies to Generate Web Content from Relational Data Stores

Client/Server-Architecture

Testing JDBC Applications Using DataDirect Test for JDBC

SECTION II: JAVA SERVLETS

Using the VisualAge for Java WebSphere Test Environment

About Database Adapters

COMMUNICATION PROTOCOLS

COWLEY COLLEGE & Area Vocational Technical School

Design and Implementation of Bibliography Registration System

Oracle Fusion Middleware 11g: Build Applications with ADF I

CSC 8205 Advanced Java

JavaEE Interview Prep

JAVA SYLLABUS FOR 6 WEEKS

Oracle9i Application Server Architecture and Com

Extended Search Administration

Q&As. Microsoft MTA Software Development Fundamentals. Pass Microsoft Exam with 100% Guarantee

An Eclipse Plug-In for Generating Database Access Documentation in Java Code

Transcription:

International Workshop on Energy Performance and Environmental 1 A web application serving queries on renewable energy sources and energy management topics database, built on JSP technology P.N. Christias Department of Electronic & Computer Engineering, Technical University of Crete, Greece D. Kolokotsa Department of Natural Resources and Environment, Technological Educational Institute of Crete, Greece ABSTRACT The present paper describes the development and the specifications of a software package that delivers useful information on scientific topics, bibliography, achievements and activities related to the area of renewable energy sources and energy management. The queries and results are transmitted over the Internet through a simple graphical interface. The package consists of a database designed to host this information and a web-based software application, which serves the dynamic content. With the proper interconnection to the database, the latter becomes a suitable interface to satisfy user queries on this scientific area, as faster and easier as possible. The database is designed in SQL-92.The web application is a fully graphical dynamic website where the technology of Java Server Pages (JSPs) is used to connect, search, and retrieve information from the database. In addition, JSP technology is used in order to transform user input into query language and query results into a comprehensive representation to users. 1. INTRODUCTION The area of renewable energy sources and energy management is constantly growing during the last decades. Therefore, an information bank on relevant scientific topics, bibliography, achievements and activities, becomes necessary. The scope of the present paper is to describe a dynamic web-based application that attains the above information in a database, offering querying capabilities through a simple graphical interface and features: (a) quick response, and (b) easy-to-use query interface with uncomplicated criteria requirements, while maintaining the ability to produce the wider possible set of results. The graphical interface is embedded in a website, since access and search operations can be performed via the Internet. The database is designed in SQL-92 language and implemented in the Microsoft s SQL Server 2000, running in a computer separate from the web server computer. A software tool is required to bridge the database and the web application, using the Java Server Pages (JSP) technology. Although Active Server Pages (ASP) can be considered as an attractive approach for the dynamic content development since ASP and SQL Server have a common research background (Microsoft) and operating logic and there are numerous software tools which simplify ASP programming, JSP technology is selected for the following reasons: - JSP features cross-platform and cross-webserver support and is platform independent (Sun Microsystems, JSP Manual; Sun s JSP official site). It runs on all Java-enabled platforms and can be enabled within most popular Web Servers. The website of the current application resides in an individual Web Server machine, apart from the Database Server. The Web Server is Apache s Tomcat, running on a Linux operating environment providing a long-term stable host platform. The Apache s Tomcat web server is selected because it is the servlet container used in the official Reference Implementation for the Java Servlet and JSP technologies (The Apache Jakarta Project site). Tomcat supports the Servlet 2.2 and JSP 1.1 specifications offering compatibility on compiling

2 International Workshop on Energy Performance and Environmental and execution (Sun Microsystems, JSP Manual). ASP is fully supported under Windows, but deployment on other platforms is cumbersome due to reliance on the Win32-based component model (Sun Microsystems, JSP Manual). - JSP uses Java Database Connectivity (JDBC) for data access while ASP uses Microsoft s Open Database Connectivity (ODBC) through Active Data Objects for data access. This interface architecture is also supported by JSP with a special type of JDBC driver called JDBC-ODBC bridge that connects to databases through an intermediate ODBC driver. The driver in the ODBC approach is single-threaded and may, therefore, perform poorly under a heavy load (Hanna, 2003). Performance drawbacks were not the major reason for rejecting the ODBC approaches either using ASP or a JDBC-ODBC bridge. A JDBC driver of type pure Java direct to database provided only by JSP is used, primarily because it implements a call-level interface. The JSP program uses direct function calls to access the Database Management Systems (DBMS), as opposed to embedded SQL statements. If the use of CallableStatement (see Section 5) is also considered, the automated query becomes more efficient. Secondly, the choice of the ODBC approach would require the configuration of an ODBC data source on the operating system of the Database Server. This would be added to the administrator s maintenance responsibilities because damage to the data source causes loss of communication with the DBMS. - In JSP there is separation of static from dynamic content. Static presentation templates are encapsulated in external JavaBeans components. News, announcements and graphical add-ons are possible to be added to the website. The changes of the static content do not require knowledge of JSP technology. Only HTML or XML knowledge is necessary. When a designer makes any changes to the presentation template, the JSP page is automatically recompiled and reloaded into the Web Server by the JSP engine. - JSP can make use of the full Java 2 Enterprise Edition environment. This provides functional compatibility with external code, ideal for sophisticated and robust applications (Hanna, 2003). The search criteria are distilled by the JSP software and then forwarded to the database server (as valid SQL variables), to retrieve the optimum results. In the following section, there is an overall description of the parts and functions of the entire application. In sections 3 and 4, implementation issues of the database and the website are covered. At the end, conclusions and future approaches are discussed. 2. FUNCTIONALITY ISSUES The website resides in the Apache s Tomcat web server computer as mentioned before. The JSP specification is a standard extension of J2EE s Servlet Application Interface (API), for dynamic web content serving (Hanna, 2003). The database server designed in SQL-92 language and implemented in the Microsoft s SQL Server 2000 is an independent information source, thus enhancing the overall response time. The JSP code - which handles the users requests - acts as a client and interconnects to the database for querying, over the Internet. The structural pattern of the application is shown in Figure 1. The starting point is the web browser. The user enters the desired search criteria, which are forwarded to the JSP code for processing. De- Figure 1: Diagram of the application.

International Workshop on Energy Performance and Environmental 3 pending on the entered criteria, the JSP code decides which part of the database will be scanned for results. As soon as this operation is complete, appropriate commands are sent to the database for execution. A result set is returned to the Servlet container. By means of the JSP code, the set is filtered and appropriately formatted, in order to be displayed at the browser. The energy management and renewable energy sources data categories which are stored in the database are listed below: - International bibliography and editions. - Articles, scientific reports, dissertations and research studies published in press. - Educational activities and courses offered by universities and organizations worldwide. The main objective is to provide combined information from all the above categories, relevant to the query criteria. For optimum performance, the database is designed to manage the data categories based on the following structural grouping: - Group 1: Bibliography and editions (e.g. title, ISBN), accompanied by publisher and author information. - Group 2: Published releases (e.g. title, magazine, publishing date), accompanied by author and sponsoring university/organization information. - Group 3: Courses and seminars features (e.g. name, level), accompanied by hosting university/organization information. The three groups directives must be preserved during data handling because they characterize the way data are stored and represented to the user. The importance lies in the fact that in this way, the search criteria and the database results are suitably grouped when sent for processing to the JSP code. As a consequence, the JSP algorithm receives input and sends output to the user in the same fixed form. Another functionality requirement is that the criteria declaration must have a general format while the query should be particularized in specific parameters. The user can insert any criteria without having to specify in which group this might belong. Moreover, searching categories are available. The user can isolate the query among the following categories: books, authors, published releases, courses and organizations. If category ALL is selected, the entire database will be scanned. Additionally, the insertion of up to three criteria combined with the logical operators OR, AND is available. Depending on the choice of category, the query is executed on the attributes of the entities. Results are presented along with their relative information, as described in the structural groups. Bibliography (1 st group) and published releases (2 nd group) contain all the available printed material. Published releases (2 nd group) and courses (3 rd group) are considered as organizations activities. If a user is searching for courses conducted in Technical University of Crete, he/she will insert the term Technical University of Crete and will select the category courses. If the category ALL is selected, the browser will return all the references to the searched term; either publications (2 nd group) or courses (3 rd group). Furthermore, the user is entitled only with query rights. Altering or deleting data is not allowed. The SQL and JSP-based developed software routines are shaped by the functionality specifications stated above. 3. THE DATABASE The DBMS is implemented using the Microsoft s SQL Server 2000 that supports webbased applications on (a) connectivity through URLs, and (b) data exchange matters (Shapiro, 2001). For the proposed DBMS, 10 stored procedures are developed. The database goes through automatic querying, executed by the JSP code. The algorithm intelligently decides where to look for results inside the database, taking into account the input coming from the browser. The decision mechanism is analyzed in section 4. The views in collaboration with the 10 stored procedures satisfy every possible query that the algorithm will have to process. Each time a query is executed, the web browser has to wait for the SQL Server to parse and run the commands, thus increasing the pending time. The total response time Tres is the summation of the data propagation time over network from JSP to DBMS, the query expression parsing time, the command execution and data retrieval time and the data propagation time over network from DBMS to JSP. If stored pro-

4 International Workshop on Energy Performance and Environmental cedures are used, the parsing is already done; therefore Tres is reduced (Shapiro, 2001). Each of the 10 stored procedures acts only on a specific part of the view to which is assigned to. The initial search is split into smaller ones. Instead of executing a large and complex query expression for each different search scenario, a collection of the available stored procedures is selected to do the same. Ultimately, the appropriate part of the database is queried by use of the suitable subset of stored procedures. The code is reused with different combinations, depending on the search. The initial query is equivalently performed by smaller specialized queries. This is done without multiple scans of the database since the target attributes of the selected stored procedures subset are different. As a result, the number of requests is relatively small. Although access to the database is performed via the Internet, the DBMS is chosen to reside in a database server, separated from the web server that hosts the website. This structure eases administration and improves overall performance. The computational burden goes to the database server, increasing the website navigation speed. The separation dictates communication and data exchange between the two servers (database & web), which is provided by the JSP code. 4. THE WEBSITE 4.1 JSP Operating Issues JSP technology is used to serve database connectivity and dynamic content. Inside the HTML pages there are special code items, called JSP tags. The main advantage of the JSP technology is the separation of static and dynamic content (Sun s JSP official site; Hanna, 2003). Besides a proper web server (as already mentioned), a Java Runtime Environment & Developer kit installation is necessary in order for the JSPs to operate. The database access model is depicted in Figure 2. The processing is split into controller components and view components. The Controllers filter the HTML requests in order to produce objects used by the views. The important thing is that the views have no processing logic. They just embed the objects dynamic content into their static parts (Sun s JSP official BROWSER 1 Request (Controller) Servlet 5 (View) Response JSP 4 Figure 2: Access Model. 3 in stan ti ate Servlet Container (Model) JavaBean site). There is only one access point (web browser), simplifying maintenance and security issues. In the proposed application, the benefit of the JSPs lie in the supported access functionality to the database systems, through JDBC. This is an API between Java and DBMS. It includes functions for database connectivity, SQL commands execution and result processing. To establish connection to the DBMS, a JDBC requires a small Java class, called JDBC driver. The steps in a JDBC operation are shown in Figure 3. In network terms, communication takes place through interprocess communication mechanisms (IPC), using the TCP/IP protocol. The JDBC software exploits the network domain as well as DBMS login accounts to gain access (Sun Microsystems, JSP Manual; Hanna, 2003). 4.2 The JSP Code The JSP algorithm key features are examined in extension below. At the browser output (see Figure 2), there are seven string variables in Figure 3: JDBC Steps. 2 Enterprise Information System (EIS)

International Workshop on Energy Performance and Environmental 5 HTML format: - Three criteria entered in the text boxes of the search form. - Two logical operators selected from the drop-down boxes. - The selected search category. - A hidden string variable, defining whether the search is performed through the advanced search form or the simple search form. It is assigned the "advanced", "simple" values respectively. Inside the JSP code, the HTML variables values are stored in Java-type string variables by the use of the request.getparameter()java method. Then, they are transformed into SQL variables inside the JSP code. The algorithm decides which part of the database to scan for results by choosing the appropriate views. For instance, if the selected category is Authors, the views that will be used are those who represent the 1 st (books) and 2 nd (published press releases) structural groups, because it is impossible to find authoring information in the 3 rd group. In consequence, it is decided which of the stored procedures among those operating on the selected views will be used. For the above example, only the procedures querying on AUTHORS attributes shall be called for execution. After this operation is complete, the names of the appropriate stored procedures, along with the SQL input arguments, are sent to the DBMS. The algorithm decisions on which view (s) and stored procedure (s) to use depends upon the chosen search category. The user input is text and is stored in variables of three different formats during the application s execution: HTML, Java and SQL. The choice of the variable type on each case is important because the text must remain consistent while it is exchanged over the parts of the application. If one or two criteria insertion text boxes are left blank, the corresponding string variables are set to null and stored procedures are executed with the remaining variable(s) as valid input argument(s). If the simple search form is used the second and third search criteria are set to null and search category is set to "ALL". The application is built in such a way to find matching results, regardless how general or few the query terms are. The database returns a result set, comprised of raw SQL data. Inside the JSP code, the raw data are filtered, stored into string variables and appropriately grouped, in order to be properly displayed at the browser. Depending on which view(s) the results come from, the program adopts different HTML format for their display. 5. SPECIAL IMPLEMENTATION FEA- TURES Usually, the SQL statements are sent as commands to the DBMS, from the JSP code. Problems arise when the search terms contain escape characters, i.e. apostrophes. While the SQL Server successfully compiles such expressions (Shapiro, 2001), the JSP engine returns false in a form of an exception report. The reason is that the query expression is cut at the point of the escape character and a nasty error message is shown at the user s screen. Such case cannot be predicted and controlled because SQL statements are constructed on the fly based on the user entered criteria. In the proposed application, as already described, only the names of the stored procedures to be executed are sent to the DBMS. Moreover, the search terms are sent in a form of input arguments, thus avoiding dynamic syntax errors. This feature is based on a special interface of the JSP 2.0 standard, referred as callable statements (Hanna, 2003). This interface is used to directly invoke stored procedures if the DBMS supports them. By incorporating this feature into the code, the SQL statements execution is passed on to the SQL Server. 6. CONCLUSIONS The value of the developed software application lies not only to the functions it offers. Easy maintenance and smooth operation are important parameters implemented. The functional parts of the application are designed to depend on each other at the level of input-output exchange only. Therefore, a malfunction occurred on one of them does not cause collapse of the rest. The application is destined to provide any interested Internet user with information concerning renewable energy sources management and smart buildings technology. By adding a login function into the website and a set of learning

6 International Workshop on Energy Performance and Environmental rules into the JSP code, an e-learning platform can be produced. The database is predestined to handle this kind of operation level, since special attributes - capable of disposing full-text files storage - are incorporated into the database entity-relationship architecture. The software application is available for browsing at the following URL: http://ebuilding.serveftp.org. It serves successfully the Electric Circuits & Renewable Energy Sources Laboratory of the Technical University of Crete educational purposes with an easy-to-use, reliable and quick responding online information bank. REFERENCES Shapiro, J.R., 2001. SQL Server 2000: The complete reference. New York: Mc Graw-Hill. Sun Microsystems, JSP Manual, [Online] Available http://developer.java.sun.com/developer/online Training/JSP intro/ Sun s JSP official site, http://java.sun.com/products/jsp/ index.html Hanna, P., 2003. JSP 2.0: The complete reference. New York: Osborne/Mc Graw-Hill. The Apache Jakarta Project site, http://jakarta.apache.org/ tomcat/