{"id":65,"date":"2010-01-12T00:31:59","date_gmt":"2010-01-12T05:31:59","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/daws\/?p=65"},"modified":"2010-01-12T02:57:18","modified_gmt":"2010-01-12T07:57:18","slug":"uso-de-hibernate-en-una-aplicacion-web","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/daws\/2010\/01\/12\/uso-de-hibernate-en-una-aplicacion-web\/","title":{"rendered":"Uso de Hibernate en una Aplicaci\u00f3n Web"},"content":{"rendered":"<p class=\"MsoNormal\" style=\"text-align: justify\"><!--[if gte mso 9]&gt;    &lt;![endif]--><!--[if gte mso 9]&gt;  Normal 0   21   false false false  ES-EC X-NONE X-NONE                           &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!--  \/* Font Definitions *\/  @font-face \t{font-family:\"Cambria Math\"; \tpanose-1:2 4 5 3 5 4 6 3 2 4; \tmso-font-charset:0; \tmso-generic-font-family:roman; \tmso-font-pitch:variable; \tmso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face \t{font-family:Calibri; \tpanose-1:2 15 5 2 2 2 4 3 2 4; \tmso-font-charset:0; \tmso-generic-font-family:swiss; \tmso-font-pitch:variable; \tmso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face \t{font-family:\"Book Antiqua\"; \tpanose-1:2 4 6 2 5 3 5 3 3 4; \tmso-font-charset:0; \tmso-generic-font-family:roman; \tmso-font-pitch:variable; \tmso-font-signature:647 0 0 0 159 0;}  \/* Style Definitions *\/  p.MsoNormal, li.MsoNormal, div.MsoNormal \t{mso-style-unhide:no; \tmso-style-qformat:yes; \tmso-style-parent:\"\"; \tmargin-top:0cm; \tmargin-right:0cm; \tmargin-bottom:10.0pt; \tmargin-left:0cm; \tline-height:115%; \tmso-pagination:widow-orphan; \tfont-size:11.0pt; \tfont-family:\"Calibri\",\"sans-serif\"; \tmso-fareast-font-family:Calibri; \tmso-bidi-font-family:\"Times New Roman\"; \tmso-ansi-language:ES; \tmso-fareast-language:EN-US;} h1 \t{mso-style-priority:9; \tmso-style-unhide:no; \tmso-style-qformat:yes; \tmso-style-link:\"T\u00edtulo 1 Car\"; \tmso-style-next:Normal; \tmargin-top:24.0pt; \tmargin-right:0cm; \tmargin-bottom:0cm; \tmargin-left:0cm; \tmargin-bottom:.0001pt; \tline-height:115%; \tmso-pagination:widow-orphan lines-together; \tpage-break-after:avoid; \tmso-outline-level:1; \tfont-size:14.0pt; \tfont-family:\"Cambria\",\"serif\"; \tmso-ascii-font-family:Cambria; \tmso-ascii-theme-font:major-latin; \tmso-fareast-font-family:\"Times New Roman\"; \tmso-fareast-theme-font:major-fareast; \tmso-hansi-font-family:Cambria; \tmso-hansi-theme-font:major-latin; \tmso-bidi-font-family:\"Times New Roman\"; \tmso-bidi-theme-font:major-bidi; \tcolor:#365F91; \tmso-themecolor:accent1; \tmso-themeshade:191; \tmso-font-kerning:0pt; \tmso-ansi-language:ES; \tmso-fareast-language:EN-US;} span.Ttulo1Car \t{mso-style-name:\"T\u00edtulo 1 Car\"; \tmso-style-priority:9; \tmso-style-unhide:no; \tmso-style-locked:yes; \tmso-style-link:\"T\u00edtulo 1\"; \tmso-ansi-font-size:14.0pt; \tmso-bidi-font-size:14.0pt; \tfont-family:\"Cambria\",\"serif\"; \tmso-ascii-font-family:Cambria; \tmso-ascii-theme-font:major-latin; \tmso-fareast-font-family:\"Times New Roman\"; \tmso-fareast-theme-font:major-fareast; \tmso-hansi-font-family:Cambria; \tmso-hansi-theme-font:major-latin; \tmso-bidi-font-family:\"Times New Roman\"; \tmso-bidi-theme-font:major-bidi; \tcolor:#365F91; \tmso-themecolor:accent1; \tmso-themeshade:191; \tmso-ansi-language:ES; \tmso-fareast-language:EN-US; \tfont-weight:bold;} .MsoChpDefault \t{mso-style-type:export-only; \tmso-default-props:yes; \tfont-size:10.0pt; \tmso-ansi-font-size:10.0pt; \tmso-bidi-font-size:10.0pt; \tmso-ascii-font-family:Calibri; \tmso-fareast-font-family:Calibri; \tmso-hansi-font-family:Calibri;} @page Section1 \t{size:612.0pt 792.0pt; \tmargin:70.85pt 3.0cm 70.85pt 3.0cm; \tmso-header-margin:36.0pt; \tmso-footer-margin:36.0pt; \tmso-paper-source:0;} div.Section1 \t{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   \/* Style Definitions *\/  table.MsoNormalTable \t{mso-style-name:\"Tabla normal\"; \tmso-tstyle-rowband-size:0; \tmso-tstyle-colband-size:0; \tmso-style-noshow:yes; \tmso-style-priority:99; \tmso-style-qformat:yes; \tmso-style-parent:\"\"; \tmso-padding-alt:0cm 5.4pt 0cm 5.4pt; \tmso-para-margin:0cm; \tmso-para-margin-bottom:.0001pt; \tmso-pagination:widow-orphan; \tfont-size:11.0pt; \tfont-family:\"Calibri\",\"sans-serif\"; \tmso-ascii-font-family:Calibri; \tmso-ascii-theme-font:minor-latin; \tmso-fareast-font-family:\"Times New Roman\"; \tmso-fareast-theme-font:minor-fareast; \tmso-hansi-font-family:Calibri; \tmso-hansi-theme-font:minor-latin; \tmso-bidi-font-family:\"Times New Roman\"; \tmso-bidi-theme-font:minor-bidi;} --> <!--[endif]--><a name=\"_Toc251017709\"><\/a><span style=\"font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\">Creamos una aplicaci\u00f3n web en Netbeans<span> <\/span> 6.7.1. Luego al establecer el servidor escogemos Apache Tomcat 6.0.18. Despu\u00e9s seleccionamos la casilla de Hibernate 3.2.5.<\/span><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify\"><span style=\"font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\">\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div id='gallery-1' class='gallery galleryid-65 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/blog.espol.edu.ec\/daws\/2010\/01\/12\/uso-de-hibernate-en-una-aplicacion-web\/hibernate-newwebapp1\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/blog.espol.edu.ec\/daws\/files\/2010\/01\/hibernate-newwebapp1-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/dt><\/dl>\n\t\t\t<br style='clear: both' \/>\n\t\t<\/div>\n<br \/>\n<\/span><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify\"><span style=\"font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\">Despu\u00e9s escogemos Finalizar.<\/span><\/p>\n<p><!--[if gte mso 9]&gt;    &lt;![endif]--><!--[if gte mso 9]&gt;  Normal 0   21   false false false  ES-EC X-NONE X-NONE                           &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify\"><span style=\"font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\">Al crear un nuevo proyecto que utiliza el marco de hibernaci\u00f3n, el IDE crea autom\u00e1ticamente el fichero de configuraci\u00f3n<\/span> <tt><span style=\"font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\">hibernate.cfg.xml<\/span><\/tt><tt><span style=\"font-size: 10pt;font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\">.<\/span><\/tt><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify\">Despu\u00e9s de escoger <tt>hibernate.current_session_context_class y valor thread nos aparece el siguiente archivo XML el cual debe ser modificado de acuerdo a nuestra Base de Datos.<\/tt><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify\">\n<pre>&lt;hibernate-configuration&gt;\r\n    &lt;session-factory name=\"session1\"&gt;\r\n        &lt;property name=\"hibernate.dialect\"&gt;org.hibernate.dialect.MySQLDialect&lt;\/property&gt;\r\n        &lt;property name=\"hibernate.connection.driver_class\"&gt;com.mysql.jdbc.Driver&lt;\/property&gt;\r\n        &lt;property name=\"hibernate.connection.url\"&gt;jdbc:mysql:\/\/localhost:3306\/sakila&lt;\/property&gt;\r\n        &lt;property name=\"hibernate.connection.username\"&gt;root&lt;\/property&gt;\r\n        &lt;property name=\"hibernate.connection.password\"&gt;######&lt;\/property&gt;\r\n        &lt;property name=\"hibernate.show_sql\"&gt;true&lt;\/property&gt;\r\n        &lt;property name=\"hibernate.current_session_context_class\"&gt;thread&lt;\/property&gt;\r\n    &lt;\/session-factory&gt;\r\n&lt;\/hibernate-configuration&gt;<\/pre>\n<p class=\"MsoNormal\" style=\"text-align: justify\"><span style=\"font-size: 10pt;font-family: &quot;Book Antiqua&quot;,&quot;serif&amp;quot\" lang=\"ES\"><br \/>\n<\/span><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify\"><img decoding=\"async\" src=\"\/Users\/Juan\/AppData\/Local\/Temp\/moz-screenshot.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creamos una aplicaci\u00f3n web en Netbeans 6.7.1. Luego al establecer el servidor escogemos Apache Tomcat 6.0.18. Despu\u00e9s seleccionamos la casilla de Hibernate 3.2.5. Despu\u00e9s escogemos Finalizar. Al crear un nuevo proyecto que utiliza el marco de hibernaci\u00f3n, el IDE crea autom\u00e1ticamente el fichero de configuraci\u00f3n hibernate.cfg.xml. Despu\u00e9s de escoger hibernate.current_session_context_class y valor thread nos aparece [&hellip;]<\/p>\n","protected":false},"author":53,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":10,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":69,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/posts\/65\/revisions\/69"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/daws\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}