Java Beans interview questions for freshers/Java Beans Interview Questions and Answers for Freshers & Experienced

What is JMS?

Java Message Service is a messaging service to create, send and receive messages asynchronously.

Why JDBC is needed once we have ODBC in hand?

<> JDBC can connect only Java clients and it uses ODBC for the connectivity. Since ODBC gives a C language API that uses pointers extensively, ODBC alone cannot serve the purpose to connect to Java clients.

<> As Java does not have pointers and is object oriented, Sun Micro Systems, inventor of Java, developed JDBC to suit its needs.

Explain ODBC its Architecture?

ODBC architecture constitutes six major components namely
Front-end Tool : This provides an interface to access the database residing on back-end server, and also to present the information to the user in the format specified.
Back –end DataBase engine : this is responsible for storing, retrieving, and maintenance of data.
Database : Database is a set of data items that are logically related. A database is just a storage scheme of data, which can be manipulated only through the corresponding database engine.
ODBC Driver : Every database engine will have only one ODBC Driver. This is usually supplied by the database vendor.
ODBC Data Source : ODBC Data Source provides the way for a front-end to connect to a data source.
ODBC Manager : To manage ODBC Drivers and ODBC Data Sources, a program is supplied along with the database or sometimes with the OS which is called ODBC Manager. This can be used to install new ODBC Drivers or create new Data Sources.

How EJB Container handles exceptions?

When Application Exception occurs, ejb container intercepts the exception but returns the same to the client as it is. It does not roll back the transaction unless it is specified in code by EJBContext.setRollBackOnly() method. EJB Container does not wrap the exception in case of Application Exception.

When System Exception occurs, ejb container intercepts the exception, rollbacks the transaction and start the clean up tasks. It wraps the exception into RemoteException and throws it to the client.

What is Application level Exception in EJB?

Any exception which is not caused by business logic or business code. RuntimeException, RemoteException are SystemException. For example, error during ejb lookup.Then EJB container treats such exception as System level exception.

What is EJBQL?

EJB 3.0, ejb query language is quite handy to write custom queries without worrying about underlying database details. It is quite similar to HQL, hibernate query language and is often referred by name EJBQL.

What is Bean Managed Transactions?

In this type, developer manages the life cycle of transaction states.

What ACID stands for?

Singleton session bean is instantiated only once for the application. It exists for the life cycle of the application.

What is a transaction?

A transaction is a single unit of work items which follows the ACID properties. ACID stands for Atomic, Consistent,Isolated and Durable.

What are the types of Enterprise Bean?

There are three types of enterprise bean in java.

1. Session Bean
2. Message Driven Bean
3. Entity Bean

What is EJB container?

A container that implements the EJB component contract of the J2EE architecture. This contract specifies a runtime environment for enterprise beans that includes security, concurrency, life-cycle management, transactions, deployment, naming, and other services. An EJB container is provided by an EJB or J2EE server.

What is EJB context?

A vendor that supplies an EJB container. An object that allows an enterprise bean to invoke services provided by the container and to obtain the information about the caller of a client-invoked method.

What is EJB Home object?

An object that provides the life-cycle operations (create, remove, find) for an enterprise bean. The class for the EJB Home object is generated by the container's deployment tools. The EJB Home object implements the enterprise bean's Home interface. The client references an EJB Home object to perform life-cycle operations on an EJB object. The client uses JNDI to locate an EJB Home object.

What is EJB object?

An object whose class implements the enterprise bean's remote interface. A client never references an enterprise bean instance directly. A client always references an EJB object. The class of an EJB object is generated by a container's deployment tools.

What is DatabaseMetaData?

1. DatabaseMetaData is a class provided by java.sql package to get all the information about the database, viz. tables in the data dictionary, names of the stored procedures, primary keys of table, etc.

2. The DatabaseMetaData object is created by calling the getMetaData() method of the Connection interface.

3. The syntax is so as follows:
DataBaseMetaData dbm = con . getMetaData();

Which types of java classes can be mapped using @Lob annotation?

Follow the steps to create a manifest file:
* Open a new file with filename. Man extension.

Store the .class file in the above file as follows:

* Name: filename.class
* JavaBean: True

Explain @Lob annotation.

EJB 3.0 provides support for Blob and Clob types using @Lob annotation.

What is entity bean?

An enterprise bean that represents persistent data maintained in a database. An entity bean can manage its own persistence or can delegate this function to its container. An entity bean is identified by a primary key. If the container in which an entity bean is hosted crashes, the entity bean, its primary key, and any remote references survive the crash.

What is EJB server?

Software that provides services to an EJB container. For example, an EJB container typically relies on a transaction manager that is part of the EJBserver to perform the two-phase commit across all the participating resource managers. The J2EE architecture assumes that an EJB container is hosted by an EJBserver from the same vendor, so it does not specify the contract between these two entities. An EJB server can host one or more EJB containers.

What are the different JDBC driver types?

There are four types of JDBC drivers each having its own functionality. They are classified based on how they access data from the database. They do not substitute one another.
JDBC-ODBC bridge driver- : It provides JDBC access via most ODBC drivers.
Native –API party : Java driver – It coverts JDBC calls into calls on the Client API for Oracle, Sybase, etc.
Native- protocol all –Java driver : It converts JDBC calls into the network protocol used by DBMS directly. This allows a direct call from the client machine to the DBMS server and is a practical solution for intranet access.
Net-protocol all- Java driver : It translates JDBC calls into a DBMS independent net protocol which is then translated to DBMS protocol by a server. This net server middle-ware is able to connect all Java clients to many different databases.

What is enterprise information system?

The applications that constitute an enterprise's existing system for handling companywide information. These applications provide an information infrastructure for an enterprise. An enterpriseinformation system offers a well-defined set of services to its clients. These services are exposed to clients as local or remote interfaces or both. Examples of enterprise information systems include enterprise resource planning systems, mainframe transaction processing systems, and legacy database systems.

What is Enterprise JavaBeans?

A component architecture for the development and deployment of object-oriented, distributed, enterprise-level applications. Applications written using the Enterprise JavaBeans architecture are scalable, transactional, and secure.

What is Enterprise JavaBeans Query Language?

Defines the queries for the finder and select methods of an entity bean having container-managed persistence. A subset of SQL92, EJB QL has extensions that allow navigation over the relationships defined in an entity bean's abstract schema.

What is enterprise bean provider?

An application developer who produces enterprise bean classes, remote and Interview Questions - Home interfaces, and deployment descriptor files, and packages them in an EJB JAR file.

How is a Jar file created?

Use the following command to create a Jar file:
Jar – cvfm filename.jar filename.man filename.class

What is Introspection?

<> Introspection is the process of determining the supported properties, methods and events of a Bean.

<> It can be done with the help of the Introspector class, or directly through the use of the reflection API.

<> Without Introspection, the Java Beans technology cannot operate.

Define the term DDL, DML and DCL in Database Connectivity?

<> DDL - Data Definition Language : allows you to define the structure of the data. This language gives a facility to define the create tables in case RDBMS. All these definitions will be stored in a special table called data dictionary table.
<> DML - Data Manipulation Language : provides tools that allow modification and retrieval of data.
<> Data Control Language – DCL : it allows control over user access privileges of data. As result of DCL, user access is restricted and controlled.

What is a Stored Procedure in JDBC?

* Stored Procedures are server side objects which can be stored along with the database.

* These are accessible to different clients apart from JDBC, such as VB, Power Builder, etc.

* Essentially, stored procedures are independent of client and dependent on the database.

What are the different properties of a Java Bean?

There are five types of properties:
Simple property : To set a simple property, a pair of accessor, i.e. getXXX (), and mutator, i.e setXXX(), methods are employed.
Boolean Property : A simple property with boolean values – true or false – set in mutator method.
Indexed property : An indexed property when a single property can hold an array of values using public void set propertyName (propertyType[] list) method.
Bound property : A Bean that has a bound property generates an event when the property is changed. The event is of type propertychangeEvent and is sent to objects that previously registered an interest in receiving such notifications.
Constrained property : A Bean that has a constrained property generates an event when an attempt is made to change its value. The event is of type propertychangeEvent. It is sent to objects that previously registered an interest in receiving such notifications. Those other objects have the ability to veto the proposed change.

What is an entity?

A distinct, individual item that can be included in an XML document by referencing it. Such an entity reference can name an entity as small as a character (for example, <, which references the less-than symbol or left angle bracket, <). An entity reference can also reference an entire document, an external entity, or a collection of DTD definitions.

What is entity reference?

A reference to an entity that is substituted for the reference when the XML document is parsed. It can reference a predefined entity such as < or reference one that is defined in the DTD. In the XML data, the reference could be to an entity that is defined in the local subset of the DTD or to an external XML file (an external entity). The DTD can also carve out a segment of DTD specifications and give it a name so that it can be reused (included) at multiple points in the DTD by defining a parameter entity.

When will JavaBeans be supported on the [fill in the blank] platform/operating system?

The complete set of JavaBeans APIs are core to Java 2, hence any platform that is fully compatible with Java 2 implicitly supports JavaBeans. Thus, JavaBeans support will be available as soon as this platform/operating system vendor supports Java 2.

What are the security implications for downloading Beans over the Internet?

JavaBeans does not add any security features to the Java platform. Rather, JavaBeans components have full access to the broad range of security features that are part of the Java platform. JavaBeans components can be used to build a range of different kinds of solutions from full-fledged Java desktop applications to web-based Applets.

Why do I get a duplicate name error when loading a JAR file?

The most common reason for a "java.lang.ClassFormatError: Duplicate name" error is that a .class file in the JAR contains a class whose class name is different from the expected name. So for example if you have a file called "a/B.class" and it contains a class called "B" or "a.X" instead of the class "a.B" then you will get this error.

Themost common causes for this problem are either forgetting to include a "package a;" statement or having a "package" statement with the wrong name.

What is the relationship between Sun s JFCs and JavaBeans?

The JFC (Java Foundation Classes) is based upon the AWT (Abstract Windowing Toolkit), which has been part of the Java platform from the beginning. JFC effectively adds a richer set of visual elements for building JavaBeans components and applications. See the JFC web site for more information.

Why nobody at Sun wants to read the messages sent to java-beans@java.sun.com?

Because of the fact, that 99% of all messages is spam. It is recommended to post on JavaBeans forum, which is inspected by Sun engineers on a regular basis.

Are there JavaBeans components available that I can buy today?

Yes. A large number of companies, both large and small, have announced their plans to deliver JavaBeans-based products.

What kind of industry support exists for JavaBeans?

A coalition of industry leaders in component development worked with JavaSoft to create the JavaBeans specification, which was released to the Internet for public comments on September 4, 1996. The "frozen" JavaBeans specification combines the work of Apple, Borland, IBM, JustSystem, Microsoft, Netscape, Rogue Wave, SunSoft and Symantec and many, many others... We're very pleased to see the tools community swiftly embracing JavaBeans by announcing support for JavaBeans in their visual application builder tools.

Why a component architecture for the Java platform?

JavaBeans brings the extraordinary power of the Java platform to component development, offering the ideal environment for a developer who wants to extend the concept of reusable component development beyond one platform and one architecture to embrace every platform and every architecture in the industry.

Is JavaBeans a complete component architecture?

JavaBeans is a complete component model. It supports the standard component architecture features of properties, events, methods, and persistence. In addition, JavaBeans provides support for introspection (to allow automatic analysis of a JavaBeanscomponent) and customization (to make it easy to configure a JavaBeans component).

Is JavaBeans a complete component architecture?

JavaBeans is a complete component model. It supports the standard component architecture features of properties, events, methods, and persistence. In addition, JavaBeans provides support for introspection (to allow automatic analysis of a JavaBeanscomponent) and customization (to make it easy to configure a JavaBeans component).

Why are component architectures useful?

Developers are turning to creating components rather than monolithic applications to free themselves from slow, expensive application development, and to build up a portable, reusable code base. This enables developers to quickly attack new market opportunities, new joint development opportunities, and new ways to sell smaller packages of software.

What is a Bean? Why is not a Bean an Applet?

JavaBeans components, or Beans, are reusable software components that can be manipulated visually in a builder tool. Beans can be combined to create traditional applications, or their smaller web-oriented brethren, applets. In addition, applets can be designed to work as reusable Beans.

Difference between java bean and bean?

A Java Bean is a software component written in the Java programming language that conforms to the JavaBeans component specification. The JavaBeans APIs became part of the "core" Java APIs as of the 1.1 release of the JDK.
The JavaBeans specification defines a Java-based software component model that adds a number of features to the Java programming language. Some of these features include:

► introspection
► customization
► events
► properties
► persistence

Enterprise JavaBeans (EJBs) are Java-based software components that are built to comply with Java's EJB specification and run inside of an EJB container supplied by a J2EE provider. An EJB container provides distributed application functionality such as transaction support, persistence and lifecycle management for the EJBs.

Write a simple bean program?

Write the SimpleBean code. Put it in a file named SimpleBean.java, in the directory of your choice. Here's the code:

import java.awt.Color;
import java.beans.XMLDecoder;
import javax.swing.JLabel;
import java.io.Serializable;

public class SimpleBean extends JLabel
implements Serializable {
public SimpleBean() {
setText( "Hello world!" );
setOpaque( true );
setBackground( Color.RED );
setForeground( Color.YELLOW );
setVerticalAlignment( CENTER );
setHorizontalAlignment( CENTER );
}
}

What is property editor in java beans?

A property editor is a tool for customizing a particular property type. Property editors are activated in the Properties window. This window determines a property's type, searches for a relevant property editor, and displays the property's current value in a relevant way.

What are externizable interface?

Use the Externalizable interface when you need complete control over your bean's serialization (for example, when writing and reading a specific file format).
To use the Externalizable interface you need to implement two methods: readExternal and writeExternal. Classes that implement Externalizable must have a no-argument constructor.

What is bean persistance property?

A bean has the property of persistence when its properties, fields, and state information are saved to and retrieved from storage. Component models provide a mechanism for persistence that enables the state of components to be stored in a non-volatile place for later retrieval.

Why do I get a NullPointerException when loading a JAR file into the BeanBox?

Usually this is because of a mistake in the JAR file being loaded. In the meantime, typical errors include:

► The MANIFEST file uses classes using the wrong file separator ("/" should be used in all platforms).
► The MANIFEST file refers to classes in a package but the actual .class files are not really in that package.

What are Java Beans?

Java Beans are usual Java classes which adhere to certain coding conventions:
► Implements java.io.Serializable interface
► Provides no argument constructor
► Provides getter and setter methods for accessing it's properties.

Search
R4R Team
R4R provides Java Beans Freshers questions and answers (Java Beans Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,Java Beans interview questions for freshers,Java Beans Freshers & Experienced Interview Questions and Answers,Java Beans Objetive choice questions and answers,Java Beans Multiple choice questions and answers,Java Beans objective, Java Beans questions , Java Beans answers,Java Beans MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for Java Beans fresher interview questions ,Java Beans Experienced interview questions,Java Beans fresher interview questions and answers ,Java Beans Experienced interview questions and answers,tricky Java Beans queries for interview pdf,complex Java Beans for practice with answers,Java Beans for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .