Advertisement
Guest User

Untitled

a guest
Oct 7th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. public SpecVisual[] getBocetosEdicion(int edicion) {
  2.  
  3. SpecVisual Svisual = new SpecVisual();
  4. ArrayList<SpecVisual> arrbocetos = new ArrayList<SpecVisual>();
  5. String driver = "org.postgresql.Driver";
  6. String connectString = "jdbc:postgresql://db1.medellin.intrayell.com:5432/clipper";
  7. String user = "clipper";
  8. String password = "clipper";
  9. try {
  10. Class.forName(driver);
  11. Connection con = DriverManager.getConnection(connectString, user,
  12. password);
  13. Statement stmt = con.createStatement();
  14. ResultSet rs = stmt
  15. .executeQuery("Select * from Spec_visual where book_edition='"
  16. + edicion + "' limit 5;");
  17.  
  18. while (rs.next()) {
  19.  
  20. Svisual.setClipperWiRef(rs.getString(1));
  21. Svisual.setCurrentStatus(rs.getString(2));
  22. // Svisual.setCurrentStatusDate(rs.getString(3));
  23. Svisual.setClipperAdvertiserRef(rs.getString(4));
  24. // Svisual.setBookEdition(rs.getString(5));
  25. // Svisual.setDueDate(rs.getString(6));
  26. // Svisual.setAdFix(rs.getString(7));
  27. // Svisual.setTimestamp(rs.getString(8));
  28. // Svisual.setReaderFwrReasonCode(rs.getString(9));
  29. // Svisual.setRefGraphicId(rs.getString(10));
  30. // Svisual.setAdvertGraphicId(rs.getString(11));
  31.  
  32. arrbocetos.add(Svisual);
  33. }
  34. stmt.close();
  35. con.close();
  36. } catch (Exception e) {
  37. System.out.println(e.getMessage());
  38. }
  39. return arrbocetos.toArray(new SpecVisual[arrbocetos.size()]);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement