How to get List of property values from List of objects?

package com.javautils.core;import java.util.ArrayList;import java.util.Collection;import java.util.HashSet;import com.javautils.beans.Address;import com.javautils.beans.User;public class CollectionUtil{    public static void main(String[] args)    {        User user1 = new User(1,”AAAA”, “Hyd”);        User user2 = new User(2,”BBBB”, “Bnglr”);        User user3 = new User(3,”CCCC”, “Chennai”);        User user4 =

Continue reading

JDBC DataSource Configuration in Tomcat

Put a file named context.xml in META-INF folder which contains: <?xml version=”1.0″ encoding=”UTF-8″?> <Context><Resource name=”MySQLDS” type=”javax.sql.DataSource” driverClassName=”com.mysql.jdbc.Driver” password=”root” maxIdle=”2″ maxWait=”5000″ username=”root” url=”jdbc:mysql://localhost:3306/test” maxActive=”10″/></Context> Getting the DataSource: Context context = new InitialContext();DataSource MYSQL_DATASOURCE = (DataSource) context.lookup(“java:comp/env/MySQLDS”);

Continue reading

What is Inversion Of Control (IOC)?

Inversion Of Control is a design pattern which suggests the creation of collaborating objects and injecting them should not be done by the dependent object itself. For example, Suppose WhetherController(Servlet) is depend on WhetherService which is depend WhetherDAO. WhetherController .javaclass

Continue reading

Welcome note

Hi All,Welcome guys. This is a blog where in you can find tutorials on various Java and J2EE technologies and can have discussions regarding technical problems and application development related issues.

Continue reading