Thursday, October 25, 2007

EJB interview questions Part8


26. What are the types of Servlet ?

Two types of servlets GenericServlet and HttpServlet.

GenericServlet is envisioned to be general and super class of all types of servlets. It is protocol independent, allowing for specific types like Http or FtpServlets. It has one abstract method that all sub classes should implement service method.

HttpServlet is a sub-class of generic servlet and provides some http specific functionality like doGet and doPost methods.

27. Difference between HttpServlet and Generic Servlets ?

GenericServlet is an abstract class that provides protocol independent framework for writing servlets. While http provides for http specific layer.

28. Difference between doGet and doPost ?

doGet and doPost handles POST and GET of Http respectively.

29. What are the methods in HttpServlet?

i. doGet
ii. doPost
iii. doPut
iv. doOption
v. doDelete

30. What is the capacity the doGet can send to the server ?

31. What are the types of SessionTracking ?

Http protocol is a stateless protocol and does not know if the same client returned back asking for further information. Servlets provide machanism for tracking information as about a client.

32. Why do u use Session Tracking in HttpServlet ?

33. What is Cookie ? Why is Cookie used ?

34. If my browser does not support Cookie,and my server sends a cookie instance What will happen ?

35. Can u use javaScript in Servlets ?

Typically no, however in theory there are implementations of javascript available like: rhino that could be used.

36. What are the type of protocols used in HttpServlet ?

Http and Https

37. Suppose If we have variable ' I ' in run method, If I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

38. In servlets, we are having a web page that is invoking servlets username and password? which is cheks in the database ? Suppose the second page also If wewant to verify the same information whethe it will connect to the database or itwill be used previous information?

****************************** RMI QUESTIONS ***********************************

39. Why do you use UniCastRemoteObject in RMI?

40. How many interfaces are used in RMI?

Two, skeletons and stubs. Skeletons are typically used on the server side and stubs by the client side.

41. Can RMI registry be written in the code, without having to write it in the command prompt and if yes where?

Yes, TODO don't know where in a practical sense.

42. What is the functionality of the stub?

43. How to generate skeleton & Stub classes

44. What is the functionality stubs and skeletons?


****************************** JDBC QUESTIONS **********************************

45. What are the types of JDBC drivers?

46. Explain the third driver (Native protocol driver)?

47. Which among the four drivers is pure Java driver?

48. How do you connect with the database?

49. How do you connect without the Class.forName (" ")?

50. What does Class.forName return?

A class as loaded by the classloader.

51. What are the types of statement?

52. Why is preparedStatement,CallableStatement used for?

53. In real time project which driver did u use?

54. What is the main functionality of the Prepared Statement?

55. What is meant by static query and dynamic query?

56. What are the Normalization Rules? Define the Normalization?

0 comments:

Advertisement

 

Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com