github 不知名

This commit is contained in:
cyk
2023-07-09 11:07:44 +08:00
parent 052d19a7de
commit 3a3b6741e6
2 changed files with 6 additions and 14 deletions

View File

@@ -60,24 +60,17 @@ public class githubDao {
return back; return back;
} }
public ResultSetMetaData ret_Github_info(int projectid) { public githubEntity ret_Github_info(int projectid) {
List<githubEntity> githubEntityList; githubEntity githubEntityList;
ResultSetMetaData rsmd = null;
String sql = "select * from githubinfo WHERE projectId = ?;"; String sql = "select * from githubinfo WHERE projectId = ?;";
try { try {
Connection conn = JdbcUtils.getConnection(); Connection conn = JdbcUtils.getConnection();
PreparedStatement prep = conn.prepareStatement(sql); QueryRunner runner = new QueryRunner();
ResultSet rs = null; githubEntityList = runner.query(conn,sql,new BeanHandler<>(githubEntity.class),projectid);
prep.setInt(1, projectid);
rs = prep.executeQuery();
while (rs.next()) {
rsmd = rs.getMetaData();
}
conn.close();
} catch (SQLException e) { } catch (SQLException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
return rsmd; return githubEntityList;
} }
} }

View File

@@ -17,7 +17,6 @@ public class githubService {
} }
public String ret_Github_info(int projectId){ public String ret_Github_info(int projectId){
ResultSetMetaData rsmd = githubDao.ret_Github_info(projectId); return JSONObject.toJSONString(githubDao.ret_Github_info(projectId));
return JSONObject.toJSONString(rsmd);
} }
} }