sqlserver表值函数调用方式

Connection conn = sqlServerManage.sqlServerConn();
Statement stmt;
ResultSet rs;
// 组装sql
StringBuffer report = new StringBuffer();
report.append("select * from dbo.FST_打印_检测报告检测项目1("+circulationId+")");
logger.warn("ims item sql : " + report.toString());
List<ImsDetectionitemDto> itemList = new ArrayList<>();
try {
// 建立Statement对象
stmt = conn.createStatement();
// 执行数据库查询语句
rs = stmt.executeQuery(report.toString());
while (rs.next()) {
ImsDetectionitemDto imsDetectionitemDto = new ImsDetectionitemDto();
logger.warn(rs.getString("检测项目名称"));

}
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
logger.warn("数据库连接失败 SQLException : {}", e);
}

posted @ 2019-12-24 11:36  大山里的程序猿  阅读(1911)  评论(0编辑  收藏  举报