Tuesday, October 23, 2012

JAVA question bank unit 3 and 4


Unit III
2 Marks
  1. What is the use of remote reference layer?
            The remote reference layer, which is the middleware between the stub/skeleton layer and the underlying transport protocol. This layer handles the creation and management of remote object references.
2.       What is the difference between RMI and CORBA ? (or)  Compare RMI and CORBA.

RMI

·         Java only solution. The interfaces, implementations and the clients are all written in Java.
·         RMI allows dynamic loading of classes at runtime.

CORBA

·         CORBA was made specifically for interoperability among various languages. For example the server could be written in C++ and the business logic can be in Java and the client can be written in COBOL.
·         In a CORBA environment with multi-language support it is not possible to have dynamic loading.
3.       What is meant by Middleware?
Middleware is a distributed software needed to support interaction between clients and servers. In short, it is the software that is in the middle of the Client/Server systems and it acts as a bridge between the clients and servers. It starts with the API set on the client side that is used to invoke a service and it covers the transmission of the request over the network and the resulting response.

4.       Define the terms marshalling and unmarshalling.
"marshalling" refers to the process of converting the data or the objects into a byte-stream, and "unmarshalling" is the reverse process of converting the byte-stream back to their original data or object. The conversion is achieved through "serialization".The purpose of the "marshalling/unmarshalling" process is to transfer data between the RMI system. 

  1. What are the activation models?
Active object model and Passive object model
Active object is a remote object that is instantiated and exported in a JVM on some system.
A passive object is one that is not yet instantiated in a JVM, but which can be brought
            into an active state.
Transforming a passive object into an active object is a process known as activation

  1. Explain the naming services in CORBA.
The Naming Service allows you to associate abstract names with CORBA objects and allows clients to find those objects by looking up the corresponding names.

7.       What is a remote object ?

A remote object is one whose methods can be invoked from another JVM (i.e. another process). A remote object class must implement the Remote interface. A RMI Server is an application that creates a number of remote objects.

8.       What are the four layers in RMI Architecture?

The four layers in RMI Architecture are Application Layer, Stub & Skeleton Layer, Remote Reference Layer, Transport Layer.

9.       What are the services provided by the RMI Object ?

RMI provides some basic object services, which can be used in a distributed application.
These services are
·         Object naming/registry service: RMI servers can provide services to clients by registering one or more remote objects with its local RMI registry.
·         Object activation service: It provides a way for server (i.e. remote) objects to be started on an as-needed basis. Without the remote activation service, a server object has to be registered with the RMI registry service.

10.    What is the role of Remote Interface in RMI?


The Remote interface serves to identify interfaces whose methods may be invoked from a non-local virtual machine. Any object that is a remote object must directly or indirectly implement this interface. Methods that are to be invoked remotely must be identified in Remote Interface.

11.    What is the default port used by RMI Registry?


The default port used by RMI Registry is 1099.

12.    What is the use of UnicastRemoteObject in RMI?


The UnicastRemoteObject class provides support for point-to-point active object references using TCP streams. Objects that require remote behavior should extend UnicastRemoteObject.

13.    In a RMI Client Program, what are the excpetions which might have to handled?


MalFormedURLException, NotBoundException, RemoteException 


16 Marks
  1. Explain the architecture of RMI
  2. Discuss the steps involved in creating an RMI server.
  3. Explain the implementation of Naming service in CORBA.
4.      Discuss a simple client/server application using RMI.
  1. What is the use of CORBA? Draw the Programming Model of CORBA.
  2. Write short notes on IDL technology.
7.      What is object serialization? Write a java program to serialize an object.
  1. Justify the need for creating and using a JAR file.
  2. Explain the process of mapping an IDL to java with an example.
  3. List out the different services provided by CORBA specification And high light their features
11.  Illustrate the steps involved in RMI server creation with an example.
  1. Explain the steps involved in JAR file creation.
  2. How do you create a JAR file? Give an example.





Unit IV
2 Marks
  1. Mention the various types of JDBC drivers.
JDBC drivers are divided into four types or levels. The different types of jdbc drivers are:
Type 1: JDBC-ODBC Bridge driver (Bridge)
Type 2: Native-API/partly Java driver (Native)
Type 3: AllJava/Net-protocol driver (Middleware)
Type 4: All Java/Native-protocol driver (Pure)
2.      What is Server-side programming?
Server-side programming that are executed on the server, and  then translated into Hyper Text Markup Language (HTML) which can be viewed by all web browsers.
  1. Give the life cycle of Servlets.

The life cycle of Servlets are
·         A server loads and initializes the servlet 
·         The servlet handles zero or more client requests 
·         The server removes the servlet 

4.      What is session tracking?
HTTP is stateless protocol and it does not maintain the client state. But there exist a mechanism called "Session Tracking" which helps the servers to maintain the state to track the series of requests from the same user across some period of time. 
5.      What  are different types of Session Tracking?
Mechanism for Session Tracking are:
a)      Cookies    b) URL rewriting    c)Hidden form fields
6.      What are the types of Servlet?
There are two types of servlets, GenericServlet and HttpServlet. GenericServlet defines the generic or protocol independent servlet. HttpServlet is subclass of GenericServlet and provides some http specific functionality linke doGet and doPost methods.
7.      What are the five main class object in java media framework?
The five main class object in java media framework are.
a.)    Manager   b)DataSource    c)Player     d)Processor     e)DataSink

16 Marks
  1. Explain the servlet creation with an example
  2. Explain the steps involved in accessing a database using JDBC
3.      What is Session Tracking? Write a program for implementing session tracking.
  1. Write a Java program for printing student mark sheet using JDBC.
5.      Explain the JDBC configuration process with an example.
  1. Write a Servlet to display a “Hello” message.
7.      Explain the steps involved in JDBC connectivity.
8.      What is Java Media Framework? Explain it briefly.


No comments:

Post a Comment