mobilesectiondaoimpl.java
来自「自动导入文件到数据库,用于那些无法实时入库,定点时间入库的需求」· Java 代码 · 共 39 行
JAVA
39 行
package com.onet.autobill.dao.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import com.onet.autobill.dao.MobileSectionDao;
public class MobileSectionDaoImpl extends JdbcDaoSupport implements MobileSectionDao {
@Override
public Map<String, String> getMobileSection() {
final Map<String,String> mobileSectionMap = new HashMap<String,String>();
String sql = "select Mseg,ProvinceId from UT_COMM_MOBILE_SECTION mobile ,"
+ " ProvinceSection privince"
+ " where mobile.Prov = privince.ProvinceNm";
try {
getJdbcTemplate().query(sql, new RowCallbackHandler() {
public void processRow(ResultSet rs) throws SQLException {
do {
mobileSectionMap.put(rs.getString("Mseg"), rs.getString("ProvinceId"));
} while (rs.next());
}
});
} catch (Exception e) {
logger.error("", e);
}
return mobileSectionMap;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?