Books Related to Java Technology

Monday, April 27, 2009

J2EE Interview Questions and Answers

What is J2EE?

J2EE is a Java 2 Enterprise Edition. J2EE is an environment for developing and deploying enterprise applications. J2EE specification is defined by Sun Microsystems Inc. The J2EE platform is lies of a set of services, application programming interfaces (APIs), and protocols, which provides the functionality necessary for developing multi-tiered, web-based applications. The J2EE platform is one of the richest platform for the development and deployment of enterprise applications.

What do you understand by a J2EE module?

A J2EE module is a software building block that consists of one or more than J2EE components of the same container type along with one deployment descriptor of that type. J2EE specification specifies four characters of modules:
a) Web module
b) EJB module
c) resource adapter
d) application client and

Modules can also be assembled into J2EE applications.

What is J2EE component?

J2EE component is a collected functional software unit supported by a container and configurable at deployment time. The J2EE specification shows the following J2EE component part:

* Application clients and applets that run on the client machine.

* Java servlet and JavaServer Pages (JSP) technology are Web components that run on the server machine.

* Enterprise JavaBeans (EJB) (enterprise beans) are business components that run on the server.

What is bean-managed transaction ?
Transaction whose boundaries are defined by an enterprise bean.

What is binding (XML) ?
Generating the code needed to process a well-defined portion of XML data.

What is binding (JSF) ?
Wiring UI components to back-end data sources such as backing bean properties.

What is build file ?
The XML file that contains one or more asant targets.

What is business logic ?
The code that implements the functionality of an application.

What is business method ?
A method of an enterprise bean that implements the business logic or rules of an application.

What is callback methods ?
Component methods called by the container to notify the component of important events in its life cycle.

What is caller principal ?
It is principal that identifies the invoker of the enterprise bean method.

What is caller ?
Same as caller principal.

What are the components of web module?

There are the following modules:
a) Java classes
b) JSP files
c) gif and html files and
d) web component deployment descriptors

Differentiate .ear, .jar and .war files?

These files are created for different uses .These files are only zipped file using java jar tool. Here is the description of these files:

.ear files: The .ear file comprises the EJB modules of the application.
.jar files: are with the .jar extension. The .jar files comprises the libraries, resources and accessories files like property files.
.war files: are with the .war extension. The war file comprises the web application that can be deployed on the any servlet/jsp container. The .war file contains jsp, html, JavaScript and other files for necessary for the development of web applications.

Differentiate between Session Bean and Entity Bean?

Session Bean: Session is one of the EJB and it shows a single client inside the Application Server. Stateless session bean is easy to develop and its efficient. As compare to entity beans session beans needs few server resources.

Entity Bean: An entity bean represents persistent global data from the database. Entity beans data are stored into database.

Why J2EE is suitable for the development of distributed multi-tiered enterprise applications?

J2EE application program allows the developers to design and implement the business logic into components according to business requirement. J2EE architecture allows the development of multi-tired applications and the developed applications can be installed on different machines depending on the tier in the multi-tiered J2EE environment . The J2EE application parts are:

a) Web-tier components.
b) Client-tier components .
c) Business-tier components .
d) Enterprise information system (EIS)-tier software.

what is a container?

containers are the interface between a component and the low-level platform specific functionality that supports the component.

What services provided by a container?

The services provided by container are as follows:
a) Transaction management for the bean
b) Instance pooling for the bean
c) Persistence
d) Remote access
e) Lifecycle management
f) Database-connection pooling
g) Security

What are types of J2EE clients?

a) Java-Web Start
b) clients Applets
c) Web applications
d) Wireless clients

What is Deployment Descriptor?

A deployment descriptor is simply an XML(Extensible Markup Language) file with the extension of .xml.. Application servers reads the deployment descriptor to deploy the components contained in the deployment unit. As in: ejb-jar.xml file is used to describe the setting of the EJB.

What is JTA and JTS?

JTA stands for Java Transaction API and JTS stands for Java Transaction Service. JTA provides a standard interface which allows the developers to demarcate transactions . JTA is a high level transaction interface used by the application code to control the transaction.

What is JAXP?

The Java API for XML Processing (JAXP) enables applications to parse and transform XML documents independent of a particular XML processing implementation.

What is J2EE Connector architecture?

J2EE Connector Architecture (JCA) is a Java-based technology solution for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI) solutions.

differentiate between Java Bean and Enterprise Java Bean?

Java Bean as is a plain java class with member variables and getter setter methods. Java Beans are defined under JavaBeans specification as Java-Based software component model. which lets in the features like introspection, customization, events, properties and persistence.

Differentiate JTS and JTA?

JTS shows the implementation of a Java transaction manager. JTS specifies the implementation of a Transaction Manager which supports the Java Transaction API (JTA) 1.0.
The JTA shows an architecture for building transactional application servers and defines a set of interfaces for various components of this architecture. The components are: the application, resource managers, and the application server.

Can Entity Beans have no create() methods?

Entity Beans have no create() method, when entity bean is not used to store the data in the database. In this case entity bean is used to retrieve the data from database.

What are the call back methods in Session bean?

Callback methods are called by the container to notify the important events to the beans in its life cycle. The callback methods example are ejbCreate(), ejbPassivate(), and ejbActivate().

What is bean managed transaction?

In the EJB transactions can be maintained by the container or developer can write own code to maintain the transaction. If a developer doesn’t want a Container to manage transactions, developer can write own code to maintain the database transaction.

What are transaction isolation levels in EJB?

There are four levels :
* Serializable
* Committed Read
* Repeatable Read
* Uncommitted Read

What is "application client" ?
Application clients have access to some J2EE platform APIs.

What is "application client container" ?
A container that supports application client components.

What is "application client module" ?
A software unit that have one or more classes and an application client deployment descriptor.

What is "application component provider" ?
A vendor that provides the Java classes that implement components' methods, JSP page definitions, and any required deployment descriptors.

What are "application configuration resource file" ?
An XML file used to configure resources for a Java Server Faces application.

What is "archiving" ?

Process of saving the state of an object and restoring it.

What is "asant" ?
A Java-based build tool that can be extended using Java classes. The configuration files are XML-based, calling out a target tree where various tasks get executed.

What is "attribute"?
A qualifier on an XML tag that provides additional information to the client .

What is authentication ?
Process that verifies the identity of a user, device, or other entity in a computer system.

What is authorization ?
The process by which access to a method or resource is determined.

What is authorization constraint ?
An rule that determines who is permitted to access a Web resource collection.

What is B2B ?
B2B stands for Business-to-business process.

What is backing bean ?

The backing bean defines properties for the components on the page and methods that perform processing for the component.

What is basic authentication ?
An authentication mechanism in which a Web server authenticates an entity via a user name and password obtained using the Web application's built-in authentication mechanism.

What is bean-managed persistence ?
The mechanism whereby data transfer between an entity bean's variables and a resource manager is managed by the entity bean.

Swing Interview Questions and Answers

Define AWT?

AWT stands for Abstract Window Toolkit. AWT enables programmers to develop Java applications with GUI components, such as windows, and buttons.

Define JFC?

JFC stands for Java Foundation Classes. The Java Foundation Classes (JFC) are a set of Java class libraries created as part of Java 2 Platform, Standard Edition (J2SE) to support building graphics user interface (GUI) and graphics functionality for client applications.

Differentiate between Swing and AWT?

AWT is heavy-weight components, but Swing is light-weight components.

AWT is OS dependent because it uses native components, But Swing components are OS independent.

We can change the look and feel in Swing which is not possible in AWT.

Swing takes less memory compared to AWT.

For drawing AWT uses screen rendering where Swing uses double buffering.

Define heavyweight components ?

A heavyweight component is that is associated with its own native screen resource.

Define lightweight component?

A lightweight component is that who "borrows" the screen resource of an ancestor.

Define double buffering ?

Double buffering is the process of use of two buffers rather than one to temporarily hold data being moved to and from an I/O device.

Click Here to find more solution

JDBC Interview Questions and Answers

How can you establish connection?
To establish a connection you need to have the appropriate driver connect to the DBMS.
The following line of code we use:

String url = “jdbc:odbc:Fred”;
Connection con = DriverManager.getConnection(url, “Fernanda”, “J8?);

Define different types of Statements?
There are three types of statements
• Regular statement
• prepared statement
• callable statement

What are the components of JDBC?
The two major components of JDBC are Connection Pooling and Data Sources.

Define metadata?
Metadata is data about data.
In JDBC, there are two types
1. Describing information about the Result set object. i
2. describes about the database connection

Differentiate between local and global transaction?
A transaction is atomic unit of Work.

Transactions can be divided into two categories.

1.Local Transactions: These transactions are confined to the objects which reside inside one particular JVM.

2.Global Transactions:These transactions may encapsulate objects which are distributed on various JVM's.

Many More Interview Questions

Microsoft may be a winner in Oracle-Sun deal

Microsoft Corp. has had few critics more vociferious than Oracle CEO Larry Ellison and Sun Chairman Scott McNealy. So with Oracle planning to acquire Sun, Microsoft should be worried, right?

Not necessarily.

If Oracle retools itself as a full-fledged systems vendor, as Ellison suggested that it might, hardware makers such as Dell Inc. and Hewlett-Packard Co. might cozy up more with Microsoft as a business partner.

HP and Oracle teamed up last year to roll out the jointly branded Database Machine and Exadata Storage Server, which combine Oracle's software and HP's ProLiant servers. Oracle is selling the systems, while HP handles delivery and services the hardware.

But Sanford C. Bernstein & Co. analyst Toni Sacconaghi wrote in a research note last week that HP "is likely to push alternatives to [Oracle] when possible, given that they are now direct competitors in the hardware space."

"The hardware business is king [for server vendors], and anything that threatens that becomes your mortal enemy," noted Miko Matsumura, a former Sun executive who is deputy chief technology officer at Software AG.

Some analysts expect Oracle to sell Sun's hardware business to a company such as Fujitsu Ltd., which makes Sparc-based systems. But Ellison, while not divulging any Sparc-related plans, said that the acquisition could enable Oracle to develop fully integrated systems.

Tuesday, April 14, 2009

You may be a victim of software counterfeiting

This copy of windows did not pass genuine windows validation.
Ask for genuine microsoft software
To fix and Resolve the problem you may follow these steps:

After installing your genuine copy of Microsoft Windows XP you are prompted with a “Your software is counterfeit” error message at startup. Even after visiting the site and validating, you still get the above message popping up after 2 or 3 boots. There is an easy solution to this and I would like you to follow the steps below to fix the issue.

1. C:\Windows\Downloaded Program Files

  • Within that folder, remove any files or folders associated with .WGA

2. Safe Mode

  • Reboot your computer and as soon as Windows logs off, start repeatively tapping the F8 Key on your keyboard.
  • As soon as you see the Windows Advanced Startup options select Safe Mode within Safe Mode get yourself into these folders…
  • C:\Windows\System32 (Rename wgatray.exe to wgatrayold.exe)
  • C:\Windows\System32\dllcache (Rename wgatray.exe to wgatrayold.exe)
    Note: Dllcache is a hidden folder, to view hidden folders do the following, go to Start, Control Panel, Folder Options,
    Select the view Tab and under the Hidden Files option, select Show hidden files and folders

3. Safe Mode Registry

  • Click on Start, Run and within the open dialog box type regedit and click OK.
  • Within the Registry Editor navigate your self to
  • Right Click and Export the WGALOGON Folder (this should be saved onto your machine for backup purposes)
  • After Exporting the folder, DELETE the WGALOGON folder
  • After deleting close all applications and Restart your machine back to Normal Mode


  • Get into the site above and manually re-validate your copy of Windows.
  • After being prompt of a successful validation, Restart your Machine.

Saturday, April 11, 2009

Advantage of Hibernate over JDBC

  1. Hibernate provides data base independent query mechanism but JDBC does not. You need to write database specific query.
  2. Hibernate treats tables as objects and so you can work with classes and objects instead of queries and result sets but its not so with jdbc.
  3. Hibernate provides its own powerful query language called HQL (Hibernate Query Language). Using HQL you can express queries in a familiar SQL like syntax. It selects the best way to execute the database operations. JDBC supports only native Structured Query Language (SQL) and you need to write the effective query to access database.
  4. Hibernate eliminates need for repetitive SQL.
  5. Hibernate provides API to handle all create-read-update-delete (CRUD) operations i.e. no SQL is required.
  6. Hibernate makes the development fast because it relieves you from manual handling of persistent data
  7. You don’t require query tuning because hibernate does it automatically using Criteria Queries. But you need to tune queries while using jdbc.
  8. Hibernate supports query caching for better performance.
  9. Hibernate provides connection pooling by just mentioning a few lines in configuration file. But you need to write connection pooling code in case of jdbc.
  10. XML file in hibernate lets you specify all configuration information and relations between tables, which increases the readability and allows changes more easily.
  11. Hibernate supports lazy loading. Objects can also be loaded on startup by turning off the lazy attribute. Jbdc does not support it.
  12. Hibernate supports Automatic Versioning and Time Stamping but jdbc does not.
For More Details You can visit to