J2ME With Database Connection Program

Size: px
Start display at page:

Download "J2ME With Database Connection Program"

Transcription

1 J2ME With Database Connection Program Midlet Code: /* * To change this template, choose Tools Templates * and open the template in the editor. package hello; import java.io.*; import java.util.*; import javax.microedition.midlet.*; // package required for J2ME import javax.microedition.lcdui.*; // package required for J2ME import javax.microedition.io.*; // package required for J2ME public class MySQLConnection extends MIDlet implements CommandListener { private String username; private String url = " private Display display; private Command exit = new Command("EXIT", Command.EXIT, 1);; private Command connect = new Command("Connect", Command.SCREEN, 1); private TextField tb; private Form menu; private TextField tb1;

2 private TextField tb2; DBConn db; public MySQLConnection() throws Exception { display = Display.getDisplay(this); public void startapp() { displaymenu(); public void displaymenu() { menu = new Form("Connect to Database"); tb = new TextField("Please enter database: ","",30,TextField.ANY ); tb1 = new TextField("Please enter username: ","",30,TextField.ANY); tb2 = new TextField("Please enter password: ","",30,TextField.PASSWORD); menu.append(tb); menu.append(tb1); menu.append(tb2); menu.addcommand(exit); menu.addcommand(connect); menu.setcommandlistener(this); display.setcurrent(menu); public void pauseapp() { public void destroyapp(boolean unconditional) { public void commandaction(command command, Displayable screen) { if (command == exit) {

3 destroyapp(false); notifydestroyed(); else if (command == connect) { db = new DBConn(this); db.start(); db.connectdb(tb.getstring(),tb1.getstring(),tb2.getstring()); public class DBConn implements Runnable { MySQLConnection midlet; private Display display; String db; String user; String pwd; public DBConn(MySQLConnection midlet) { this.midlet = midlet; display = Display.getDisplay(midlet); public void start() { Thread t = new Thread(this); t.start(); public void run() { StringBuffer sb = new StringBuffer(); try {

4 HttpConnection c = (HttpConnection) Connector.open(url); c.setrequestmethod(httpconnection.post); DataOutputStream os = (DataOutputStream)c.openDataOutputStream(); os.writeutf(db.trim()); os.writeutf(user.trim()); os.writeutf(pwd.trim()); os.flush(); os.close(); // Get the response back from the servlet page. DataInputStream is =(DataInputStream)c.openDataInputStream(); //is = c.openinputstream(); int ch; sb = new StringBuffer(); while ((ch = is.read())!= -1) { sb.append((char)ch); showalert(sb.tostring()); is.close(); c.close(); catch (Exception e) { showalert(e.getmessage()); /* This method will take input from user like db,user and pwd and will pass to the servlet

5 public void connectdb(string db,string user,string pwd) { this.db = db; this.user = user; this.pwd = pwd; /* Display Error On screen private void showalert(string err) { Alert a = new Alert(""); a.setstring(err); a.settimeout(alert.forever); display.setcurrent(a); ; Servlet Code: import java.io.datainputstream; import java.io.ioexception; import java.io.inputstream; import java.io.printwriter; import java.sql.connection; import java.sql.drivermanager; import java.sql.statement; import javax.servlet.servletexception;

6 import javax.servlet.annotation.webservlet; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; /** * = "getconn", urlpatterns = {"/getconn") public class getconn extends HttpServlet { /** * Processes requests for both HTTP * <code>get</code> and * <code>post</code> methods. * request servlet request response servlet response ServletException if a servlet-specific error occurs IOException if an I/O error occurs protected void processrequest(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { response.setcontenttype("text/html;charset=utf-8");

7 PrintWriter out = response.getwriter(); DataInputStream in = new DataInputStream((InputStream)request.getInputStream()); String db = in.readutf(); String user = in.readutf(); String pwd = in.readutf(); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection("jdbc:odbc:mydb"); Statement st=conn.createstatement(); st.executequery("insert into mobile values('"+db+"','"+user+"','"+pwd+"') "); catch(exception ec) { try { /* * TODO output your page here. You may use following sample code. out.println("<html>"); out.println("<head>"); out.println("<title>servlet getconn</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>servlet getconn at " + request.getcontextpath() + "</h1>");

8 out.println("</body>"); out.println("</html>"); finally { out.close(); // <editor-fold defaultstate="collapsed" desc="httpservlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP * <code>get</code> method. * request servlet request response servlet response ServletException if a servlet-specific error occurs IOException if an I/O error protected void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { processrequest(request, response); /** * Handles the HTTP

9 * <code>post</code> method. * request servlet request response servlet response ServletException if a servlet-specific error occurs IOException if an I/O error protected void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { processrequest(request, response); /** * Returns a short description of the servlet. * a String containing servlet public String getservletinfo() { return "Short description";

10 Output:

11

Develop an Enterprise Java Bean for Banking Operations

Develop an Enterprise Java Bean for Banking Operations Develop an Enterprise Java Bean for Banking Operations Aim: Develop a Banking application using EJB3.0 Software and Resources: Software or Resource Version Required NetBeans IDE 6.7, Java version Java

More information

Université Antonine - Baabda

Université Antonine - Baabda Université Antonine - Baabda Faculté d ingénieurs en Informatique, Multimédia, Systèmes, Réseaux et Télécommunications Applications mobiles (Pocket PC, etc ) Project: Manipulate School Database Préparé

More information

CREATE A SERVLET PROGRAM TO DISPLAY THE STUDENTS MARKS. To create a servlet program to display the students marks

CREATE A SERVLET PROGRAM TO DISPLAY THE STUDENTS MARKS. To create a servlet program to display the students marks CREATE A SERVLET PROGRAM TO DISPLAY THE STUDENTS MARKS DATE: 30.9.11 Aim: To create a servlet program to display the students marks Hardware requirements: Intel Core 2 Quad 2GB RAM Software requirements:

More information

To create a view for students, staffs and courses in your departments using servlet/jsp.

To create a view for students, staffs and courses in your departments using servlet/jsp. Aim To create a view for students, staffs and courses in your departments using servlet/jsp. Software Requirements: Java IDE Database Server JDK1.6 Netbean 6.9/Eclipse MySQL Tomcat/Glassfish Login Form

More information

ServletConfig Interface

ServletConfig Interface ServletConfig Interface Author : Rajat Categories : Advance Java An object of ServletConfig is created by the web container for each servlet. This object can be used to get configuration information from

More information

Mobile Devices in Software Engineering. Lab 2

Mobile Devices in Software Engineering. Lab 2 Mobile Devices in Software Engineering Lab 2 Objective The objective of this lab is to: 1. Get you started with network based mobile applications 2. Get you started with persistent storage on mobile devices

More information

CIS 3952 [Part 2] Java Servlets and JSP tutorial

CIS 3952 [Part 2] Java Servlets and JSP tutorial Java Servlets Example 1 (Plain Servlet) SERVLET CODE import java.io.ioexception; import java.io.printwriter; import javax.servlet.servletexception; import javax.servlet.annotation.webservlet; import javax.servlet.http.httpservlet;

More information

Advanced Internet Technology Lab # 4 Servlets

Advanced Internet Technology Lab # 4 Servlets Faculty of Engineering Computer Engineering Department Islamic University of Gaza 2011 Advanced Internet Technology Lab # 4 Servlets Eng. Doaa Abu Jabal Advanced Internet Technology Lab # 4 Servlets Objective:

More information

Wireless Java Technology

Wireless Java Technology Wireless Java Technology Pao-Ann Hsiung National Chung Cheng University Ref: http://developers.sun.com/techtopics/mobility/learning/tutorial/ 1 Contents Overview of Java 2 Platform Overview of J2ME Scope

More information

Stateless -Session Bean

Stateless -Session Bean Stateless -Session Bean Prepared by: A.Saleem Raja MCA.,M.Phil.,(M.Tech) Lecturer/MCA Chettinad College of Engineering and Technology-Karur E-Mail: asaleemrajasec@gmail.com Creating an Enterprise Application

More information

Author - Ashfaque Ahmed

Author - Ashfaque Ahmed Complimentary material for the book Software Engineering in the Agile World (ISBN: 978-1983801570) published by Create Space Independent Publishing Platform, USA Author - Ashfaque Ahmed Technical support

More information

J2ME crash course. Harald Holone

J2ME crash course. Harald Holone J2ME crash course Harald Holone 2006-01-24 Abstract This article gives a short, hands-on introduction to programming J2ME applications on the MIDP 2.0 platform. Basic concepts, such as configurations,

More information

Servlets by Example. Joe Howse 7 June 2011

Servlets by Example. Joe Howse 7 June 2011 Servlets by Example Joe Howse 7 June 2011 What is a servlet? A servlet is a Java application that receives HTTP requests as input and generates HTTP responses as output. As the name implies, it runs on

More information

Complimentary material for the book Software Engineering in the Agile World

Complimentary material for the book Software Engineering in the Agile World Complimentary material for the book Software Engineering in the Agile World (ISBN: 978-93-5300-898-7) published by Amazon, USA (ISBN: 978-1976901751) and Flushing Meadows Publishers, India (ISBN: 978-93-5300-898-7)

More information

Kamnoetvidya Science Academy. Object Oriented Programming using Java. Ferdin Joe John Joseph. Java Session

Kamnoetvidya Science Academy. Object Oriented Programming using Java. Ferdin Joe John Joseph. Java Session Kamnoetvidya Science Academy Object Oriented Programming using Java Ferdin Joe John Joseph Java Session Create the files as required in the below code and try using sessions in java servlets web.xml

More information

Chapter 13 Add Multimedia to Your MIDlets

Chapter 13 Add Multimedia to Your MIDlets Chapter 13 Add Multimedia to Your MIDlets The Mobile Media API (MMAPI), which extends the functions of Java 2 Platform, Micro Edition (J2ME), allows easy and simple access and control of basic audio and

More information

Principles and Techniques of DBMS 6 JSP & Servlet

Principles and Techniques of DBMS 6 JSP & Servlet Principles and Techniques of DBMS 6 JSP & Servlet Haopeng Chen REliable, INtelligent and Scalable Systems Group (REINS) Shanghai Jiao Tong University Shanghai, China http://reins.se.sjtu.edu.cn/~chenhp

More information

Session 9. Introduction to Servlets. Lecture Objectives

Session 9. Introduction to Servlets. Lecture Objectives Session 9 Introduction to Servlets Lecture Objectives Understand the foundations for client/server Web interactions Understand the servlet life cycle 2 10/11/2018 1 Reading & Reference Reading Use the

More information

Handout 31 Web Design & Development

Handout 31 Web Design & Development Lecture 31 Session Tracking We have discussed the importance of session tracking in the previous handout. Now, we ll discover the basic techniques used for session tracking. Cookies are one of these techniques

More information

CreateServlet.java

CreateServlet.java Classes in OBAAS 1.2: -------------------- The package name is pack_bank. Create this package in java source of your project. Create classes as per the class names provided here. You can then copy the

More information

The network connection

The network connection C H A P T E R 1 3 The network connection 13.1 About the Generic Connection Framework 366 13.2 Using the Generic Connection Framework 372 13.3 HTTP-based connections 372 13.4 Socket-based connections 377

More information

Mobile Devices in Software Engineering. Lab 3

Mobile Devices in Software Engineering. Lab 3 Mobile Devices in Software Engineering Lab 3 Objective The objective of this lab is to: 1. Test various GUI components on your device 2. Continue to develop application on mobile devices Experiment 1 In

More information

Session 10. Form Dataset. Lecture Objectives

Session 10. Form Dataset. Lecture Objectives Session 10 Form Dataset Lecture Objectives Understand the relationship between HTML form elements and parameters that are passed to the servlet, particularly the form dataset 2 10/1/2018 1 Example Form

More information

Lab Exercise 4. Please follow the instruction in Workshop Note 4 to complete this exercise.

Lab Exercise 4. Please follow the instruction in Workshop Note 4 to complete this exercise. Lab Exercise 4 Please follow the instruction in Workshop Note 4 to complete this exercise. 1. Turn on your computer and startup Windows XP (English version), download and install J2ME Wireless Toolkit

More information

Demonstration of Servlet, JSP with Tomcat, JavaDB in NetBeans

Demonstration of Servlet, JSP with Tomcat, JavaDB in NetBeans Demonstration of Servlet, JSP with Tomcat, JavaDB in NetBeans Installation pre-requisites: NetBeans 7.01 or above is installed; Tomcat 7.0.14.0 or above is installed properly with NetBeans; (see step 7

More information

JAVA SERVLET. Server-side Programming INTRODUCTION

JAVA SERVLET. Server-side Programming INTRODUCTION JAVA SERVLET Server-side Programming INTRODUCTION 1 AGENDA Introduction Java Servlet Web/Application Server Servlet Life Cycle Web Application Life Cycle Servlet API Writing Servlet Program Summary 2 INTRODUCTION

More information

&' () - #-& -#-!& 2 - % (3" 3 !!! + #%!%,)& ! "# * +,

&' () - #-& -#-!& 2 - % (3 3 !!! + #%!%,)& ! # * +, ! "# # $! " &' ()!"#$$&$'(!!! ($) * + #!,)& - #-& +"- #!(-& #& #$.//0& -#-!& #-$$!& 1+#& 2-2" (3" 3 * * +, - -! #.// HttpServlet $ Servlet 2 $"!4)$5 #& 5 5 6! 0 -.// # 1 7 8 5 9 2 35-4 2 3+ -4 2 36-4 $

More information

Lab Exercise 7. Please follow the instruction in Workshop Note 7 to complete this exercise.

Lab Exercise 7. Please follow the instruction in Workshop Note 7 to complete this exercise. Lab Exercise 7 Please follow the instruction in Workshop Note 7 to complete this exercise. 1. Turn on your computer and startup Windows XP (English version), download and install J2ME Wireless Toolkit

More information

Servlets. An extension of a web server runs inside a servlet container

Servlets. An extension of a web server runs inside a servlet container Servlets What is a servlet? An extension of a web server runs inside a servlet container A Java class derived from the HttpServlet class A controller in webapplications captures requests can forward requests

More information

3.3.4 Connection Framework

3.3.4 Connection Framework 108 MIDP 2.0 AND THE JTWI 3.3.4 Connection Framework 3.3.4.1 What s Optional and What s Not The CLDC provides a Generic Connection Framework (GCF), which is an extensible framework that can be customized

More information

A.1 JSP A.2 JSP JSP JSP. MyDate.jsp page contenttype="text/html; charset=windows-31j" import="java.util.calendar" %>

A.1 JSP A.2 JSP JSP JSP. MyDate.jsp page contenttype=text/html; charset=windows-31j import=java.util.calendar %> A JSP A.1 JSP Servlet Java HTML JSP HTML Java ( HTML JSP ) JSP Servlet Servlet HTML JSP MyDate.jsp

More information

Penetration: from application down to OS

Penetration: from application down to OS April 8, 2009 Penetration: from application down to OS Getting OS access using IBM Websphere Application Server vulnerabilities Digitаl Security Research Group (DSecRG) Stanislav Svistunovich research@dsecrg.com

More information

Faculty of Computer Science and Information Systems Jazan University MOBILE COMPUTING (CNET 426) LAB MANUAL (MOBILE APPLICATION DEVELOPMENT LAB)

Faculty of Computer Science and Information Systems Jazan University MOBILE COMPUTING (CNET 426) LAB MANUAL (MOBILE APPLICATION DEVELOPMENT LAB) Faculty of Computer Science and Information Systems Jazan University MOBILE COMPUTING (CNET 426) LAB MANUAL (MOBILE APPLICATION DEVELOPMENT LAB) (Updated February 2017) Revised and Updated By: Dr SHAMS

More information

Introduction to Servlets. After which you will doget it

Introduction to Servlets. After which you will doget it Introduction to Servlets After which you will doget it Servlet technology A Java servlet is a Java program that extends the capabilities of a server. Although servlets can respond to any types of requests,

More information

Enterprise Java Technologies (Part 1 of 3) Component Architecture. Overview of Java EE. Java Servlets

Enterprise Java Technologies (Part 1 of 3) Component Architecture. Overview of Java EE. Java Servlets ID2212 Network Programming with Java Lecture 10 Enterprise Java Technologies (Part 1 of 3) Component Architecture. Overview of Java EE. Java Servlets Leif Lindbäck, Vladimir Vlassov KTH/ICT/SCS HT 2015

More information

Session 20 Data Sharing Session 20 Data Sharing & Cookies

Session 20 Data Sharing Session 20 Data Sharing & Cookies Session 20 Data Sharing & Cookies 1 Reading Shared scopes Java EE 7 Tutorial Section 17.3 Reference http state management www.ietf.org/rfc/rfc2965.txt Cookies Reading & Reference en.wikipedia.org/wiki/http_cookie

More information

Web based Applications, Tomcat and Servlets - Lab 3 -

Web based Applications, Tomcat and Servlets - Lab 3 - CMPUT 391 Database Management Systems Web based Applications, - - CMPUT 391 Database Management Systems Department of Computing Science University of Alberta The Basic Web Server CMPUT 391 Database Management

More information

SWE642 Oct. 22, 2003

SWE642 Oct. 22, 2003 import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.arraylist; DataServlet.java /** * First servlet in a two servlet application. It is responsible

More information

INTRODUCTION TO SERVLETS AND WEB CONTAINERS. Actions in Accord with All the Laws of Nature

INTRODUCTION TO SERVLETS AND WEB CONTAINERS. Actions in Accord with All the Laws of Nature INTRODUCTION TO SERVLETS AND WEB CONTAINERS Actions in Accord with All the Laws of Nature Web server vs web container Most commercial web applications use Apache proven architecture and free license. Tomcat

More information

WEB APPLICATION ESSENTIALS

WEB APPLICATION ESSENTIALS Module 2 WEB APPLICATION ESSENTIALS Objectives > After completing this lesson, you should be able to: Describe Java servlet technology Describe JavaServer Pages technology Define a Model-View-Controller

More information

HTTP status codes. Setting status of an HTTPServletResponse

HTTP status codes. Setting status of an HTTPServletResponse HTTP status codes Setting status of an HTTPServletResponse What are HTTP status codes? The HTTP protocol standard includes three digit status codes to be included in the header of an HTTP response. There

More information

Accessing DB2 Everyplace using J2ME devices, part 1

Accessing DB2 Everyplace using J2ME devices, part 1 Accessing DB2 Everyplace using J2ME devices, part 1 Skill Level: Intermediate Naveen Balani (naveenbalani@rediffmail.com) Developer 08 Apr 2004 This two-part tutorial assists developers in developing DB2

More information

Lab session Google Application Engine - GAE. Navid Nikaein

Lab session Google Application Engine - GAE. Navid Nikaein Lab session Google Application Engine - GAE Navid Nikaein Available projects Project Company contact Mobile Financial Services Innovation TIC Vasco Mendès Bluetooth low energy Application on Smart Phone

More information

Session 8. Introduction to Servlets. Semester Project

Session 8. Introduction to Servlets. Semester Project Session 8 Introduction to Servlets 1 Semester Project Reverse engineer a version of the Oracle site You will be validating form fields with Ajax calls to a server You will use multiple formats for the

More information

Java 2 Micro Edition Server socket and SMS

Java 2 Micro Edition Server socket and SMS Java 2 Micro Edition Server socket and SMS F. Ricci Content Other Connection Types Responding to Incoming Connections Security Permissions Security domains Midlet signing Wireless Messaging Responding

More information

Servlet 5.1 JDBC 5.2 JDBC

Servlet 5.1 JDBC 5.2 JDBC 5 Servlet Java 5.1 JDBC JDBC Java DataBase Connectivity Java API JDBC Java Oracle, PostgreSQL, MySQL Java JDBC Servlet OpenOffice.org ver. 2.0 HSQLDB HSQLDB 100% Java HSQLDB SQL 5.2 JDBC Java 1. JDBC 2.

More information

Servlet. 1.1 Web. 1.2 Servlet. HTML CGI Common Gateway Interface Web CGI CGI. Java Applet JavaScript Web. Java CGI Servlet. Java. Apache Tomcat Jetty

Servlet. 1.1 Web. 1.2 Servlet. HTML CGI Common Gateway Interface Web CGI CGI. Java Applet JavaScript Web. Java CGI Servlet. Java. Apache Tomcat Jetty 1 Servlet 1.1 Web Web WWW HTML CGI Common Gateway Interface Web HTML Web Web CGI CGI CGI Perl, PHP C Java Applet JavaScript Web CGI HTML 1.2 Servlet Java Servlet Servlet CGI Web CGI 1 Java Java JVM Java

More information

DAY 3 J2ME March 2007 Aalborg University, Mobile Device Group Mobile Phone Programming

DAY 3 J2ME March 2007 Aalborg University, Mobile Device Group Mobile Phone Programming DAY 3 J2ME Mobile Phone Programming Module 2 Micro (J2ME) Overview Introduction J2ME architecture Introduction 1 J2ME Key Factors Portability: Write once run anywhere Security: Code runs within the confines

More information

Java 2 Micro Edition

Java 2 Micro Edition Java 2 Micro Edition F.Ricci Content Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles Optional packages Generic connection framework Application

More information

sessionx Desarrollo de Aplicaciones en Red A few more words about CGI CGI Servlet & JSP José Rafael Rojano Cáceres

sessionx Desarrollo de Aplicaciones en Red A few more words about CGI CGI Servlet & JSP José Rafael Rojano Cáceres sessionx Desarrollo de Aplicaciones en Red José Rafael Rojano Cáceres http://www.uv.mx/rrojano A few more words about Common Gateway Interface 1 2 CGI So originally CGI purpose was to let communicate a

More information

Accessing EJB in Web applications

Accessing EJB in Web applications Accessing EJB in Web applications 1. 2. 3. 4. Developing Web applications Accessing JDBC in Web applications To run this tutorial, as a minimum you will be required to have installed the following prerequisite

More information

CHADALAWADA RAMANAMMA ENGINEERING COLLEGE

CHADALAWADA RAMANAMMA ENGINEERING COLLEGE 1 MOBILE APPLICATION DEVELOPMENT LABORATORY MANUAL Subject Code : 9F00506 Regulations : JNTUA R09 Class : V Semester (MCA) CHADALAWADA RAMANAMMA ENGINEERING COLLEGE (AUTONOMOUS) Chadalawada Nagar, Renigunta

More information

Programming Mobile Devices Networking

Programming Mobile Devices Networking Programming Mobile Devices Networking University of Innsbruck WS 2009/2010 thomas.strang@sti2.at Networking in General Internet composed of millions of computers running the Internet Protocol (IP) stack

More information

An implementation of Tree Panel component in EXT JS 4.0

An implementation of Tree Panel component in EXT JS 4.0 An implementation of Tree Panel component in EXT JS 4.0 By Hamid M. Porasl This implementation contains an HTML file that t is used to invoke used EXT JS java script files and our implemented java Script

More information

Supplement IV.E: Tutorial for Tomcat For Introduction to Java Programming By Y. Daniel Liang

Supplement IV.E: Tutorial for Tomcat For Introduction to Java Programming By Y. Daniel Liang Supplement IV.E: Tutorial for Tomcat 5.5.9 For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Obtaining and Installing Tomcat Starting and Stopping Tomcat

More information

Mobile Information Device Profile (MIDP) Alessandro Cogliati. Helsinki University of Technology Telecommunications Software and Multimedia Laboratory

Mobile Information Device Profile (MIDP) Alessandro Cogliati. Helsinki University of Technology Telecommunications Software and Multimedia Laboratory Multimedia T-111.5350 Mobile Information Device Profile (MIDP) Alessandro Cogliati Helsinki University of Technology Telecommunications Software and Multimedia Laboratory 1 Outline Java Overview (Editions/Configurations/Profiles)

More information

Java 2 Micro Edition Server socket and SMS. F. Ricci

Java 2 Micro Edition Server socket and SMS. F. Ricci Java 2 Micro Edition Server socket and SMS F. Ricci Content Other Connection Types Responding to Incoming Connections Socket and Server Socket Security Permissions Security domains Midlet signing Wireless

More information

JAVA SERVLET. Server-side Programming ADVANCED FEATURES

JAVA SERVLET. Server-side Programming ADVANCED FEATURES JAVA SERVLET Server-side Programming ADVANCED FEATURES 1 AGENDA RequestDispacher SendRedirect ServletConfig ServletContext ServletFilter SingleThreadedModel Events and Listeners Servlets & Database 2 REQUESTDISPATCHER

More information

MCA Semester-IV. 3CA1437 Advanced Java Technologies. Important Questions of Advance Java Technologies

MCA Semester-IV. 3CA1437 Advanced Java Technologies. Important Questions of Advance Java Technologies MCA Semester-IV 3CA1437 Advanced Java Technologies Important Questions of Advance Java Technologies 1 Using connectionless Java socket API, write suitable client-server code to implement PrimeNumber application.

More information

TAMZ. JavaME. MIDlets. Department of Computer Science VŠB-Technical University of Ostrava

TAMZ. JavaME. MIDlets. Department of Computer Science VŠB-Technical University of Ostrava MIDlets 1 MIDlet A MIDlet is a Java program for embedded devices, more specifically the virtual machine. Generally, these are games and applications that run on a cell phone. MIDlets will (should) run

More information

Servlet. Web Server. Servlets are modules of Java code that run in web server. Internet Explorer. Servlet. Fire Fox. Servlet.

Servlet. Web Server. Servlets are modules of Java code that run in web server. Internet Explorer. Servlet. Fire Fox. Servlet. Servlet OOS Lab Servlet OOS Servlets are modules of Java code that run in web server. Internet Explorer Web Server Fire Fox Servlet Servlet Servlet Java Application 2 Servlet - Example OOS import java.io.*;

More information

CS434/534: Topics in Networked (Networking) Systems

CS434/534: Topics in Networked (Networking) Systems CS434/534: Topics in Networked (Networking) Systems WSN/Mobile Systems Yang (Richard) Yang Computer Science Department Yale University 208A Watson Email: yry@cs.yale.edu http://zoo.cs.yale.edu/classes/cs434/

More information

7. Concurrency. Motivation Infrastructure Faking concurrency Mobile Java implementation Symbian OS implementation. Maemo implementation Summary

7. Concurrency. Motivation Infrastructure Faking concurrency Mobile Java implementation Symbian OS implementation. Maemo implementation Summary 7. Concurrency Motivation Infrastructure Faking concurrency Mobile Java implementation Symbian OS implementation Threads Active objects Maemo implementation Summary 1 Motivation Mobile devices are fundamentally

More information

Connecting the RISC Client to non-javascriptinterfaces

Connecting the RISC Client to non-javascriptinterfaces Connecting the RISC Client to non-javascriptinterfaces Motivation In industry scenarios there is the necessity to connect the RISC client to client side subdevices or interfaces. Examples: serial / USB

More information

Internet and Mobile Services 2 - Java 2 Micro Edition. F. Ricci 2009/2010

Internet and Mobile Services 2 - Java 2 Micro Edition. F. Ricci 2009/2010 Internet and Mobile Services 2 - Java 2 Micro Edition F. Ricci 2009/2010 Content Mobile applications Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles

More information

Unit-4: Servlet Sessions:

Unit-4: Servlet Sessions: 4.1 What Is Session Tracking? Unit-4: Servlet Sessions: Session tracking is the capability of a server to maintain the current state of a single client s sequential requests. Session simply means a particular

More information

Servlets1. What are Servlets? Where are they? Their job. Servlet container. Only Http?

Servlets1. What are Servlets? Where are they? Their job. Servlet container. Only Http? What are Servlets? Servlets1 Fatemeh Abbasinejad abbasine@cs.ucdavis.edu A program that runs on a web server acting as middle layer between requests coming from a web browser and databases or applications

More information

CSC309: Introduction to Web Programming. Lecture 10

CSC309: Introduction to Web Programming. Lecture 10 CSC309: Introduction to Web Programming Lecture 10 Wael Aboulsaadat WebServer - WebApp Communication 2. Servlets Web Browser Get servlet/serv1? key1=val1&key2=val2 Web Server Servlet Engine WebApp1 serv1

More information

Using XML in Wireless Applications

Using XML in Wireless Applications Using XML in Wireless Applications CHAPTER 10 IN THIS CHAPTER Overview 336 XML and Parsing XML Documents 337 XML Parsers for Wireless Applications 340 SAX 1.0 Java API For J2ME MIDP 342 TinyXML Parser

More information

Servlet Basics. Agenda

Servlet Basics. Agenda Servlet Basics 1 Agenda The basic structure of servlets A simple servlet that generates plain text A servlet that generates HTML Servlets and packages Some utilities that help build HTML The servlet life

More information

Advanced Web Technology

Advanced Web Technology Berne University of Applied Sciences Dr. E. Benoist Winter Term 2005-2006 Presentation 1 Presentation of the Course Part Java and the Web Servlet JSP and JSP Deployment The Model View Controler (Java Server

More information

Java servlets CSCI 470: Web Science Keith Vertanen Copyright 2013

Java servlets CSCI 470: Web Science Keith Vertanen Copyright 2013 Java servlets CSCI 470: Web Science Keith Vertanen Copyright 2013 Overview Dynamic web content genera2on (thus far) CGI Web server modules Server- side scrip2ng e.g. PHP, ASP, JSP Custom web server Java

More information

OCP JavaEE 6 EJB Developer Study Notes

OCP JavaEE 6 EJB Developer Study Notes OCP JavaEE 6 EJB Developer Study Notes by Ivan A Krizsan Version: April 8, 2012 Copyright 2010-2012 Ivan A Krizsan. All Rights Reserved. 1 Table of Contents Table of Contents... 2 Purpose... 9 Structure...

More information

Preview from Notesale.co.uk Page 6 of 132

Preview from Notesale.co.uk Page 6 of 132 15. SERVLET HANDLING DATE... 80 Getting Current Date & Time... 81 Date Comparison... 82 Date Formatting using SimpleDateFormat... 82 Simple DateFormat Format Codes... 83 16. SERVLETS PAGE REDIRECTION...

More information

Session 8. JavaBeans. Reading & Reference. Reading. Reference. Session 8 Java Beans. 2/27/2013 Robert Kelly, Head First Chapter 3 (MVC)

Session 8. JavaBeans. Reading & Reference. Reading. Reference. Session 8 Java Beans. 2/27/2013 Robert Kelly, Head First Chapter 3 (MVC) Session 8 JavaBeans 1 Reading Reading & Reference Head First Chapter 3 (MVC) Reference JavaBeans Tutorialdocs.oracle.com/javase/tutorial/javabeans/ 2 2/27/2013 1 Lecture Objectives Understand how the Model/View/Controller

More information

Trusted Source SSO. Document version 2.3 Last updated: 30/10/2017.

Trusted Source SSO. Document version 2.3 Last updated: 30/10/2017. Trusted Source SSO Document version 2.3 Last updated: 30/10/2017 www.iamcloud.com TABLE OF CONTENTS 1 INTRODUCTION... 1 2 PREREQUISITES... 2 2.1 Agent... 2 2.2 SPS Client... Error! Bookmark not defined.

More information

INTERNET PROGRAMMING TEST-3 SCHEME OF EVALUATION 1.A 3 LIFE CYCLE METHODS - 3M 1.B HTML FORM CREATION - 2 M

INTERNET PROGRAMMING TEST-3 SCHEME OF EVALUATION 1.A 3 LIFE CYCLE METHODS - 3M 1.B HTML FORM CREATION - 2 M INTERNET PROGRAMMING TEST-3 SCHEME OF EVALUATION 1.A 3 LIFE CYCLE METHODS - 3M EXPLANATION - 1.B HTML FORM CREATION - 2 M SERVLET CODE IN POST METHOD IMPORT STATEMENTS - CLASS NAME AND METHOD (POST) -

More information

Getting started with Winstone. Minimal servlet container

Getting started with Winstone. Minimal servlet container Getting started with Winstone Minimal servlet container What is Winstone? Winstone is a small servlet container, consisting of a single JAR file. You can run Winstone on your computer using Java, and get

More information

Acknowledgments Introduction p. 1 The Wireless Internet Revolution p. 1 Why Java Technology for Wireless Devices? p. 2 A Bit of History p.

Acknowledgments Introduction p. 1 The Wireless Internet Revolution p. 1 Why Java Technology for Wireless Devices? p. 2 A Bit of History p. Figures p. xiii Foreword p. xv Preface p. xvii Acknowledgments p. xxi Introduction p. 1 The Wireless Internet Revolution p. 1 Why Java Technology for Wireless Devices? p. 2 A Bit of History p. 3 J2ME Standardization

More information

AJP. CHAPTER 5: SERVLET -20 marks

AJP. CHAPTER 5: SERVLET -20 marks 1) Draw and explain the life cycle of servlet. (Explanation 3 Marks, Diagram -1 Marks) AJP CHAPTER 5: SERVLET -20 marks Ans : Three methods are central to the life cycle of a servlet. These are init( ),

More information

Java Enterprise Edition. Java EE Oct Dec 2016 EFREI/M1 Jacques André Augustin Page 1

Java Enterprise Edition. Java EE Oct Dec 2016 EFREI/M1 Jacques André Augustin Page 1 Java Enterprise Edition Java EE Oct Dec 2016 EFREI/M1 Jacques André Augustin Page 1 Java Beans Java EE Oct Dec 2016 EFREI/M1 Jacques André Augustin Page 2 Java Bean POJO class : private Attributes public

More information

JSP. Common patterns

JSP. Common patterns JSP Common patterns Common JSP patterns Page-centric (client-server) CLIENT JSP or Servlet CLIENT Enterprise JavaBeans SERVER DB Common JSP patterns Page-centric 1 (client-server) Page View request response

More information

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Java Servlets Adv. Web Technologies 1) Servlets (introduction) Emmanuel Benoist Fall Term 2016-17 Introduction HttpServlets Class HttpServletResponse HttpServletRequest Lifecycle Methods Session Handling

More information

Mobile Services 2 - Java 2 Micro Edition. F. Ricci

Mobile Services 2 - Java 2 Micro Edition. F. Ricci Mobile Services 2 - Java 2 Micro Edition F. Ricci Content Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles Optional packages Generic connection framework

More information

Hỗ trợ giao thức HTTP trong

Hỗ trợ giao thức HTTP trong Hỗ trợ giao thức HTTP trong MIDP Bởi: Khoa CNTT ĐHSP KT Hưng Yên Đến đây thì bạn dã biết được rằng GCF hỗ trợ nhiều kiểu kết nối và đã phát triển ứng dụng MIDlet tải về và hiển thị hình ảnh. Trong phần

More information

Jawaharlal Nehru Engineering College

Jawaharlal Nehru Engineering College Jawaharlal Nehru Engineering College Laboratory Manual Web Information System For Final Year Students Dept: Information Technology FOREWORD It is my great pleasure to present this laboratory manual for

More information

JAVA. Java Micro Edition

JAVA. Java Micro Edition JAVA Java Micro Edition Overview predecessors Personal Java (1997) Embedded Java (1998) JME definition via JCP JCP Java Community Process JME is not a single SW package a set of technologies and specifications

More information

Web Applications 2. Java EE Martin Klíma. WA2 Slide 1

Web Applications 2. Java EE Martin Klíma. WA2 Slide 1 Web Applications 2 Java EE Martin Klíma Slide 1 Web Application Architecture App 1 request Thin client (HTML) HTTP response controller model (JavaBea n) view (HTML) HTML generator Data App 2 App 3 Data

More information

Backend. (Very) Simple server examples

Backend. (Very) Simple server examples Backend (Very) Simple server examples Web server example Browser HTML form HTTP/GET Webserver / Servlet JDBC DB Student example sqlite>.schema CREATE TABLE students(id integer primary key asc,name varchar(30));

More information

Mobile Services 2 - Java 2 Micro Edition. F. Ricci 2008/2009

Mobile Services 2 - Java 2 Micro Edition. F. Ricci 2008/2009 Mobile Services 2 - Java 2 Micro Edition F. Ricci 2008/2009 Content Mobile applications Why Java on mobile devices Three main Java environments Java 2 Micro Edition Configurations and profiles Optional

More information

Java 2 Micro Edition Socket, SMS and Bluetooth. F. Ricci 2008/2009

Java 2 Micro Edition Socket, SMS and Bluetooth. F. Ricci 2008/2009 Java 2 Micro Edition Socket, SMS and Bluetooth F. Ricci 2008/2009 Content Other Connection Types Responding to Incoming Connections Socket and Server Socket Security Permissions Security domains Midlet

More information

Servlets Pearson Education, Inc. All rights reserved.

Servlets Pearson Education, Inc. All rights reserved. 1 26 Servlets 2 A fair request should be followed by the deed in silence. Dante Alighieri The longest part of the journey is said to be the passing of the gate. Marcus Terentius Varro If nominated, I will

More information

Strut2 jasper report plugin - War deployment

Strut2 jasper report plugin - War deployment Strut2 jasper report plugin - War deployment Hi guys, if you use jasper report in a web app with Struts2 and you deploy it in Tomcat with unpacked option set to true, it doesn't work because it's impossible

More information

Java TM. JavaServer Faces. Jaroslav Porubän 2008

Java TM. JavaServer Faces. Jaroslav Porubän 2008 JavaServer Faces Jaroslav Porubän 2008 Web Applications Presentation-oriented Generates interactive web pages containing various types of markup language (HTML, XML, and so on) and dynamic content in response

More information

Integrate JPEGCAM with WaveMaker

Integrate JPEGCAM with WaveMaker Integrate JPEGCAM with WaveMaker 1.Start a new project on wavemaker or use your current project 2.On Main page or desired page add a panel widget and put name panelholder 3.Create a wm.variable called

More information

JdbcResultSet.java. import java.sql.*;

JdbcResultSet.java. import java.sql.*; 1)Write a program to display the current contents of the tables in the database where table name is Registration and attributes are id,firstname,lastname,age. JdbcResultSet.java import java.sql.*; public

More information

Advanced Topics in Operating Systems. Manual for Lab Practices. Enterprise JavaBeans

Advanced Topics in Operating Systems. Manual for Lab Practices. Enterprise JavaBeans University of New York, Tirana M.Sc. Computer Science Advanced Topics in Operating Systems Manual for Lab Practices Enterprise JavaBeans PART III A Web Banking Application with EJB and MySQL Development

More information

GlobalLogic Technical Question Paper

GlobalLogic Technical Question Paper GlobalLogic Technical Question Paper What is the output of the following code when compiled and run? Select two correct answers. public class Question01 { public static void main(string[] args){ int y=0;

More information

Java Servlets. Preparing your System

Java Servlets. Preparing your System Java Servlets Preparing to develop servlets Writing and running an Hello World servlet Servlet Life Cycle Methods The Servlet API Loading and Testing Servlets Preparing your System Locate the file jakarta-tomcat-3.3a.zip

More information

Testing Web Database Applications. Yuetang Deng Phyllis Frankl Jiong Wang

Testing Web Database Applications. Yuetang Deng Phyllis Frankl Jiong Wang Testing Web Database Applications Yuetang Deng Phyllis Frankl Jiong Wang Outline Introduction Techniques for testing Web Database applications Example Tool Preliminary experiment based on TPC-W benchmark

More information