• LOGIN
  • No products in the cart.

Advanced Java (J2EE) Interview Questions

What is J2EE?

J2EE means Java 2 Enterprise Edition. The functionality of J2EE is developing multitier web-based applications .The J2EE platform is consists of a set of services, application programming interfaces (APIs), and protocols.

What are the four components of J2EE application?

Application clients components.

Servlet and JSP technology are web components.

Business components (JavaBeans).

Resource adapter components

What are types of J2EE clients?

Applets

Application clients

Java Web Start-enabled clients, by Java Web Start technology.

Wireless clients, based on MIDP technology.

Advanced Java (J2EE) Training
Java Servlet and Java Server Pages technology components are web components. Servlets are Java programming language that dynamically receive requests and make responses. JSP pages execute as servlets but allow a more natural approach to creating static content.
What are considered as a web component?

What is JSF?

JavaServer Faces (JSF) is a user interface (UI) designing framework for Java web applications. JSF provide a set of reusable UI components, standard for web applications.JSF is based on MVC design pattern. It automatically saves the form data to server and populates the form date when display at client side.

Define Hash table

HashTable is just like Hash Map,Collection having key(Unique),value pairs. Hashtable is a collection Synchronozed object .It does not allow duplicate values but it allows null values.

What is Hibernate?

Hibernate is a open source object-relational mapping and query service. In hibernate we can write HQL instead of SQL which save developers to spend more time on writing the native SQL. Hibernate has more powerful association, inheritance, polymorphism, composition, and collections. It is a beautiful approach for persisting into database using the java objects. Hibernate also allows you to express queries using java-based criteria .

What is the limitation of hibernate?

Slower in executing the queries than queries are used directly.

Only query language support for composite keys.

No shared references to value types.

What are the advantage of hibernate.

Hibernate is portable i mean database independent, Vendor independence.

Standard ORM also supports JPA

Mapping of Domain object to relational database.

Hibernate is better then plain JDBC.

JPA provider in JPA based applications.

What is ORM?

ORM stands for Object-Relational mapping. The objects in a Java class which is mapped in to the tables of a relational database using the metadata that describes the mapping between the objects and the database. It works by transforming the data from one representation to another.

Difference between save and saveorupdate

save() – This method in hibernate is used to stores an object into the database. It insert an entry if the record doesn’t exist, otherwise  not.

saveorupdate () -This method in the hibernate is used for updating the object using identifier. If the identifier is missing this method calls save(). If the identifier exists, it will call update method.

Difference between load and get method?

load() can’t find the object from cache or database, an exception is thrown and the load() method never returns null.

get() method returns null if the object can’t be found. The load() method may return a proxy instead of a real persistent instance get() never returns a proxy.

How to invoke stored procedure in hibernate?

{ ? = call thisISTheProcedure() }

What are the benefits of ORM?

Productivity

Maintainability

Performance

Vendor independence

What the Core interfaces are of hibernate framework?

Session Interface

SessionFactory Interface

Configuration Interface

Transaction Interface

Query and Criteria Interface

What is the file extension used for hibernate mapping file?

The name of the file should be like this : filename.hbm.xml

What is the file name of hibernate configuration file?

The name of the file should be like this : hibernate.cfg.xml

How hibernate is database independent explain?

Only changing the property

<property name=”hibernate.dialect”>org.hibernate.dialect.Oracle9Dialect</property> and

<property name=”hibernate.connection.driver_class”>oracle.jdbc.driver.OracleDriver</property>

1

2

3

<property name=”hibernate.dialect”>org.hibernate.dialect.Oracle9Dialect</property> and

<property name=”hibernate.connection.driver_class”>oracle.jdbc.driver.OracleDriver</property>

full database can be replaced.

How to add hibernate mapping file in hibernate configuration file?

By <mapping resource=” filename.hbm.xml”/>

Define connection pooling?

Connection pooling is a mechanism reuse the connection.which contains the number of already created object connection. So whenever there is a necessary for object, this mechanism is used to directly get objects without creating it.

What is the hibernate proxy?

An object proxy is just a way to avoid retrieving an object until you need it. Hibernate 2 does not proxy objects by default.

Advanved JAVA (J2EE) Online Training
Configuration cfg = new Configuration(); cfg.addResource(“dir/hibernate.hbm.xml”); cfg.setProperties( System.getProperties() ); SessionFactory sessions = cfg.buildSessionFactory();
What do you create a SessionFactory?

1

Configuration cfg = new Configuration(); cfg.addResource(“dir/hibernate.hbm.xml”); cfg.setProperties( System.getProperties() ); SessionFactory sessions = cfg.buildSessionFactory();

What is HQL?

HQL stands for Hibernate Query Language. Hibernate allows to the user to express queries in its own portable SQL extension and this is called as HQL. It also allows the user to express in native SQL.

What are the Collection types in Hibernate ?

Set, List, Array, Map, Bag

What is a thin client?

A thin client is a program interface to the application that does not have any operations like query of databases, execute complex business rules, or connect to legacy applications.

November 21, 2019
GoLogica Technologies Private Limited  © 2019. All rights reserved.