Package demo.repository

Source Code of demo.repository.JdbcDemo

package demo.repository;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import core.Person;
import core.PersonRepository;

public class JdbcDemo {

  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("config.xml", JdbcDemo.class);
    PersonRepository personRepository = context.getBean(PersonRepository.class);
    System.out.println("There are currently " + personRepository.count() + " people in the DB:");
    List<Person> people = personRepository.getAll();
    for (Person person : people) {
      System.out.println(person);
    }
  }

}
TOP

Related Classes of demo.repository.JdbcDemo

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.