package com.javahonk;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.javahonk.dao.IPersonDAO;
import com.javahonk.di.bean.Person;

public class TestSpringJDBCTemplate {

    public static void main(String[] args) {
	ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
		"spring\\application-config.xml");

	IPersonDAO personDAO = applicationContext.getBean(
		"personDAO", IPersonDAO.class);
	Person person = new Person("Mary", "Kay", "Mary st.",
		"Edison", "NJ", "USA");

	personDAO.insertUser(person);
	System.out.println("User inserted to the table");

	applicationContext.close();

    }

}
