Added optionl1 and optional2 information to the files red from the db. Optional1 contains the topic code and optional2 contains the topic description

This commit is contained in:
Miriam Baglioni 2020-09-24 15:16:56 +02:00
parent 860e6d38a6
commit b66f930466
1 changed files with 3 additions and 2 deletions

View File

@ -33,7 +33,7 @@ public class ReadProjectsFromDB implements Closeable {
private final BufferedWriter writer; private final BufferedWriter writer;
private final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private final static String query = "SELECT code " + private final static String query = "SELECT code , optional1, optional2" +
"from projects where id like 'corda__h2020%' "; "from projects where id like 'corda__h2020%' ";
public static void main(final String[] args) throws Exception { public static void main(final String[] args) throws Exception {
@ -72,7 +72,8 @@ public class ReadProjectsFromDB implements Closeable {
try { try {
ProjectSubset p = new ProjectSubset(); ProjectSubset p = new ProjectSubset();
p.setCode(rs.getString("code")); p.setCode(rs.getString("code"));
p.setTopiccode(rs.getString("optional1"));
p.setTopicdescription(rs.getString("optional2"));
return Arrays.asList(p); return Arrays.asList(p);
} catch (final Exception e) { } catch (final Exception e) {