卜若的代碼筆記系列-Web系列-SpringBoot-第二十章:jdbc向sqlserver請求一行數據-3220

1.代碼 

@Autowired
        private  JdbcTemplate jdbcTemplate;               
        public String getPicpath(String name)
        { 
          Map mp =  (Map)jdbcTemplate.queryForMap("select * from picInfo where id = '"+name+"'");
          String path= (String)mp.get("content");
          return path;
        }

 其實content是我的表的一列