// public method to extract and write the Publication information public static void WritePublication(String publicationId, int rowNum) { WritableSheet sheet2 = copy.getSheet(1); try { String query = "SELECT address,author,publicationTitle,chapter,edition,editor,month,day,note,number,publisher," + "series,title,volume,year,isbn,issn,pages FROM Publication WHERE id=" + publicationId; System.out.println(query); ResultSet result_query = statement.executeQuery(query); ResultSetMetaData metadata_query = result_query.getMetaData(); int numberOfRows = 0; if (result_query.last()) numberOfRows = result_query.getRow(); result_query.first(); if (numberOfRows > 0 && metadata_query.getColumnCount() > 0) { String aut_edi = result_query.getString(2); System.out.println("autor is " + aut_edi); if (result_query.getString(6).compareTo("") != 0) aut_edi = aut_edi + " / " + result_query.getString(6) + ",eds."; Label label = new Label(7, rowNum, aut_edi); sheet2.addCell(label); label = new Label(8, rowNum, result_query.getString(13)); sheet2.addCell(label); String publication_name = result_query.getString(3); if (result_query.getString(12).compareTo("") != 0) publication_name = publication_name + ", ser. " + result_query.getString(12); if (result_query.getString(14).compareTo("0") != 0) publication_name = publication_name + ", vol. " + result_query.getString(14); if (result_query.getString(10).compareTo("0") != 0) publication_name = publication_name + ",no. " + result_query.getString(10); label = new Label(9, rowNum, publication_name); sheet2.addCell(label); label = new Label(12, rowNum, result_query.getString(11)); sheet2.addCell(label); label = new Label(13, rowNum, result_query.getString(1)); sheet2.addCell(label); label = new Label(15, rowNum, result_query.getString(9)); sheet2.addCell(label); label = new Label(16, rowNum, result_query.getString(16)); sheet2.addCell(label); label = new Label(17, rowNum, result_query.getString(17)); sheet2.addCell(label); label = new Label(14, rowNum, result_query.getString(18)); sheet2.addCell(label); String date = result_query.getString(15); String month = "Jan"; System.out.println("month is " + result_query.getString(7)); if (result_query.getString(7).compareTo("") != 0) month = result_query.getString(7); month = func.ConvertMonth(month); date = month + "/" + date; String day = "01"; if (result_query.getString(8).compareTo("0") != 0) day = result_query.getString(8); if (day.length() == 1) day = "0" + day; date = day + "/" + date; label = new Label(10, rowNum, date); sheet2.addCell(label); label = new Label(11, rowNum, date); sheet2.addCell(label); } } catch (Exception e) { e.printStackTrace(); System.exit(1); } } // end of WritePublication