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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Hibernate in Action ebook Download

Hibernate 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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.
  • 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:

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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:      

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

What are the Different types of FormBeans in Struts?

>> Wednesday, June 22, 2011

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

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

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Simple Application using DispatchAction and Tiles in Struts



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.

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Simple Struts program Using Tiles

>> Sunday, June 19, 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

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Hibernate Interview Questions and Answers - 5

>> Friday, June 17, 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 .

42) How will you configure Hibernate?


Answer:

The configuration files hibernate.cfg.xml (or hibernate.properties) and mapping files *.hbm.xml are used by the Configuration class to create (i.e. configure and bootstrap hibernate) the SessionFactory, which in turn creates the Session instances. Session instances are the primary interface for the persistence service.

" hibernate.cfg.xml (alternatively can use hibernate.properties): These two files are used to configure the hibernate sevice (connection driver class, connection URL, connection username, connection password, dialect etc). If both files are present in the classpath then hibernate.cfg.xml file overrides the settings found in the hibernate.properties file.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Hibernate Interview Questions and Answers - 4

>> Thursday, June 16, 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();

33) How do you invoke Stored Procedures?

A) { ? = call selectAllEmployees() }

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Hibernate Interview Questions and Answers - 3

>> Wednesday, June 15, 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

22) What role does the SessionFactory interface play in Hibernate?

A) The application obtains Session instances from a SessionFactory. There is typically a single SessionFactory for the whole application—created during application initialization. The SessionFactory caches generate SQL statements and other mapping metadata that Hibernate uses at runtime. It also holds cached data that has been read in one unit of work and may be reused in a future unit of work

SessionFactory sessionFactory = configuration.buildSessionFactory();

23) What is the general flow of Hibernate communication with RDBMS?

A) The general flow of Hibernate communication with RDBMS is :
* Load the Hibernate configuration file and create configuration object. It will automatically load all hbm mapping files
* Create session factory from configuration object
* Get one session from this session factory
* Create HQL Query
* Execute query to get list containing Java objects.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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

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


Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Hibernate Interview Questions and Answers - 2

>> Tuesday, June 14, 2011

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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Hibernate Interview Questions and Answers - 1

>> Monday, June 13, 2011

1) Explain about Hibernate?

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.

3) Explain about transparent persistence of Hibernate?

Transparent persistence is provided for Plain old Java objects or POJOs. For proper functioning of the applications importance should be given to the methods equals () and hash Code methods (). It has a requirement which should be strictly followed in the applications which is a no-argument constructor.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Storing username and password using Struts and Jdbc

Actually by using Struts configuring with database is done with Hibernate combination.very rare case the jdbc will use.This is for your understanding only.

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:

Required elements to our project:


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.

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

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);

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Can i convert Set into List ?

>> Thursday, June 9, 2011

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);

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

How to Iterate Map using Generics

>> Wednesday, June 8, 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");

Read more...

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Google Bookmark Yahoo ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl

Related Posts Plugin for WordPress, Blogger...

Random Posts

JavabynataraJ - Find me on Bloggers.com Find me on blorner.com Technology Blogs JavabynataraJ Backlinks Blogarama - The Blog Directory

  © Blogger template Webnolia by Ourblogtemplates.com 2009

Back to TOP