Powered by Blogger.

HibernateSearch in Action ebook Download

>> Thursday, June 30, 2011


Enterprise and web applications require full-featured, "Google-quality" search capabilities, but such features are notoriously difficult to implement and maintain. Hibernate Search builds on the Lucene feature set and offers an easyto- implement interface that integrates seamlessly with Hibernate-the leading data persistence solution for Java applications.

Hibernate Search in Action introduces both the principles of enterprise search and the implementation details a Java developer will need to use Hibernate Search effectively. This book blends the insights of the Hibernate Search lead developer with the practical techniques required to index and manipulate data, assemble and execute search queries, and create smart filters for better search results. Along the way, the reader masters performance-boosting concepts like using Hibernate Search in a clustered environment and integrating with the features already in your applications.

Hibernate in Action ebook Download

Hibernate in Action eBook DownloadHibernate practically exploded on the Java scene. Why is this open-source tool so popular? Because it automates a tedious task: persisting your Java objects to a relational database. The inevitable mismatch between your object-oriented code and the relational database requires you to write code that maps one to the other. This code is often complex, tedious and costly to develop. Hibernate does the mapping for you.

Not only that, Hibernate makes it easy. Positioned as a layer between your application and your database, Hibernate takes care of loading and saving of objects. Hibernate applications are cheaper, more portable, and more resilient to change. And they perform better than anything you are likely to develop yourself.

Sun Certified Programmer & Developer for Java 2 Study Guide ebook Download


The Best Fully Integrated Study System Available--Written by the Lead Developers of Exam 310-065


With hundreds of practice questions and hands-on exercises, SCJP Sun Certified Programmer for Java 6 Study Guide covers what you need to know--and shows you how to prepare--for this challenging exam.
  • 100% complete coverage of all official objectives for exam 310-065
  • Exam Objective Highlights in every chapter point out certification objectives to ensure you're focused on passing the exam
  • Exam Watch sections in every chapter highlight key exam topics covered
  • Simulated exam questions match the format, tone, topics, and difficulty of the real exam

Manning-Struts 2 in Action ebook Download

Product Description


The original Struts project revolutionized Java web development and its rapid adoption resulted in the thousands of Struts-based applications deployed worldwide. Keeping pace with new ideas and trends, Apache Struts 2 has emerged as the product of a merger between the Apache Struts and OpenSymphony WebWork projects, united in their goal to develop an easy-to-use yet feature-rich framework. Struts 2 represents a revolution in design and ease of use when compared to classic Struts. It adds exciting and powerful features such as a plugin framework, JavaServer Faces integration, and XML-free configuration.

Learning Jakarta Struts 1.2 ebook Download

Product DescriptionThis book is designed as a rapid and effective Struts tutorial for Java developers. The book builds a fully-featured web bookstore application incrementally, with each stage described step-by-step. Concepts are introduced simply and clearly as the design and implementation of this sample project evolves.

The emphasis is on rapid learning through clear and well structured examples. This book is written for Java developers planning to develop web applications, who are new to Struts. It expects familiarity with Java, JSP and Servlets to a degree, although more obscure elements are explained. It covers Struts 1.2.

Sun Certified Java Programmer by Kathy Sierra ebook Download

With hundreds of practice questions and hands-on exercises, SCJP Sun Certified Programmer for Java 6 Study Guide covers what you need to know--and shows you how to prepare--for this challenging exam.
SCJP 6 Study Guide by Kathy Sierra-JavabynataraJ
  • 100% complete coverage of all official objectives for exam 310-065
  • Exam Objective Highlights in every chapter point out certification objectives to ensure you're focused on passing the exam
  • Exam Watch sections in every chapter highlight key exam topics covered
  • Simulated exam questions match the format, tone, topics, and difficulty of the real exam
Covers all SCJP exam topics, including:

HeadFirst Servlets and Jsp 2nd Edition ebook Download

HeadFirst Servlets and Jsp 2nd Edition ebook DownloadWant to get to know the latest (J2EE 1.4) versions of Servlets and JSPs so well that you can pass the Sun Certified Web Component Developer (SCWCD) 1.4 exam? No problem! Head First Servlets & JSP will show you how to write servlets and JSPs, what makes the Container tick, how to use the new JSP Expression Language (EL), and much more. You won't just pass the exam, you will truly understand this stuff and be able to put it to work right away.

HeadFirst HTML with CSS and XHTML ebook Download

Tired of reading HTML books that only make sense after you're an expert? Then it's about time you picked up Head First HTML with CSS & XHTML and really learn HTML. You want to learn HTML so you can finally create those web pages you've always wanted, so you can communicate more effectively with friends, family, fans, and fanatic customers.

You also want to do it right so you can actually maintain and expand your web pages over time, and so your web pages work in all the browsers and mobile devices out there. So what are you waiting for? Leave those other dusty books behind and come join us in Webville. Your tour is about to begin.

struts-config.xml in Detail

>> Wednesday, June 29, 2011


The main tags in struts-config.xml are:


<data-sources/>
<form-beans/>
<global-forwards/>
<global-exceptions/>
<action-mappings/>
<controller/>
<message-resources/>
<plug-in/>

The basic example code of struts-config.xml as given below with all tags.

Struts LookupDispatchAction Example Application

>> Tuesday, June 28, 2011

LookupDispatchAction class can group the similar functions in to a single action class by using propeties file and overriding getKeyMethodMap() of HashMap.

In this example we can learn how to group set of userdefined methods in to a single action class.

LookupDispatchAction class extends org.apache.struts.actions.DispatchAction.Our class CalculateAction should extens to LookupDispatchAction.This class does not provide any predefined action methods.The user defined methods will be defined here.

In previous example of DispatchAction class the reqest parameter carry the value of the method directly.But in LookupDispatchAction class the value will be passed to method name using keys and values defining in getKeyMethodMap method.We should override this method in LookupDipatchAction class.This method returns map object with keys and values.

The additional elements required in LookupDispatchAction class:      

Struts ApplicationResource.properties in Detail

>> Thursday, June 23, 2011

Industries standard principle in project development is don't hardcode(typing code) any values in the application that are changable in the future.

To make java,jdbc applications flexible collect driverclass name,url,database username,password details required for jdbc code from outside the application by using the support of properties file.

A file that contains entries in the form of key = value page is called properties file.

abc.properties

What are the Different types of FormBeans in Struts?

There are six types of FormBean classes are available in struts.

They are:
  •     ActionForm
  •     DynaActionForm
  •     ValidatorForm
  •     DynaValidatorForm
  •     ValidatorActionForm
  •     DynaValidatorActionForm

Simple Application using DispatchAction and Tiles with Struts

>> Wednesday, June 22, 2011

In previous DispatchAction example we observed the resultant page is displaying in new page.Now we are doing to display the result within the page using Tiles concept in Struts.
DispatchAction using Tiles Struts_javabynataraj
For Tiles concept design a layout to display Calculate.jsp and result.jsp.Override the result.jsp page with the add.jsp,sub.jsp,mul.jsp,div.jsp pages by defining the definintions in tiles-defs.xml.

Here you have to understand the integration of DispatchAction and Tiles. Normally we forward the pages using forwarding depends on string returned.

Take a look before starting our application, on DispatchAction and Tiles using Struts.

The required files for our Applicatoin:

Struts DispatchAction Example Application

>> Tuesday, June 21, 2011

Struts DispatchAction can group similar action classes into a single action class having different methods.
In this action excluding the execute method we can write our own user defined methods.The parameters are same given by struts framework (mapping,form,request,response).

In this example we will see how to group similar action methods in a single Class like add,sub,mul,div.In a single page we are performing four actions with different buttons.

In our example our Actionclass (CalculateAction) should extends DispatchAction to dispatch the action based on the parameter value of action button.Here we should concentrate how the action is performing.

Simple Struts program Using Tiles

>> Monday, June 20, 2011

Simple Struts program Using Tiles

Welcome to Struts Tiles Component.Tiles is a templating system.It can be used to create a common look and feel for a Web Application.This can be used to  reusable view components.

The main features of Tiles:
  • Inheritance mechanism on definitions
  • Common layouts with overriding mechanism
  • Dynamic page reload based on parameter layout
  • We can load different tiles according to Locale Internationalization(i18N).
  • It is possible to load different Tiles according to a key.
The additional elements to develop Tiles application
  1. layout.jsp 
  2. tiles-defs.xml

Hibernate Interview Questions and Answers - 5

>> Saturday, June 18, 2011

41) What is the difference between sorted and ordered collection in hibernate?


A) sorted collection vs. order collection
sorted collection :-
A sorted collection is sorting a collection by utilizing the sorting features provided by the Java collections framework. The sorting occurs in the memory of JVM which running Hibernate, after the data being read from database using java comparator.
If your collection is not large, it will be more efficient way to sort it.
order collection :-
Order collection is sorting a collection by specifying the order-by clause for sorting this collection when retrieval.
If your collection is very large, it will be more efficient way to sort it .

Hibernate Interview Questions and Answers - 4

>> Friday, June 17, 2011

31) What does it mean to be inverse?

A) It informs hibernate to ignore that end of the relationship. If the one–to–many was marked as inverse, hibernate would create a child–>parent relationship (child.getParent).

32) What do you mean by Named – SQL query?

A) Named SQL queries are defined in the mapping xml document and called wherever required.

Example:

SELECT emp.EMP_ID AS {emp.empid},
emp.EMP_ADDRESS AS {emp.address},
emp.EMP_NAME AS {emp.name}
FROM Employee EMP WHERE emp.NAME LIKE :name

Invoke Named Query :
List people = session.getNamedQuery(“empdetails”).setString(“TomBrady”, name).setMaxResults(50).list();

Hibernate Interview Questions and Answers - 3

>> Thursday, June 16, 2011

21) What role does the Session interface play in Hibernate?

A) The Session interface is the primary interface used by Hibernate applications. It is a single-threaded, short-lived object representing a conversation between the application and the persistent store. It allows you to create query objects to retrieve persistent objects.

Session session = sessionFactory.openSession( );

Session interface role:
* Wraps a JDBC connection
* Factory for Transaction
* Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier

Hibernate Configuration file (hibernate.cfg.xml) in Detail

>> Wednesday, June 15, 2011

Hibernate Configuration file for SQLyog.

Before configuring the properties of hibernate.cfg.xml we should mention the xml schema definitions of hibernate-configurations.The dtd defines the version and everything which is licensed.

To configure with database to our application we should give all the properties related to our database.The given properties of hibernate-configuration.

hibernate.connection.driver_class
hibernate.connection.url
hibernate.connection.username
connection.password
connection.pool_size
hibernate.dialect
show_sql
hibernate.hbm2ddl.auto


Hibernate Interview Questions and Answers - 2

11) Explain about mapping files in Hibernate?

Mapping files forms the core of any database mapping tools. These files contain field to field mapping, usually this mapping occurs between classes and attributes. After mapping files they can be persist to the database. Tags can be used to indicate the presence of a primary key.

12) What is the effect when a transient mapped object is passed onto a Sessions save?


When a session.save( ) is passed to a transient mapped object it makes the method to become more persistent. Garbage collection and termination of the Java virtual machine stays as long as it is deleted explicitly. It may head back to its transient state.

13) Explain about version field?

Application level data integrity constants are important if you are making changes to offline information which is again backed by database. Higher level locking or versioning protocol is required to support them. Version field usage comes at this stage but the design and implementation process is left to the developer.

Hibernate Interview Questions and Answers - 1

>> Tuesday, June 14, 2011

1) Explain about Hibernate?
Hibernate Interview Questions_JavabynataraJ
Hibernate solves problems such as Object Relational impedance mismatch, etc. It is commonly used for object and query service. It helps data base developers develop classes which include inheritance, association, composition and polymorphism. A developer or user can express queries either in HQL or SQL.

2) Explain about the primary feature of Hibernate?

Primary feature of hibernate is to java classes to database tables. Data query and retrieval is also possible with Hibernate. Application portability is a key feature in Hibernate it allows developers to port applications to almost all SQL databases.

Storing username and password using Struts and JDBC

>> Monday, June 13, 2011

Integrating Struts with JDBC is pretty much simple. In real time most of the people work with Hibernate instead of JDBC. Here we can understand using a simple program, how to work using Struts and JDBC.

This is the application to persist the data into database from jsp pages using JDBC and struts.
The required components to develop Struts with JDBC:

Project Structure:

Project Strcture_Struts-JDBC
From the beginning the end user submits the request from JSP form(Login.jsp) to struts based web application.Using struts-html.tld file we generate the html tags in jsp page to read username and password and for submit button.

Can i convert List to Set (or) ArrayList to HashSet ?

>> Friday, June 10, 2011

Yes.We can convert from List to Set.Both are under the same Superclass Collection Interface.So there are more chances to convert.







Actually ArrayList follows the insertion order of elements.When you tried to convert from ArrayList to HashSet it won't preserve the previous order, it may change according to the properties of HashSet.Set won't maintain the order of elements.

Here we are passing the reference of the List to HashSet constructor at the creation of set object.

Set<Object> set = new HashSet<Object>(list);

Can i convert Set into List ?

Yes.we can convert a Set into List.The List and Set both are interfaces having superclass of Collection interface.

Create an object of HashSet which is implemented a Set Interface.Add the objects to the HashSet using add() method.


Set<String> set = new HashSet<String>();
  set.add("username");
  set.add("password");
  set.add("login");

And same Create an object of ArrayList which is implemented a List Interface.Pass the reference object of Set while creating the ArrayList object.

List<String> list = new ArrayList<String>(set);

How to Iterate Map using Generics

>> Thursday, June 9, 2011

Map is an interface.We can iterate the implemented classes from map like TreeMap,HashMap,LinkedHashMap.

Maps do not provide an iterator() method as do Lists and Sets. A Set of either keys (keySet()) or key-value 'Map.Entry' elements (entrySet()) can be obtained from the Map, and one can iterate over that.

Create an object for HashMap and insert the objects in that.

Map<Integer, String> map = new HashMap<Integer, String>();
  map.put(100, "Murali");
  map.put(200, "khaleel");
  map.put(300, "Bhaskar");

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.