1. // Выбрать коды валют из таблицы CURRENCY в вектор
  2. static void selectCurrency () {
  3. try {
  4. Statement stmt = conn.createStatement ();
  5. ResultSet rset = stmt.executeQuery (
  6. "select id_currency from currency");
  7. while (rset.next ()) {
  8. cv.addElement (rset.getObject (1));
  9. }
  10. }
  11. catch (SQLException sqle) {
  12. System.out.println ("SQL exception:" + sqle.getMessage ());
  13. System.out.println ("SQLState:" + sqle.getSQLState ());
  14. System.out.println ("VendorError:" + sqle.getErrorCode ());
  15. System.exit (-1);
  16. }
  17. catch (Exception sqle) {sqle.printStackTrace ();}
  18. }