{"id":283246,"date":"2016-12-29T14:55:04","date_gmt":"2016-12-29T11:55:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283246"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283246","title":{"rendered":"\u0412\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4ca\/ad2\/706\/4caad27066b24be4a041522ae39cf9e4.png\" alt=\"\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 <del>\u043a\u0440\u043e\u0432\u0430\u0432\u044b\u043c \u044d\u043d\u0442\u0435\u0440\u043f\u0440\u0430\u0439\u0437\u043e\u043c<\/del> \u043d\u0435 \u0440\u0430\u0437 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u044d\u0442\u0438\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043c\u044b. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0444\u0438\u043d\u0441\u043a\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Vaadin \u0438 \u0447\u0438\u0441\u0442\u044b\u043c JDBC \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043b\u043e\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u0435\u0437 \u043e\u043f\u044b\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JDBC \u043c\u044b \u043d\u0430\u0433\u043e\u0440\u043e\u0434\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043b\u043e\u0439 \u0441\u043f\u0430\u0433\u0435\u0442\u0442\u0438 \u043a\u043e\u0434\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0431\u043b\u0435\u0441\u0442\u043d\u043e \u0441 \u043d\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>  <\/p>\n<p>\u041e \u0442\u043e\u043c \u043a\u0430\u043a \u043c\u044b \u0441 \u044d\u0442\u0438\u043c \u0431\u043e\u0440\u043e\u043b\u0438\u0441\u044c \u0438 \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438\u0437\u043e\u0431\u0440\u0435\u043b\u0438 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"chto-privelo-k-takomu-resheniyu\">\u0427\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044e<\/h3>\n<p>  <\/p>\n<p>\u0412 Vaadin \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 UI \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>BeanItem Container<\/code>, \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/vaadin.com\/docs\/-\/part\/framework\/datamodel\/datamodel-container.html#datamodel.container.beanitemcontainer\">\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c<\/a> \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>  <\/p>\n<h5 id=\"korotko-o-predmetnoy-oblasti\">\u041a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438<\/h5>\n<p>  <\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c: \u0443\u0434\u0430\u043b\u044f\u0442\u044c, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 <code>Bean<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public class Element implements Serializable{     private Integer id = 0;     private String name = &quot;&quot;;     private Float price = 0.0F;      \/\/ getter and setter for property }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">BeanItemContainer&lt;Element&gt; container = new BeanItemContainer&lt;&gt;(Element.class);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u0430\u043b\u044c\u0448\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 UI \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>setContainerDataSource(...)<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <code>Element<\/code> \u0438\u0437 <code>ResultSet<\/code> \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code>public Element(ResutlSet rs){     try {         id = rs.getInt(&quot;id&quot;);     }catch(SqlException e){         id = 0;          e.printStackTrace();     }      try {         name = rs.getString(&quot;name&quot;);     }catch(SqlException e){         name = &quot;&quot;;         e.printStackTrace();     }      try {         price = rs.getFloat(&quot;price&quot;);     }catch(SqlException e){          price = 0.0f;         e.printStackTrace();     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0442\u0443\u0442 \u043d\u0430 \u043c\u0435\u043d\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0433\u043d\u0435\u0432\u043d\u044b\u0435 \u0432\u0437\u0433\u043b\u044f\u0434\u044b \u0433\u0443\u0440\u0443 Java \u0438 \u043a\u0430\u0440\u043c\u0430 \u043f\u043e\u043b\u0435\u0442\u0435\u0442\u044c \u0432 \u043c\u0438\u043d\u0443\u0441\u044b.<br \/>  \u041d\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f: \u0435\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <code>ResultSet<\/code> \u043f\u043e\u043b\u0435 \u0432\u044b\u0437\u0432\u0430\u043b\u043e \u043e\u0448\u0438\u0431\u043a\u0443, \u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u0441 <code>Exception<\/code> \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043e\u0448\u0438\u0431\u043e\u043a (\u0437\u0430\u043f\u0438\u0441\u044c \u043b\u043e\u0433\u043e\u0432 \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043c\u0430 \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438).<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0443\u0436\u0430\u0441\u043d\u044b\u0439, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 <a href=\"https:\/\/www.amazon.com\/Clean-Code-Handbook-Software-Craftsmanship\/dp\/0132350882\">\u043a\u043d\u0438\u0433\u0438<\/a> \u0434\u044f\u0434\u044e\u0448\u043a\u0438 \u0411\u043e\u0431\u0430, \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0438\u043c\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <code>ResultSet<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"realizaciya\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"https:\/\/ru.wikipedia.org\/wiki\/\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440_(\u0448\u0430\u0431\u043b\u043e\u043d_\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f)\">\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440<\/a> \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/sah4ez\/exdb\">Executor<\/a>.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b <code>ResultSet<\/code>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public Integer getInt(String columnName) {         Integer i = 0;         try {             i = rs.getInt(columnName);         } catch (SQLException ignored) {         }         return i;     }   public Integer getIntNull(String columnName) {         Integer i = 0;         try {             i = rs.getInt(columnName);             if (rs.wasNull())                 return null;         } catch (SQLException ignored) {         }         return i;     }      public String getString(String columnName) {         String s = &quot;&quot;;         try {             s = rs.getString(columnName);             if (s == null)                 return &quot;&quot;;         } catch (SQLException ignored) {         }         return s;     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c 100% \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u0435\u0437 <code>Exception<\/code> \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 Vaadin \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u0443\u0433\u0430\u044e\u0449\u0435. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/406\/b0d\/b81\/406b0db81bc84ae9946170ea51a26044.png\" alt=\"\u0418 \u044d\u0442\u043e \u0432 \u043e\u043a\u043e\u0448\u043a\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d <code>Exception<\/code>, \u043e\u0442\u0432\u0435\u0442: \u0432 \u043f\u043b\u0430\u043d\u0430\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f <code>Executor<\/code> \u0441 \u0442\u0438\u043f\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e <code>Exception<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>SqlExecption<\/code> \u043d\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u0435\u043d, \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f API \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public Executor(ResultSet rs, Class exceptionClass){     this.rs = rs;     this.exceptionClass = exceptionClass; }  public Integer getIntThrow(String columnName) {         Integer i = 0;         try {             i = rs.getInt(columnName);             if (rs.wasNull())                 return null;         } catch (SQLException ex) {             throw (RuntimeExceptoion) exceptionClass.newInstance();         }         return i;     }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public Element(ResutlSet rs){     Executor ex = new Executor(rs, CreateElementException.class);     id = ex.getIntThrow(&quot;id&quot;);     name = ex.getStringThrow(&quot;name&quot;);     price = ex.getFloatThrow(&quot;price&quot;); }  private class CreateElementException extends RuntimeException{     private String message = &quot;&quot;;     public CreateElementException(String message){         this.message = message;     }      @Override     public String getMessage(){         return &quot;Exception with access to column with name &quot; + this.message;     } }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"primery-ispolzovaniya\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <code>Element<\/code> \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">public Element(ResutlSet rs){     Executor ex = new Executor(rs);     id = ex.getInt(&quot;id&quot;);     name = ex.getString(&quot;name&quot;);     price = ex.getFloat(&quot;price&quot;); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043a\u043e\u0434\u0430 \u0441\u0442\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435.<\/li>\n<li>\u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b, \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. <\/li>\n<li>\u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0438 \u043c\u0435\u0441\u0442\u0430 \u0434\u043b\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435.<\/li>\n<li>\u043f\u0440\u043e\u0449\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b.<\/li>\n<li>\u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u043d \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 <del>\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u0436\u0435 \u0443\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c<\/del>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0411\u0414. \u041b\u044e\u0434\u0438 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/sah4ez\/exdb\">GitHub<\/a>. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f <del>\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430<\/del> \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0439.<\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318740\/\"> https:\/\/habrahabr.ru\/post\/318740\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4ca\/ad2\/706\/4caad27066b24be4a041522ae39cf9e4.png\" alt=\"\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 <del>\u043a\u0440\u043e\u0432\u0430\u0432\u044b\u043c \u044d\u043d\u0442\u0435\u0440\u043f\u0440\u0430\u0439\u0437\u043e\u043c<\/del> \u043d\u0435 \u0440\u0430\u0437 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u044d\u0442\u0438\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043c\u044b. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u0444\u0438\u043d\u0441\u043a\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Vaadin \u0438 \u0447\u0438\u0441\u0442\u044b\u043c JDBC \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043b\u043e\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u0435\u0437 \u043e\u043f\u044b\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JDBC \u043c\u044b \u043d\u0430\u0433\u043e\u0440\u043e\u0434\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043b\u043e\u0439 \u0441\u043f\u0430\u0433\u0435\u0442\u0442\u0438 \u043a\u043e\u0434\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0431\u043b\u0435\u0441\u0442\u043d\u043e \u0441 \u043d\u0438\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>  <\/p>\n<p>\u041e \u0442\u043e\u043c \u043a\u0430\u043a \u043c\u044b \u0441 \u044d\u0442\u0438\u043c \u0431\u043e\u0440\u043e\u043b\u0438\u0441\u044c \u0438 \u043a\u0430\u043a\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438\u0437\u043e\u0431\u0440\u0435\u043b\u0438 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283246","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283246"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283246\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}