enterprise java
-
JDBC
Select records from database with JdbcTemplate
With this example we are going to demonstrate how to select records from a database using the JdbcTemplate class provided…
Read More » -
JDBC
Insert record in database with JdbcTemplate
This is an example of how to insert a record to the database using the JdbcTemplate class provided by the…
Read More » -
Mail
Sending e-mails with Spring
We will create a simple Spring service that will be used for sending mail. One method will create a SimpleMailMessage…
Read More » -
Beans
Declare bean in Spring container
With this example we are going to demonstrate how to declare a Bean in the Spring container. A Spring bean…
Read More » -
Beans
Use preferences in Spring
Spring provides PreferencesPlaceholderConfigurer that can be used to load preferences. <bean id="preferencePlaceHolder" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> <property name="userTreePath" value="com.myapp.preference.staticPreferenceLoader" /> </bean> <bean id="myEntity"…
Read More » -
MVC
Spring MVC interceptor example
The demonstration code shows you how to modify the incoming HttpServletRequest object before it reaches your controller. This does nothing…
Read More » -
hibernate
Add Restrictions to the Criteria object in Hibernate
In this example we shall show you how to add restrictions to the Criteria object in Hibernate. In Hibernate, Criteria…
Read More » -
hibernate
Select list of objects in Hibernate with Restrictions
With this example we are going to demonstrate how to select a list of objects in Hibernate using Restrictions. In…
Read More » -
hibernate
Order query resultset in Hibernate with Criteria
This is an example of how to order a query resultset in Hibernate with Criteria. In Hibernate, Criteria is a…
Read More » -
hibernate
Retrieve record in Hibernate with Criteria
In this example we shall show you how to retrieve a record in Hibernate with Criteria. To retrieve a record…
Read More »