This document contains a series of multiple choice questions related to Java programming concepts like JDBC, JSP, servlets, and more. There are questions testing knowledge of Java applets versus servlets, JDBC driver types, the Java virtual machine requirements, life cycle methods in servlets, and other topics. The questions cover core elements of Java web application development.
This document contains a series of multiple choice questions related to Java programming concepts like JDBC, JSP, servlets, and more. There are questions testing knowledge of Java applets versus servlets, JDBC driver types, the Java virtual machine requirements, life cycle methods in servlets, and other topics. The questions cover core elements of Java web application development.
This document contains a series of multiple choice questions related to Java programming concepts like JDBC, JSP, servlets, and more. There are questions testing knowledge of Java applets versus servlets, JDBC driver types, the Java virtual machine requirements, life cycle methods in servlets, and other topics. The questions cover core elements of Java web application development.
Q. Which one of the following is not the nature of Management:
(a) Management is goal oriented (b) Management is universal (c) Management is an Integrative Force (d) Management is static JDBC Q. A JSP is transformed into an!: (a) Java applet. (b) Java servlet. (c) Either 1 or 2 above. (d) Neither 1 nor 2 above Q. A JSP is transformed into an!: (a) Java applet (b) Java servlet. (c) Either 1 or 2 above. (d) Neither 1 nor 2 above. Q. What is not true of a Ja"a #ean$ (a) There are no public instance variables. (b) ll persistent values are accessed using get!!! and set!!! methods. (c) It ma" have man" constructors as necessar". (d) ll o# the above are true o# a Java bean. Q. What M%SQ& 'ro'ert% is used to create a surrogate (e% in M%SQ&$ (a) $NI%$E (b) &E%$EN'E (c) $T()IN'*EMENT (d) None o# the above ++ &urrogat ,e"s are not implemented in M"&%-. Q. What is sent to the user "ia )**P+ in"o(ed using the )**P 'rotocol on the user,s com'uter+ and run on the user,s com'uter as an a''lication$ (a) Java application (b) Java applet (c) Java servlet (d) None o# the above is correct. Q. -------- is an o'en source DBMS 'roduct that runs on .N/0+ &inu1 and Windows. (a) M"&%- (b) J&./&%- (c) J01'/&%- (d)&un ''E&& Q. Which JDBC dri"er *%'es! can #e used in either a''let or ser"let code$ (a) 1oth T"pe 1 and T"pe 2 (b) 1oth T"pe 1 and T"pe 2 (c) 1oth T"pe 2 and T"pe 3 (d) T"pe 3 onl" Q. *o run a com'iled Ja"a 'rogram+ the machine must ha"e what loaded and running$ (a) Java virtual machine (b) Java compiler (c) Java b"tecode (d) 4eb bro5ser Q. Who in"ented Ja"a$ (a) Netscape (b) Microso#t (c) &un (d)None o# the above is correct. Q. Where is metadata stored in M%SQ&$ (a) In the M"&%- database metadata (b) In the M"&%- database metas6l (c) In the M"&%- database m"s6l (d) None o# the above is correct. Q. )ow man% JDBC dri"er t%'es does Sun define$ (a) (ne (b) T5o (c) Three (d) Four JSP Q. when do %ou use a session #ean$ (a) 4hen "ou 5ant to be certain "our application data persists bet5een program invocations7 even in the event o# a crash. (b) I# "ou need to initiate a database transaction. (c) To process transient data that can be re+created in the event o# a crash. (d)To ,eep people 5ho do not ,no5 ho5 to program #rom accidentall" changing important logic code. Q. . What is the out'ut of following 'iece of code $ int 1 2 34 switch 1! 5 case 6:S%stem.out.'rintln76$!4 case 3: case 8:S%stem.out.'rintln78$!4 case 9: case ::S%stem.out.'rintln7:$!4 ; (a) No output (b) 2 and 8 (c) 17 2 and 8 (d) 2. Q. . /n a multithread a''lication+which tier isthe #rowser in$ (a) First tier. (b) &econd tier. (c) Third tier. (d) Fourth tier Q. what ad"antage does an entit% #ean ha"e o"er a session #ean$ (a) Entit" bean data survives crashes. (b) n entit" bean represents non+persistent data. (c) It creates its o5n J* #ile during deplo"ment. (d) 9ou get authentication code 5ithout having to 5rite an". Q. )ow can a ser"let call a <s' error 'age$ (a) This capabilit" is not supported. (b) 4hen the servlet thro5s the e!ception7 it 5ill automaticall" be caught b" the calling J&. page. (c) The servlet needs to #or5ard the re6uest to the speci#ic error page $*-. The e!ception is passed along as an attribute named :;ava!.servlet.;sp.;spE!ception:. (d) The servlet needs to redirect the response to the speci#ic error page7 saving the e!ception o## in a coo,ie. Q. what is legal a#out <s' scri'lets$ (a) loop can begin in one &criptlet and end in another (b) &tatements in &criptlets should #ollo5 Java &"nta! (c) &emicolon is needed at the end o# each statement in a &criptle (d) ll the above Q. what e1ce'tion thrown when ser"let initiali=ation fails$ (a) I(E!ception (b) &ervletE!ception (c) *emoteE!ception (d) None o# these Q. )ow are life c%cle methods called$ (a) 1" thin clients. (b) 1" calls to the database. (c) 1" the J2EE server. (d) 1" the bean<s container. Q. what is #ean> managed 'ersistence$ (a) 4hen "ou implement entit" or session bean methods to use &%- commands "ou provide. (b) 4hen the bean<s container handles data storage and retrieval. (c) 4hen the J2EE server is never shut do5n. (d) 4hen changes to database data are lost during a crash. Q. when do %ou use a session #ean$ (a) 4hen "ou 5ant to be certain "our application data persists bet5een program invocations7 even in the event o# a crash. (b) I# "ou need to initiate a database transaction (c) To process transient data that can be re+created in the event o# a crash (d) To ,eep people 5ho do not ,no5 ho5 to program #rom accidentall" changing important logic code. Q. what is thin> client a''lication$ (a) bro5ser that uses a plug+in to process user data (b) distributed application 5here the client program does not process dat. but instead passes data #or processing to an enterprise bean running on an application server. (c) n application that cannot be stopped b" a #ire5all (d) n application compiled 5ith the +thin option o# the ;avac command Ser"let Q. A ser"let can access the headers of an )**P re?uest through which following methods of the )tt'Ser"let@e?uest interface: (a) get=eader() (b) get=eaders() (c) get=eaderNames() (d) ll Q. Ser"letConte1t is 6. an /nterface 3.A container which is used to store an o#<ect so that it is a"aila#le for whole a''lication 8.A container which is used to store an o#<ect so that it is a"aila#le for session onl%. 9.A container which is used to store an o#<ect so that it is a"aila#le for re?uest onl%. (a)1727273 (b) 172 (c)17273 (d) 3 Q. /s Ser"let thread Safe$ (a) 9es (b) No (c) None (d) 1oth and 1 Q. During initiali=ation of ser"let a ser"let instance can throw (a) n $navailableE!ception (b) &ervletE!ception (c) 1oth (d) None Q. /nt init! +.ser"ice! and destro%! methods which methods are call onl% once at life c%cle of ser"lets 6.init! 3.ser"ice! 8.destro%! (a) 17272 (b) 172 (c) 2 (d) None Q. . init!+ser"ice! and destro%!methods are define in 6.<a"a1.ser"let.Ser"let interface 3.<a"a1.ser"let.Ser"let)tt' class 8.<a"a1.ser"let.Ser"let@e?uest interface 9.<a"a1.ser"let.Ser"let@es'onse interface (a) 172727378 (b) 1 (c) 27378 (d) 17378 Q. Which of the following methods are main methods in life c%cle of ser"let$ 6.init! 3 .ser"ice! 8.destro%! 9.sro'! :.wait! (a) &ervlet (b) 17272 (c) 27378 (d) 17378 Q. Which of the following are class$ 6.Ser"letConte1t 3.Ser"let 8.AenericSer"let 9.)tt'Ser"let (a) 1727273 (b) 172 (c) 273 (d) 173 Q. Which of the following are class$ 6.Ser"letConte1t 3.Ser"let 8.AenericSer"let 9.)tt'Ser"let (a) 1727273 (b) 172 (c) 17273 (d) 173 Q. 6. Ser"let is a Ja"a technolog% #ased We# com'onent. 3. Ser"let ser"lets are 'latform>inde'endent 8. Ser"let has run on We# ser"er which has a containers 9. Ser"lets interact with We# clients "ia a re?uestBres'onse using )**P 'rotocol. (a) 1727273 (b) 17272 (c) 17273 (d) None Q. Which of the following are interface$ 6.Ser"letConte1t 3.Ser"let 8.AenericSer"let 9.)tt'Ser"let (a) 1727273 (b) 172 (c) 17273 (d) 173