<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1228941379734830724</id><updated>2024-11-08T10:40:43.436-05:00</updated><category term="netbeans 6"/><category term="java"/><category term="mysql"/><category term="netbeans"/><category term="instalar tomcat"/><category term="trucos java"/><category term="jsp session"/><category term="netbeans en linux"/><category term="sesion en jsp"/><category term="session manager"/><category term="sqlyog"/><category term="sqlyog en ubuntu"/><category term="tomcat"/><category term="trucos netbeans"/><category term="ubuntu"/><category term="variables de sesion en jsp"/><title type='text'>Learning JSP</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-8497296697404277462</id><published>2011-01-03T17:06:00.000-05:00</published><updated>2011-01-12T11:08:58.809-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jsp session"/><category scheme="http://www.blogger.com/atom/ns#" term="sesion en jsp"/><category scheme="http://www.blogger.com/atom/ns#" term="session manager"/><category scheme="http://www.blogger.com/atom/ns#" term="variables de sesion en jsp"/><title type='text'>Como usar las variables de sesión</title><content type='html'>El uso de las sesiones en JSP es muy útil para manejo de variables por conexión, es decir por cada usuario conectado por medio de un navegador (Firefox, Chrome, IExplorer, otros) al servidor JSP (Tomcar, JBoss, otros), se pueden utilizar una sesión con variables que solo serán accesibles desde la misma.&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;En general una sesión puede tener los siguientes estados, abierta o cerrada. Para el uso en JSP, siempre que un usuario se conecta al servidor se crea una conexión. De manera que si deseamos administrar estas sesiones debemos hacer uso del objet &lt;i&gt;session &lt;/i&gt;que JSP utiliza para el manejo de sesiones.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Para entender el uso de este objeto realizaremos el siguiente ejemplo:&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Abrimos Netbeans 6.x y creamos un nuevo proyecto web, con el nombre &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;testSession&lt;/span&gt;&lt;/div&gt;&lt;div&gt;2. Agregamos tres páginas jsp con los nombres, &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;setAttribute.jsp&lt;/span&gt;, &lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;getAttribute.jsp&lt;/span&gt;, &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;invalidate.jsp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;3. la pagina &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;index.jsp&lt;/span&gt; en el cuerpo pegamos el siguiente código:&lt;/div&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;form method=&quot;get&quot; target=&quot;sessionJsp&quot; action=&quot;setAttribute.jsp&quot;&amp;gt;&lt;br /&gt;&amp;lt;label&amp;gt;Value&lt;br /&gt;&amp;lt;input type=&quot;text&quot; name=&quot;value&quot;&amp;gt;&lt;br /&gt;&amp;lt;/label&amp;gt;&lt;br /&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;setAttribute()&quot;&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;a href=&quot;getAttribute.jsp&quot; target=&quot;sessionJsp&quot;&amp;gt;getAttribute&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;a href=&quot;invalidate.jsp&quot; target=&quot;sessionJsp&quot;&amp;gt;invalidate&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;iframe name=&quot;sessionJsp&quot; width=&quot;100%&quot;&amp;gt;&lt;br /&gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;4. En la página &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;setAttribute.jsp&lt;/span&gt; crearemos una variable en sesión. Utilizando el código acontinuación:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;session.setAttribute(&quot;value&quot;, request.getParameter(&quot;value&quot;));&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h3&amp;gt;session.setAttribute(&quot;value&quot;,&amp;lt;%=session.getAttribute(&quot;value&quot;)%&amp;gt;)&amp;lt;/h3&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;en la segunda línea de código podemos ver que inmediatamente estamos obteniendo la variable que creamos, pero para ser mas claro con el ejemplo en la página &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;getAttribute&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.jsp&lt;/span&gt; realizaremos esta misma operación, para lo cual utilizaremos el siguiente código:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;h3&amp;gt;value = &amp;lt;%=session.getAttribute(&quot;value&quot;)%&amp;gt;&amp;lt;/h3&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;5. para finalizar el uso de variables, vamos a eliminar todas las variables de sesión en la página &lt;span style=&quot;font-weight: bold;&quot;&gt;invalidate.jsp&lt;/span&gt;, utilizaremos el siguiente código:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;%session.invalidate(); %&amp;gt;&lt;br /&gt;&amp;lt;h3&amp;gt;session.invalidate()&amp;lt;/h3&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Ahora para terminar podemos ejecutar la aplicación y se debe ver así:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGcA3B-LMjfHaGwjZfqKJuRIRKHZk5A1hdhvKp3Jg9KYGl7zB7HUYc3v9KjTYLI9c4PKIDhWV29Lq_8jrLUKbcs2PCzlLO1hlPrqIQ57XM4L_Yx8NHAOj1dM90iF1qU3UTa_K_7oZ1Tzo/s1600/Pantallazo.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 225px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGcA3B-LMjfHaGwjZfqKJuRIRKHZk5A1hdhvKp3Jg9KYGl7zB7HUYc3v9KjTYLI9c4PKIDhWV29Lq_8jrLUKbcs2PCzlLO1hlPrqIQ57XM4L_Yx8NHAOj1dM90iF1qU3UTa_K_7oZ1Tzo/s400/Pantallazo.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5561128882127157474&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;para probar la funcionalidad de las variables se debe colocar un valor dentro del campo de texto y dar click en el botón setAttribute(), Luego veremos un mensaje en el iframe de abajo, y podremos probar el método getAttribute y invalidate con los enlaces respectivos en la página.&lt;br /&gt;&lt;br /&gt;espero que este ejemplo les ayude mucho a entender en principio el uso de las variables de sesión, si necesitan aclarar cualquier duda, por favor dejen sus comentarios&lt;br /&gt;&lt;div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/8497296697404277462/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2011/01/como-usar-las-variables-de-sesion.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/8497296697404277462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/8497296697404277462'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2011/01/como-usar-las-variables-de-sesion.html' title='Como usar las variables de sesión'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGcA3B-LMjfHaGwjZfqKJuRIRKHZk5A1hdhvKp3Jg9KYGl7zB7HUYc3v9KjTYLI9c4PKIDhWV29Lq_8jrLUKbcs2PCzlLO1hlPrqIQ57XM4L_Yx8NHAOj1dM90iF1qU3UTa_K_7oZ1Tzo/s72-c/Pantallazo.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-4568167130420117309</id><published>2010-07-19T11:42:00.000-05:00</published><updated>2010-07-19T11:46:19.875-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="instalar tomcat"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 6"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans en linux"/><title type='text'>Como instalar Netbeans 6.x en Ubuntu (Linux)</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/7v1f7sKCChQ&amp;amp;hl=es_ES&amp;amp;fs=1?border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/7v1f7sKCChQ&amp;amp;hl=es_ES&amp;amp;fs=1?border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/goTkf1Yf6ec&amp;amp;hl=es_ES&amp;amp;fs=1?border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/goTkf1Yf6ec&amp;amp;hl=es_ES&amp;amp;fs=1?border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;Espero sus comentarios...&lt;br /&gt;&lt;br /&gt;si quieren ver como hacer para otras distribuciones Linux, envien sus sugerencias a jorge.alopeza@gmail.com</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/4568167130420117309/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2010/07/como-instalar-netbeans-6x-en-ubuntu.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/4568167130420117309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/4568167130420117309'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2010/07/como-instalar-netbeans-6x-en-ubuntu.html' title='Como instalar Netbeans 6.x en Ubuntu (Linux)'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-4595432182422159111</id><published>2010-07-13T15:27:00.000-05:00</published><updated>2010-07-13T15:30:34.329-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 6"/><category scheme="http://www.blogger.com/atom/ns#" term="trucos java"/><category scheme="http://www.blogger.com/atom/ns#" term="trucos netbeans"/><title type='text'>Como conectarse a MySql desde Netbeans 6.9</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/v2K-kdWMdw4&amp;amp;hl=es_ES&amp;amp;fs=1?border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/v2K-kdWMdw4&amp;amp;hl=es_ES&amp;amp;fs=1?border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;Esta configuración funciona con versiones anteriores...&lt;br /&gt;pronto le agrego anotaciones para explicar mejor el proceso, pero si lo ponen en pantalla completa y HD se ve en detalle todo el proceso.&lt;br /&gt;&lt;br /&gt;espero sus comentarios</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/4595432182422159111/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2010/07/como-conectarse-mysql-desde-netbeans-69.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/4595432182422159111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/4595432182422159111'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2010/07/como-conectarse-mysql-desde-netbeans-69.html' title='Como conectarse a MySql desde Netbeans 6.9'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-930569341365893560</id><published>2010-06-24T14:34:00.000-05:00</published><updated>2010-06-24T14:36:20.389-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 6"/><category scheme="http://www.blogger.com/atom/ns#" term="trucos java"/><title type='text'>Netbeans: Como generar Codigo Automático en clases Java</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/K-K0zfaDDnY&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/K-K0zfaDDnY&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/930569341365893560/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2010/06/netbeans-como-generar-codigo-automatico.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/930569341365893560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/930569341365893560'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2010/06/netbeans-como-generar-codigo-automatico.html' title='Netbeans: Como generar Codigo Automático en clases Java'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-7633585941571900528</id><published>2010-06-19T14:21:00.000-05:00</published><updated>2010-06-24T23:48:24.885-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans 6"/><title type='text'>Como conectar JSP a MySql</title><content type='html'>En esta ocasión veremos como hacer una conexión muy sencilla a MySql.&lt;br /&gt;&lt;br /&gt;Objetivo:&lt;br /&gt;Crear una conexión a MySql, y hacer una consulta rápida.&lt;br /&gt;&lt;br /&gt;Pasos:&lt;br /&gt;1. Instalar MySql videotutorial (&lt;a href=&quot;http://learningjsp.blogspot.com/2010/06/como-instalar-netbeans-tomcat-mysql-en.html&quot;&gt;en Windows&lt;/a&gt;)(en Linux)&lt;br /&gt;&lt;br /&gt;2. Crear un proyecto en Netbeans (&lt;a href=&quot;http://learningjsp.blogspot.com/p/hola-mundo-jsp.html&quot;&gt;hola mundo jsp&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;3. en la pagina index.jsp vamos a incluir el siguiente codigo&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(143, 188, 143);&quot;&gt;&lt;%@ page import=&quot;java.sql.*&quot; %&gt;&lt;br /&gt;&lt;% &lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;//variables para realizar la conexión a la base de datos  &lt;/span&gt;&lt;br /&gt;String user = &quot;root&quot;;&lt;br /&gt;String password = &quot;admin&quot;;&lt;br /&gt;String host = &quot;localhost&quot;;&lt;br /&gt;String db = &quot;mysql&quot;;&lt;br /&gt;String url = &quot;jdbc:mysql://&quot;+host+&quot;/&quot;+db;&lt;br /&gt;Connection conn = &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;Statement statement = &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;ResultSet rs = &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;try&lt;/span&gt;{&lt;br /&gt;&lt;br /&gt;Class.forName(&quot;com.mysql.jdbc.Driver&quot;).newInstance  ();&lt;br /&gt;conn = DriverManager.getConnection(url, user, password);&lt;br /&gt;statement = conn.createStatement();&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;//inmediatamente hacemos una consulta sencilla&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;//creamos la consulta&lt;/span&gt;&lt;br /&gt;rs = statement.executeQuery(&quot;SELECT * FROM user&quot;);&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;//leemos la consulta&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;while&lt;/span&gt;(rs.next()) {&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;//mostramos los resultados obtenidos&lt;/span&gt;&lt;br /&gt;out.println(rs.getString(&quot;user&quot;));&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;//cerramos la conexión&lt;/span&gt;&lt;br /&gt;rs.close();&lt;br /&gt;}&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;catch&lt;/span&gt;(SQLException error) {&lt;br /&gt;out.print(&quot;Error de Conexión : &quot;+error.toString());&lt;br /&gt;} %&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;4.&lt;div id=&quot;paso4&quot;&gt;&lt;/div&gt; Antes de probar el codigo debemos incluir la librería de conexión MySql&lt;br /&gt;en la pestaña &quot;Projects&quot; a la izquierda de Netbeans, desplegamos el proyecto en Libraries damos click-derecho y en el menú click en Add Library&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaDjn2zRgU9JCx9PBow6IVtFhlTh0ALIT350EuMC4rXicK1IhOInV88_bX_9yixj7H5waEVRPlNTmDA6w-U7hQ_FpCUJ0nnTXe4XYLbXXaVFoLvaH2turioO21buy8LoIdtZ_XaCqe6go/s1600/mysql+paso1.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 221px; height: 188px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaDjn2zRgU9JCx9PBow6IVtFhlTh0ALIT350EuMC4rXicK1IhOInV88_bX_9yixj7H5waEVRPlNTmDA6w-U7hQ_FpCUJ0nnTXe4XYLbXXaVFoLvaH2turioO21buy8LoIdtZ_XaCqe6go/s320/mysql+paso1.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5485242201589269938&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8deycIJrsXdi_7chBLOx2ZJAL7q9np71T1iZ9fZ7OkvmL8DTmkFLqNis8ZkaWKVMNgT_GERnMeb1gWZKJkNoBGHpOktVoFo25zREigsL2I4jTZQGRy_C_j1tdzWKohbsRpLCsGk4Idp4/s320/mysql+paso1.png&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;ahora en la ventana emergente buscamos MySQL JDBC Driver, y la agregamos al proyecto&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHiSLXuf21kaQ-mZgL0Ibp3IGSCB_aR4YgkZWrvT5UaiPICGyqhnRaFqv22vZ3k3uc_8CMG-ObIvVFqGsIXPKDwU3hD_szXS6dhyphenhyphenHWr65DJQywGY1Lj3eEjSpjcGxGX9tGKU2UPFMy-ek/s1600/mysql+paso2.png&quot;&gt;&lt;img style=&quot;display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 290px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHiSLXuf21kaQ-mZgL0Ibp3IGSCB_aR4YgkZWrvT5UaiPICGyqhnRaFqv22vZ3k3uc_8CMG-ObIvVFqGsIXPKDwU3hD_szXS6dhyphenhyphenHWr65DJQywGY1Lj3eEjSpjcGxGX9tGKU2UPFMy-ek/s320/mysql+paso2.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5485241136604538434&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;5. ahora solo presionamos F6 para ejecutar el proyecto.&lt;br /&gt;&lt;br /&gt;espero le sea de mucha utilidad.&lt;br /&gt;&lt;br /&gt;espero sus comentarios&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;en el próximo veremos como hacerlo con una clase de conexión</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/7633585941571900528/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2010/06/como-conectar-jsp-mysql.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/7633585941571900528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/7633585941571900528'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2010/06/como-conectar-jsp-mysql.html' title='Como conectar JSP a MySql'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaDjn2zRgU9JCx9PBow6IVtFhlTh0ALIT350EuMC4rXicK1IhOInV88_bX_9yixj7H5waEVRPlNTmDA6w-U7hQ_FpCUJ0nnTXe4XYLbXXaVFoLvaH2turioO21buy8LoIdtZ_XaCqe6go/s72-c/mysql+paso1.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-7966172112042818961</id><published>2010-06-18T17:13:00.000-05:00</published><updated>2010-06-24T23:48:54.739-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="instalar tomcat"/><category scheme="http://www.blogger.com/atom/ns#" term="netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="tomcat"/><title type='text'>Como instalar Netbeans + Tomcat + Mysql en Windows</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/MJKoAeIv4Lc&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/MJKoAeIv4Lc&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/IGiq9GxhOyU&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/IGiq9GxhOyU&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/2CckcvgRWgw&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/2CckcvgRWgw&amp;amp;hl=es_ES&amp;amp;fs=1&amp;amp;color1=0x2b405b&amp;amp;color2=0x6b8ab6&amp;amp;border=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;405&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/7966172112042818961/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2010/06/como-instalar-netbeans-tomcat-mysql-en.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/7966172112042818961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/7966172112042818961'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2010/06/como-instalar-netbeans-tomcat-mysql-en.html' title='Como instalar Netbeans + Tomcat + Mysql en Windows'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1228941379734830724.post-1046580086752027197</id><published>2010-05-14T22:10:00.000-05:00</published><updated>2010-06-24T23:49:45.718-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlyog"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlyog en ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Como instalar Sqlyog en Ubuntu 10.04/ How to Install Sqlyog on Ubuntu 10.04</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;object style=&quot;background-image: url(&amp;quot;http://i1.ytimg.com/vi/hxd3xRuirOs/hqdefault.jpg&amp;quot;);&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/hxd3xRuirOs&amp;amp;hl=es_ES&amp;amp;fs=1&quot;&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;embed src=&quot;http://www.youtube.com/v/hxd3xRuirOs&amp;amp;hl=es_ES&amp;amp;fs=1&quot; allowscriptaccess=&quot;never&quot; allowfullscreen=&quot;true&quot; wmode=&quot;transparent&quot; type=&quot;application/x-shockwave-flash&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://learningjsp.blogspot.com/feeds/1046580086752027197/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://learningjsp.blogspot.com/2010/05/como-instalar-sqlyog-en-ubuntu-1004-how.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/1046580086752027197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1228941379734830724/posts/default/1046580086752027197'/><link rel='alternate' type='text/html' href='http://learningjsp.blogspot.com/2010/05/como-instalar-sqlyog-en-ubuntu-1004-how.html' title='Como instalar Sqlyog en Ubuntu 10.04/ How to Install Sqlyog on Ubuntu 10.04'/><author><name>j lopez react</name><uri>http://www.blogger.com/profile/13031689222382965794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>