HintsDAO.java
资源名称:(J2EE)oa.rar [点击查看]
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
Java
- package com.oa.module.hints;
- import java.util.Map;
- import org.springframework.jdbc.core.JdbcTemplate;
- public class HintsDAO {
- private JdbcTemplate jdbcTemplate;
- public Map getHintsByUserId(String uno) {
- String sql = "select * from thints t where uno ="+uno;
- try {
- Map map = this.jdbcTemplate.queryForMap(sql);
- return map;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
- public boolean updateHints(HintForm hintForm) {
- String sql = "update thints set hshowtype=?, haffair=?, hmeeting=?, hemail=?, hshowtime=? where uno=?";
- try {
- this.jdbcTemplate.update(sql,new Object[]{hintForm.getHshowtype(),hintForm.getHaffair(),hintForm.getHmeeting(),
- hintForm.getHemail(),hintForm.getHshowtime(),hintForm.getUno()});
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return false;
- }
- public JdbcTemplate getJdbcTemplate() {
- return jdbcTemplate;
- }
- public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
- this.jdbcTemplate = jdbcTemplate;
- }
- }