package com.javahonk.dao;

import java.sql.Types;

import org.springframework.jdbc.core.JdbcTemplate;

import com.javahonk.di.bean.Person;

public class PersonDAO implements IPersonDAO {

    private JdbcTemplate jdbcTemplate;

    @Override
    public int insertUser(Person person) {
	String inserQuery = "INSERT INTO person(First_Name, Last_Name, Street_Name, City, State, Country) VALUES(?, ?, ?, ?, ?, ?)";
	Object[] params = new Object[] { person.getFirstName(),person.getLastName(),
		person.getStreet(),person.getCity(),person.getState(),person.getCountry()};
	int[] types = new int[] { Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR
		};
	return jdbcTemplate.update(inserQuery, params, types);
    }

    @Override
    public void deletePerson(int personID) {
	// TODO Auto-generated method stub

    }

    @Override
    public void selectAllPerson() {
	// TODO Auto-generated method stub

    }

    public JdbcTemplate getJdbcTemplate() {
	return jdbcTemplate;
    }

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
	this.jdbcTemplate = jdbcTemplate;
    }

}
