SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.pig.database.databasedemo;
  2.  
  3.  
  4. import org.slf4j.Logger;
  5. import org.slf4j.LoggerFactory;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.boot.CommandLineRunner;
  8. import org.springframework.boot.SpringApplication;
  9. import org.springframework.boot.autoconfigure.SpringBootApplication;
  10.  
  11. import com.pig.database.databasedemo.jdbc.PersonjdbcDao;
  12.  
  13. @SpringBootApplication
  14. public class DatabaseDemoApplication implements CommandLineRunner{
  15.    
  16.     private Logger logger =LoggerFactory.getLogger(this.getClass());
  17.    
  18.     @Autowired
  19.     PersonjdbcDao personjdbcDao;
  20.  
  21.     public static void main(String[] args) {
  22.         SpringApplication.run(DatabaseDemoApplication.class, args);
  23.     }
  24.  
  25.     @Override
  26.     public void run(String... args) throws Exception {
  27.         logger.info("All user ->{}",personjdbcDao.findAll());
  28.         logger.info("Find Person id =10001 is ->{}",personjdbcDao.findById(10001));
  29.     }
  30.  
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top