72838aaad93df64c2c386dd2443287d83a67d313.svn-base 771 B

1234567891011121314151617181920212223
  1. package com.chinacreator.process.dao;
  2. import com.chinacreator.common.dao.CacheableDao;
  3. import com.chinacreator.common.support.cache.annotation.CacheName;
  4. import com.chinacreator.process.util.DataSource;
  5. import com.frameworkset.common.poolman.SQLExecutor;
  6. import org.springframework.cache.annotation.Cacheable;
  7. import org.springframework.stereotype.Component;
  8. import java.sql.SQLException;
  9. @Component
  10. @CacheName("Dictionary")
  11. public class DictionaryDao extends CacheableDao{
  12. @Cacheable(value="Dictionary", key="#name")
  13. public String getValue(String name) throws SQLException {
  14. System.out.println("查询数据库");
  15. String sql = "select value from TB_DICTIONRY_INFO where name = ?";
  16. return SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql, name);
  17. }
  18. }