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

Similar documents
Unit 5 JSP (Java Server Pages)

JAVA 2 ENTERPRISE EDITION (J2EE)

Fast Track to Java EE 5 with Servlets, JSP & JDBC

Peers Techno log ies Pv t. L td. Core Java & Core Java &Adv Adv Java Java

Introduction to JSP and Servlets Training 5-days

Servlet Fudamentals. Celsina Bignoli

Table of Contents. Introduction... xxi

This course is intended for Java programmers who wish to write programs using many of the advanced Java features.

PES INSTITUTE OF TECHNOLOGY, SOUTH CAMPUS DEPARTMENT OF MCA INTERNAL TEST (SCHEME AND SOLUTION) II

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering

Advance Java. Configuring and Getting Servlet Init Parameters per servlet

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

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

Java Server Page (JSP)

Enterprise Java Unit 1- Chapter 4 Prof. Sujata Rizal Servlet API and Lifecycle

Fast Track to Java EE

The Basic Web Server CGI. CGI: Illustration. Web based Applications, Tomcat and Servlets - Lab 3 - CMPUT 391 Database Management Systems 4

JAVA SERVLET. Server-side Programming INTRODUCTION

ADVANCED JAVA COURSE CURRICULUM

Module 4: SERVLET and JSP

Java Servlets. Preparing your System

HttpServlet ( Class ) -- we will extend this class to handle GET / PUT HTTP requests

JAVA MICROSERVICES. Java Language Environment. Java Set Up. Java Fundamentals. Packages. Operations

Java Server Pages JSP

4.1 The Life Cycle of a Servlet 4.2 The Java Servlet Development Kit 4.3 The Simple Servlet: Creating and compile servlet source code, start a web

COMP9321 Web Application Engineering

ADVANCED JAVA TRAINING IN BANGALORE

JavaServer Pages. What is JavaServer Pages?

JDBC [Java DataBase Connectivity]

UNIT-V. Web Servers: Tomcat Server Installation:

Enterprise Computing with Java MCA-305 UNIT II. Learning Objectives. JSP Basics. 9/17/2013MCA-305, Enterprise Computing in Java

Questions and Answers

Core Java. Basics of Java. String Handling. OOPS Concepts. Exception Handling

ServletConfig Interface

The Servlet Life Cycle

JSP - SYNTAX. Any text, HTML tags, or JSP elements you write must be outside the scriptlet. Following is the simple and first example for JSP:

JAVA. Web applications Servlets, JSP

AJP. CHAPTER 5: SERVLET -20 marks

Java Server Pages. Copyright , Xiaoping Jia. 7-01/54

Allenhouse Institute of Technology (UPTU Code : 505) OOT Notes By Hammad Lari for B.Tech CSE V th Sem

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

Servlets and JSP (Java Server Pages)

LTBP INDUSTRIAL TRAINING INSTITUTE

Call us: /

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

Unit 4 Java Server Pages

Université du Québec à Montréal

Web based Applications, Tomcat and Servlets - Lab 3 -

JavaServer Pages (JSP)

ddfffddd CS506 FINAL TERMS SOLVED BY MCQS GHAZAL FROM IEMS CAMPUS SMD CS506 Mcqs file solved by ghazal

Session 8. Introduction to Servlets. Semester Project

DVS WEB INFOTECH DEVELOPMENT TRAINING RESEARCH CENTER

Servlet And JSP. Mr. Nilesh Vishwasrao Patil, Government Polytechnic, Ahmednagar. Mr. Nilesh Vishwasrao Patil

AN ISO 9001:2008 CERTIFIED COMPANY ADVANCED. Java TRAINING.

PSD1B Advance Java Programming Unit : I-V. PSD1B- Advance Java Programming

Unit-4: Servlet Sessions:

Java Server Pages. JSP Part II

JSP MOCK TEST JSP MOCK TEST IV

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

(Objective-CS506 Web Design and Development)

Complete Java Contents

1. Introduction. 2. Life Cycle Why JSP is preferred over Servlets? 2.1. Translation. Java Server Pages (JSP) THETOPPERSWAY.

Servlets Basic Operations

COMP9321 Web Application Engineering

********************************************************************

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

COMP9321 Web Application Engineering

Basic Principles of JSPs

Questions and Answers. A. A DataSource is the basic service for managing a set of JDBC drivers.

Watch Core Java and Advanced Java Demo Video Here:

CSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, JSPs 1

Trabalhando com JavaServer Pages (JSP)

Unit 4 - Servlet. Servlet. Advantage of Servlet

1Z Java EE 6 Web Component Developer Certified Expert Exam Summary Syllabus Questions

JSP. Common patterns

Learn Java/J2EE Basic to Advance level by Swadeep Mohanty

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

directive attribute1= value1 attribute2= value2... attributen= valuen %>

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

Data Source Name (Page 150) Ref: - After creating database, you have to setup a system Data Source Name (DSN).

LTBP INDUSTRIAL TRAINING INSTITUTE

01KPS BF Progettazione di applicazioni web

SNS COLLEGE OF ENGINEERING, Coimbatore

JavaServer Pages. Juan Cruz Kevin Hessels Ian Moon

Introduction to Java Servlets. SWE 432 Design and Implementation of Software for the Web

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1

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

JAVA SERVLET. Server-side Programming ADVANCED FEATURES

JDBC. Oracle ODBC SP API SP API. SQL server C function calls. SQL server ODBC SP API. Oracle DSN Oracle ODBC Oracle

Advanced Web Technology

Trabalhando com JavaServer Pages (JSP)

CSC309: Introduction to Web Programming. Lecture 10

CE212 Web Application Programming Part 3

UNIT -5. Java Server Page

Java Programming Course Overview. Duration: 35 hours. Price: $900

Component Based Software Engineering

CS506 Web Design & Development Final Term Solved MCQs with Reference

SERVLET AND JSP FILTERS

Advanced Internet Technology Lab # 4 Servlets

Transcription:

Answers 1. What is the super interface to all the JDBC Drivers, specify their fully qualified name? a. Java.sql.Driver i. JDBC-ODBC Driver ii. Java-Native API Driver iii. All Java Net Driver iv. Java Native Protocol Driver 2. What is the name of JDBC Type I Driver? a. JSBS-ODBC Driver 3. What is the name of JDBC Type II Driver? a. Java-Native API driver 4. What is the name of JDBC Type III Driver? a. All Java Net Driver 5. What is the name of JDBC Type IV Driver? a. Java Native Protocol driver 6. Who provided JDBC Type I Driver? a. Java Soft 7. Who provided JDBC Type II Driver? a. Database vendor 8. Who provided JDBC Type III Driver? a. 3 rd party vendors like InterSolv, DataDirect 9. Who provided JDBC Type IV Driver? a. Database vendor 10. Which statement we have to update in CLASSPATH for JDBC Type I Driver? a. JDK rt.jar 11. Which statement we have to update in CLASSPATH for JDBC Type II Driver? a. Oracle ojdbc14.jar or ojdbc6.jar 12. Which statement we have to update in CLASSPATH for JDBC Type III Driver? a. IDS driver classes12.jar 13. Which statement we have to update in CLASSPATH for JDBC Type IV Driver? a. Oracle ojdbc14.jar or ojdbc6.jar 14. What is the Type I Driver class name (specify fully qualified class name)? a. sun.jdbc.odbc.jdbcodbcdriver 15. What is the Type II Driver class name (specify fully qualified class name)? a. oracle.jdbc.driver.oracledriver 16. What is the Type III Driver class name (specify fully qualified class name)? a. ids.sql.idsdriver 17. What is the Type IV Driver class name (specify fully qualified class name)? a. oracle.jdbc.driver.oracledriver 18. What is the Type I Driver URL? a. Jdbc:odbc:dbdsn 19. What is the Type II Driver URL? a. jdbc:oracle:oci:@xe 20. What is the Type III Driver URL?

a. Jdbc:ids://localhost:12/conn?dsn=dbsysdsn 21. What is the Type IV Driver URL? a. jdbc:oracle:thin:@localhost:1521:xe 22. What are various interfaces exist in java.sql package? a. Driver, Connection, Statement, PreparedStatement, CallableStatement, ResultSet, DatabaseMetaData, ResultSetMetaData 23. How many Statement interfaces exist in JDBC API? a. java.sql.statement, java.sql.preparedstatement, java.sql.callablestatement 24. Specify their significance? a. Statement executes and SQL command on DB b. Each PreparedStatement executes only one precompiled SQL plan on DB many times c. CallableStatement is used to call functions and procedures on DB 25. Which operator is used as IN parameter in PreparedStatement? a.? symbol 26. Write down the PreparedStatement creation syntax? a. PreparedStatement pstmt=con.preparestatement( INSERT INTO dept VALUES (?,?,?) ); 27. Write down the CallableStatement creation syntax for calling procedure? a. CallableStatement cstmt=con.preparecall( {CALL proc_call(?,?,?)} ); 28. Write down the CallableStatement creation syntax for calling function? a. CallableStatement cstmt=con.preparecall( {?=CALL func_call(?)} ); 29. How to register out parameter in CallableStatement a. cstmt.registeroutparameter(1, deptno); 30. Which method is called on CallableStatement to execute procedure/function? a. cstmt.execute() or cstmt.executeupdate() 31. Which method is used to call DML statements on DB a. int count=stmt.executeupdate( insert update delete ) 32. Which method is used to call DRL statements on DB a. ResultSet rs=stmt.executequery( select command ); 33. What is return type of ResultSet? a. No of rows exist in the DB 34. How to create scrollable resultset? a. con.createstatement(resultset.type_scroll_sensitive, ResultSet.CONCUR_READ_ONLY); b. ResultSet rs=stmt.executequery( select command ) 35. Which methods exist in resultset to perform bi-directional fetch on DB? a. rs.next() and rs.previous() 36. Which method is used to set autocommit false in JDBC? a. con.setautocommit(false); 37. In which interface commit() method exist? a. commit() method exist in Connection interface 38. Write down the syntax of creating CallableStatement for procedure calling? a. CallableStatement cstmt=con.preparecall( {CALL proc_call(?,?,?)} ); 39. Write down the syntax of creating CallableStatement for function calling? a. CallableStatement cstmt=con.preparecall( {?=CALL func_call(?)} ); 40. How to register out parameters on CallableStatement object? a. cstmt.registeroutparameter(1, deptno); 41. Which method is to call on CallableStatement to call function/procedure?

a. cstmt.execute() or cstmt.executeupdate() 42. In which package JDBC API exist? a. java.sql.* 43. Which software is required to obtain JDBC package? a. JDK Software 44. In which package Servlets API exist? a. javax.servlet.* and javax.servlet.http.*; 45. Which software is required to obtain Servlets package a. Tomcat servlet-api.jar 46. What is the super interface from which user defined Servlet classes must inherit from? a. User defined Servlets must implement from implements Servlet or extend from extends GenericServlet or extends HttpServlet 47. From which super classes user defined Servlet classes must inherit from? a. javax.servlet.genericservlet or javax.servlet.http.httpservlet 48. What are the lifecycle methods in Servlets API? a. public void init(servletconfig sc) throws ServletException b. public void service(servletrequest req, ServletResponse resp) throws ServletException, IOException c. public void destroy() 49. Which execution model does Servlet follows? a. Singleton-Multithread model 50. How safe the variable declared at class level in Servlet? a. Servlet declared class instance variables are not thread safe because single Servlet instance runs in multiple threads 51. What is the parameter of init() method? a. ServletConfig 52. Which exception must be written in throws clause of init() method? a. ServletException 53. What are the parameter of service() method? a. ServletException,IOException 54. Which exceptions must be written in throws clause of service() method? a. ServletException,IOException 55. When init() method executes? a. Soon after Servlet object creation, before it is being multi threaded 56. When service() method executes? a. For every client request servlet object runs in thread, from thread service() method is called 57. When destroy() method executes? a. During container/server shutdown 58. What are the 5 methods in Servlet interface? a. init(), service(), destroy(), getservletinfo(), getservletconfig() 59. Which statement must be written in service() method to obtain PrintWriter object that writes output on browser? a. PrintWriter out=resp.getwriter(); 60. How to obtain ServletContext object in init() method? a. ServletContext sctxt=sc.getservletcontext(); 61. How to obtain ServletContext object in service() method?

a. ServletContext sctxt= getservletcontext(); or ServletContext sctxt= req.getservletcontext(); 62. How to obtain HttpSession object in service() method? a. HttpSession hs=hreq.getsession(); b. hreq is the HttpServletRequest object 63. How to set the session time out in Servlet? a. hs.settimeout(long milliseconds); 64. What are the methods in ServletRequest, HttpSession and ServletContext objects to store, retrieve and remove variables/attributes? a. setattribute(object key, Object value) b. Object getattribute(object key) c. removeattribute(object key) 65. How to read HTML form data in Servlet? a. String sname=req.getpaameter( sname ).trim(); 66. What is difference between GET and POST method? a. GET sends 255 chars form data; POST sends unlimited amount of form data b. GET is unsecure because if sends form data as a query string that display output on browser location bar and the same data is called as QUERY STRING; POST sends form data securely because it sends form data through HTTP request body that doesn t displays on browser. c. GET mainly used for query some output from server; POST is used to submit new data to server that is intended to insert/update into DB on server machine. 67. Which class inherited Servlet maintains Session management? a. HttpServlet 68. What is the purpose of RequestDispatcher interface? a. Purpose of RequestDispatcher is to communicate between Servlet 69. How to obtain RequestDispatcher object? a. RequestDispatcher disp=req.getnameddispatcher( Servlet_name ); b. RequestDispatcher disp=req.getrequestdispatcher( /Servlet_url_pattern ); 70. What is the purpose of forward() and include()? a. disp.forward(req,resp) submits last Servlet output to browser b. disp.include(req,resp) includes all the included Servlets output to browser 71. What the parameters in forward() and include()? a. servletrequest, servletresponse 72. How to create RequestDispatcher object to call JSP from Servlet? a. RequestDispatcher disp=req.getrequestdispatcher( /jsp_file_path ); 73. How to create RequestDispatcher object to call another Servlet from Servlet? a. RequestDispatcher disp=req.getrequestdispatcher( /another_servlet_url_pattern ); b. disp.include(req,resp); or disp.forward(req, resp); 74. What is the difference between forward() and sendredirect()? a. forward() method forwards given servlet output to browser b. sendredirect(./path_of_html_or_jsp ) method sends html/jsp file path to browser, browser again requests for that html/jsp on server 75. In which interface sendredirect() method exist? a. HttpServletResponse 76. What is Filter? a. Filter is also a web component like Servlet but in contrast to Servlet in runs before and after Servlet execution

77. In which package Filter interface exist? a. javax.servlet.filter 78. What are the lifecycle methods in Filter? a. public void init(filterconfig(filterconfig fc) b. public void dofiter(servletrequest req, ServletResponse resp, FilterChain fc) c. public void destroy() 79. How to configure Filter in web.xml? <filter> <filter-name>validationfilter</filter-name> <filter-class>filters.validationfilter</filter-class> </filter> <filter-mapping> <filter-name>validationfilter</filter-name> <url-pattern>/registrationservlet</ url-pattern > </filter-mapping> 80. How many scripting tags exist in JSP and name them? a. JSP Comment <%-- JSP Comment placed here--%> b. Declaration element <%! %> c. Expression element <%= %> d. Scriptlet <% %> 81. How many directive elements exist in JSP and name them? a. Include directive <%@include file= %> b. Page directive <%@ page language= extends= import= session= buffer= autoflush= isthreadsafe= errorpage= iserrorpage= info= encoding= %> c. Taglib directive <%@ taglib uri= prefix= %> 82. How many standard action elements exist in JSP and name them? a. <jsp:include page= /> b. <jsp:forward page= /> c. <jsp:usebean id= class= > <jsp:setproperty name= property= value= /> <jsp:getproperty name= property= /> d. </jsp:usebean> e. <jsp:plugin> <jsp:params> <jsp:param></jsp:param> </jsp:params> <jsp:fallback><</jsp:fallback> f. </jsp:plugin> 83. Which tags are used to include other pages in JSP? a. <jsp:include page= /> and <%@ include file= %> 84. Which tag is used to forward other pages in JSP? a. <jsp:forward page= /> 85. How to increase JSP page buffer size in JSP? a. <%@ page buffer= 8kb %> 86. Which tag and its sub tags are used to call Java Bean from JSP and to call its setter and getter methods? a. <jsp:usebean> and its sub tags <jsp:setproperty/>, <jsp:getproperty/>

87. Which tag written code in JSP goes to out.println() statement? a. Expression tag <%=%> 88. Which tag written code in JSP goes to _jspservice() method? a. Scriptlet <% %> 89. How many scripting tags exist in JSP and name them? a. 4 scripting tags JSP comment, declaration element, expression element, scriptlet 90. How many directive elements exist in JSP and name them? a. 3 directive element <%@ include%>, <%@ page %>, <%@ taglib %> 91. How many standard action elements exist in JSP and name them? a. 9 standard action elements <jsp:include>, <jsp:forward>, <jsp:usebean>, <jsp:setproperty>, <jsp:getproperty>, <jsp:plugin>, <jsp:params>, <jsp:param>, <jsp:fallback> 92. Which tags are used to include other pages in JSP? a. < %@include file= path_of_html_or_jsp %> 93. Which tag is used to forward other pages in JSP? a. <jsp:forward page= path_of_jsp /> 94. How to specify error page in JSP? a. <%@ page errorpage= Error.jsp %> 95. Which tag and its sub tags are used to call Java Bean from JSP and to call its setter and getter methods? a. <jsp:usebean>, <jsp:setproperty>, <jsp:getproperty>