<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Probando Código &#187; Java</title>
	<atom:link href="http://www.probandocodigo.com/category/java/feed" rel="self" type="application/rss+xml" />
	<link>http://www.probandocodigo.com</link>
	<description></description>
	<lastBuildDate>Sun, 27 Feb 2011 15:39:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Seguridad con llave p&#250;blica y privada en Web Services</title>
		<link>http://www.probandocodigo.com/2011/01/seguridad-con-llave-pblica-y-privada-en-web-services.html</link>
		<comments>http://www.probandocodigo.com/2011/01/seguridad-con-llave-pblica-y-privada-en-web-services.html#comments</comments>
		<pubDate>Fri, 28 Jan 2011 23:08:53 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Seguridad Informatica]]></category>
		<category><![CDATA[Seguridad utilizando llaves publica y privadas.]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2011/01/seguridad-con-llave-pblica-y-privada-en-web-services.html</guid>
		<description><![CDATA[&#160; Una imagen vale más que mil palabras de definición de los certificados digitales y el esquema de seguridad la llave pública y privada para los Web Services, esto forma parte del WSS(Web Service Security) En la anterior imagen, Henry representa el consumidor del Web Service y Mark representa el proveedor del Web Service. Henry [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://www.probandocodigo.com/wp-content/uploads/2011/01/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.probandocodigo.com/wp-content/uploads/2011/01/image_thumb.png" width="450" height="285" /></a></p>
<p align="justify">Una imagen vale más que mil palabras de definición de los certificados digitales y el esquema de seguridad la llave pública y privada para los Web Services, esto forma parte del WSS(Web Service Security)</p>
<p align="justify">En la anterior imagen, Henry representa el consumidor del Web Service y Mark representa el proveedor del Web Service.</p>
<p align="justify">Henry utiliza la llave publica de Mark para encriptar el SOAP Request(el mensaje), y Mark utiliza su propia llave privada para desencriptar el SOAP Request.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2011/01/seguridad-con-llave-pblica-y-privada-en-web-services.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise JavaBeans 3.0, Parte 2</title>
		<link>http://www.probandocodigo.com/2010/11/enterprise-javabeans-3-0-parte-2.html</link>
		<comments>http://www.probandocodigo.com/2010/11/enterprise-javabeans-3-0-parte-2.html#comments</comments>
		<pubDate>Tue, 09 Nov 2010 20:56:05 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[EJB]]></category>
		<category><![CDATA[EJB 3.0]]></category>
		<category><![CDATA[Enterprise JavaBeans 3.0]]></category>
		<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2010/11/enterprise-javabeans-3-0-parte-2.html</guid>
		<description><![CDATA[&#160; &#160; Continuando con los EJB 3.0, a continuación una descripción de cada objeto que lo compone. Entity Beans Representan una entidad de la base de datos. Es decir, que podemos tener toda una base de datos en Entity Beans, y así evitar utilizar código SQL en nuestras aplicaciones. La estructura de un entity bean, [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">&#160;</p>
<p align="justify">&#160;<a href="http://www.probandocodigo.com/wp-content/uploads/2010/11/JavaBeans.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Java Beans" border="0" alt="Java Beans" src="http://www.probandocodigo.com/wp-content/uploads/2010/11/JavaBeans_thumb.jpg" width="290" height="257" /></a></p>
<p align="justify">Continuando con los EJB 3.0, a continuación una descripción de cada objeto que lo compone.</p>
<p align="justify"><b></b></p>
<p align="justify"><b>Entity Beans</b></p>
<p align="justify">Representan una entidad de la base de datos. Es decir, que podemos tener toda una base de datos en Entity Beans, y así evitar utilizar código SQL en nuestras aplicaciones.</p>
<p align="justify">La estructura de un entity bean, no varía mucho a la estructura de un objeto mapeado con hibérnate, ADF y otro semejante, es por eso que realmente no se utiliza mucho.</p>
<p align="justify">El entity bean, provee un lenguaje que se llama EJB QL, el cual se deriva de SQL y es por medio de este lenguaje que se realizan consultas “avanzadas a las bases de datos”. La ventaja de usar un entity bean, es principalmente que en nuestras clases no tendremos código SQL… y cuando necesitemos agregar por ejemplo un nuevo cliente a la tabla clientes, entonces solo creamos un objeto Cliente, y guardamos ese objeto, si necesitamos modificar el nombre del cliente entonces modificamos el atributo del Entity Bean Cliente y lo guardamos, sin necesidad del código SQL o hacer conexiones en todas las clases java.</p>
<p> <span id="more-389"></span>
<p align="justify"><b>Stateless Sessions Beans</b></p>
<p align="justify">Desde el lado del cliente hay varios procesos para los cuales no hay necesidad de guardar estados, entre ellos pueden ser validaciones simples o complejas, consultas de contraseñas de usuarios entre otras cosas.</p>
<p align="justify">Al no guardar los estados de ciertos objetos evitamos sobrecargar el servidor, por lo que al final tendremos una aplicación más robusta.</p>
<p align="justify">El objeto tendrá todos sus métodos disponibles para que cualquier cliente los utilice, imaginemos el caso en el que un usuario necesita comprobar que su contraseña es correcta, a un objeto validador le enviamos la contraseña mas el usuario y como resultados nos retornara si las combinación coincide o no, por lo que realmente no necesitamos guardar el estado de nada porque es una simple validación.</p>
<p align="justify">&#160;</p>
<p align="justify"><b></b></p>
<p align="justify"><b></b></p>
<p align="justify"><b>Stateful Sessions Beans</b></p>
<p align="justify">En la mayoría de las aplicaciones web que desarrollamos guardamos los objetos en sesión, a medida que más clientes ingresan a la aplicación web la sesión crece, llegando en ocasiones a ocupar toda la memoria de un servidor y posteriormente a la caída del servidor. </p>
<p align="justify">En el caso de los sessions beans, esto no varía mucho… la diferencia es que no hay que preocuparse por llenar la memoria del servidor, ya que session bean no utilizados se guardan en el disco duro y cuando necesitan ocuparse de nuevo, se hace mediante un request por lo que en si la memoria del servidor no se llenara, a menos que la cantidad de usuarios conectados crezca exageradamente, pero en ese caso solo se debe aumentar la memoria del servidor.</p>
<p align="justify">De lo que sí es seguro, es que se pierde el riesgo que en una aplicación en la cual la cantidad de usuarios conectados no supera las 100 (por decir un ejemplo) este no se caerá, al contrario de las muchas aplicaciones web en las cuales incluso se cae el servidor porque jamás borro las sesiones o porque hay 10 usuarios conectados.</p>
<p align="justify">&#160;</p>
<p align="justify"><b>Message Driver Beans</b></p>
<p align="justify">Existen ciertas ocasiones, en las cuales podemos enviar una petición y no necesitar una respuesta para continuar, en ese momento podemos ocupar un Message Driver Bean para un documento a imprimir o una reversa de una transacción. </p>
<p align="justify">Del otro lado siempre habrá un escuchador que procesara nuestros mensajes pero que nunca nos responderá, por lo que no consume memoria ni recursos críticos del sistema. En caso de que necesitemos una respuesta, sería más fácil utilizar un session bean(con estado o sin estado).</p>
<p align="justify">&#160;</p>
<p align="justify"><b>Timer Beans</b></p>
<p align="justify">En realidad los Timer Beans no existen propiamente, ya que es algo que se implementa a los Message Driver Beans o Stateless Sessions Beans.</p>
<p align="justify">Al implementarse, estos se convierten en un temporizador y se les puede indicar que una determina acción se vuelva a llamar en un dia concreto o cada cierto tiempo(es parecido al timer en java).</p>
<p align="justify">Los temporizadores son objetos persistentes, lo que significan que deben ser guardados en cualquier parte del servidor de aplicaciones hasta que transcurran. </p>
<p align="justify">&#160;</p>
<p align="center"><b>Resumen</b></p>
<p align="justify">Leyendo y analizando los diferentes tipos de objetos que nos provee Enterprise Java Beans 3.0, podemos pensar para que nos pueda servir cada objeto en determinada arquitectura de un sistema y cuando utilizar Sessions Beans con estado o sin estado, o los Message Driver Beans. Es realmente difícil tratar de hacer ejemplos con ellos, por lo antes de entrar a los ejemplos es mejor tratar de comprender los beneficios que estos nos traen y qué tipo de proyectos se deben implementar.</p>
<p align="justify">&#160;</p>
<p align="justify">Creo que después de leer lo anterior, podemos comprender más claramente el siguiente dibujo:</p>
<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2010/11/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.probandocodigo.com/wp-content/uploads/2010/11/image_thumb2.png" width="372" height="275" /></a></p>
<p align="justify">Podemos ver que el Times Sevice (timer beans) solo puede ser aplicado a los Message Deriver Beans y Stateless Sessions Beans(beans sin estado). Esto es debido a que no se puede pretender guardar el estado por un tiempo prolongado por los recursos del servidor de aplicaciones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2010/11/enterprise-javabeans-3-0-parte-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Una breve introducci&#243;n a Enterprise JavaBeans 3.0</title>
		<link>http://www.probandocodigo.com/2010/11/una-breve-introduccin-a-enterprise-javabeans-3-0.html</link>
		<comments>http://www.probandocodigo.com/2010/11/una-breve-introduccin-a-enterprise-javabeans-3-0.html#comments</comments>
		<pubDate>Mon, 08 Nov 2010 19:17:45 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[EJB]]></category>
		<category><![CDATA[Enterprise JavaBeans 3.0]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Soluciones Empresariales]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2010/11/una-breve-introduccion-a-enterprise-javabeans-3-0.html</guid>
		<description><![CDATA[El objetivo de JAVA EE es la distribución de la lógica de aplicación en una sección de cliente y servidor. Es decir, que habrá un servidor central al cual podrán acceder todos los clientes y desde el cual se podrán administrar los distintos procesos del negocio. Por lo que en pocas, palabras en un servidor [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.probandocodigo.com/wp-content/uploads/2010/11/image.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.probandocodigo.com/wp-content/uploads/2010/11/image_thumb.png" width="457" height="449" /></a> </p>
<p align="justify">El objetivo de JAVA EE es la distribución de la lógica de aplicación en una sección de cliente y servidor. Es decir, que habrá un servidor central al cual podrán acceder todos los clientes y desde el cual se podrán administrar los distintos procesos del negocio.</p>
<p align="justify">Por lo que en pocas, palabras en un servidor solo será de procesos, mientras el otro será donde estarán las interfaces a las que accederán los clientes.</p>
<p align="justify">Entrando en detalle, los&#160; EJB que existen son:</p>
<ul>
<li>
<div align="justify">Session Beans: Estos representan la lógica de aplicación</div>
</li>
<li>
<div align="justify">Message Driver Beans: Contienen también la lógica, pero que se controlan mediante mensajes.</div>
</li>
<li>
<div align="justify">Entity Beans: Representan los datos de una tabla de la base de datos.</div>
</li>
</ul>
<p align="justify">Sessions Beans se dividen en </p>
<ul>
<li>
<div align="justify">Stateful Session Beans </div>
</li>
<li>
<div align="justify">Stateless Session Beans</div>
</li>
</ul>
<p> <span id="more-380"></span>
<p><b>Interfaz local</b></p>
<p align="justify">Una clase bean puede disponer alternativamente también de una interfaz local. Con esta interfaz ofrece sus servicios a otros Sessions Beans que se encuentran en el mismo servidor de aplicaciones.</p>
<p align="justify">Puede tratarse de los mismos métodos, que ya aparecen en la interfaz remota. También es posible un Session Bean que solo tenga una interfaz local.</p>
<p align="justify">Entonces, esto quiere decir que si alguien llama un método en una interfaz local, se trata de un cliente que no se encuentra fuera del servidor de aplicaciones.</p>
<p align="justify">A pesar de todo, el servidor de aplicaciones sigue participando en la llamada y ofrece de nuevo sus funciones, para, por ejemplo, iniciar una sub transacción o simplemente para ocuparse de que la instancia de vean necesaria esté disponible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2010/11/una-breve-introduccin-a-enterprise-javabeans-3-0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java For Ever</title>
		<link>http://www.probandocodigo.com/2010/08/java-for-ever.html</link>
		<comments>http://www.probandocodigo.com/2010/08/java-for-ever.html#comments</comments>
		<pubDate>Tue, 24 Aug 2010 03:27:51 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2010/08/java-for-ever.html</guid>
		<description><![CDATA[&#160; &#160; Buenos videos lo que ha hecho Oracle para el JavaZone 2010.]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:3d2f7591-c9f2-4d81-8bd3-b51c5e9df4d4" class="wlWriterEditableSmartContent">
<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/8Px-GHPxB4I?fs=1&amp;hl=es_ES&amp;hl=en"></param><embed src="http://www.youtube.com/v/8Px-GHPxB4I?fs=1&amp;hl=es_ES&amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"></embed></object></div>
</div>
<p>&#160;</p>
<p>Buenos videos lo que ha hecho Oracle para el JavaZone 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2010/08/java-for-ever.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lady Java</title>
		<link>http://www.probandocodigo.com/2010/08/lady-java.html</link>
		<comments>http://www.probandocodigo.com/2010/08/lady-java.html#comments</comments>
		<pubDate>Tue, 24 Aug 2010 03:18:00 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2010/08/lady-java.html</guid>
		<description><![CDATA[Muy bonito video]]></description>
			<content:encoded><![CDATA[<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:e99769cb-8820-41d3-b6b1-94e3f10f3d18" class="wlWriterEditableSmartContent">
<div><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/1JZnj4eNHXE?fs=1&amp;hl=es_ES&amp;hl=en"></param><embed src="http://www.youtube.com/v/1JZnj4eNHXE?fs=1&amp;hl=es_ES&amp;hl=en" type="application/x-shockwave-flash" width="425" height="355"></embed></object></div>
</div>
<p>Muy bonito video <img src='http://www.probandocodigo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2010/08/lady-java.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizar las concatenaciones del texto en Java</title>
		<link>http://www.probandocodigo.com/2010/07/optimizar-las-concatenaciones-del-texto-en-java.html</link>
		<comments>http://www.probandocodigo.com/2010/07/optimizar-las-concatenaciones-del-texto-en-java.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 16:23:00 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Aprendiendo Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Optimizar]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[StringBuffer]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2010/07/optimizar-las-concatenaciones-del-objeto-string-en-java.html</guid>
		<description><![CDATA[&#160;&#160; Los problemas de perfomance al concatenar con += en vez de ocupar un objeto StringBuffer y utilizar el método append lo podemos observar en la siguiente imagen: Podemos observar que si son 20 líneas, en este caso el uso del += se tarda 745.2 veces más, y entre mas líneas este número crece. Esto [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;<a href="http://www.probandocodigo.com/wp-content/uploads/2010/07/procesoscompu.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="procesos compu" border="0" alt="procesos compu" src="http://www.probandocodigo.com/wp-content/uploads/2010/07/procesoscompu_thumb.png" width="322" height="204" /></a>&#160;</p>
<p align="justify">Los problemas de perfomance al concatenar con += en vez de ocupar un objeto StringBuffer y utilizar el método append lo podemos observar en la siguiente imagen:</p>
<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2010/07/clip_image004.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://www.probandocodigo.com/wp-content/uploads/2010/07/clip_image004_thumb.jpg" width="370" height="25" /></a></p>
<p align="justify">Podemos observar que si son 20 líneas, en este caso el uso del += se tarda 745.2 veces más, y entre mas líneas este número crece.</p>
<p align="justify">Esto se debe a que el objeto String es inmutable, por lo que cada vez que se utilizar la concatenación por medio del += se está añadiendo al Heap.</p>
<p align="justify">Si adicional al usar el StringBuffer, inicializamos con el numero de caracteres que tendrá la cadena (en algunos casos se pueda) podemos mejorar todavía más el perfomance de la aplicación.</p>
<p align="justify">Por Ejemplo -&gt; cadenaDeTexto.setLength(300);</p>
<p>El código para que puedan comprobarlos por ustedes mismos es el siguiente:</p>
<div style="border-bottom: black 1px solid; border-left: black 1px solid; width: 100%; overflow: scroll; border-top: black 1px solid; border-right: black 1px solid">
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff"><span style="color: blue">public</span>&#160;<span style="color: blue">class</span> Main {       </div>
<div style="background-color: #e2ecf6"><span style="color: blue">public</span>&#160;<span style="color: blue">static</span>&#160;<span style="color: blue">void</span> main(String[] args) {       </div>
<div style="background-color: #ffccff">&#160; //Test the String Concatenation <span style="color: blue">using</span> + <span style="color: blue">operator</span>       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">long</span> startTime = System.currentTimeMillis();       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; String result = <span style="color: red">&quot;hello&quot;</span>;       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">for</span>(<span style="color: blue">int</span> i=0;i&lt;1500;i++){       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello3&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello4&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello2&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello3&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello4&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello2&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello3&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello4&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello3&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello4&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello2&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello3&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello4&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello2&quot;</span>;       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello3&quot;</span>;       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result += <span style="color: red">&quot;hello4&quot;</span>;&#160;&#160; </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">long</span> endTime = System.currentTimeMillis();       </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.<span style="color: blue">out</span>.println(<span style="color: red">&quot;Time taken <span style="color: blue">for</span>&#160;<span style="color: blue">string</span> concatenation <span style="color: blue">using</span> += <span style="color: blue">operator</span> : &quot;</span>       </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; + (endTime &#8211; startTime)+ <span style="color: red">&quot; milli seconds&quot;</span>);       </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Test the String Concatenation <span style="color: blue">using</span> StringBuffer       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">long</span> startTime1 = System.currentTimeMillis();       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; StringBuffer result1 = <span style="color: blue">new</span> StringBuffer(<span style="color: red">&quot;hello&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.setLength(300);      </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">for</span>(<span style="color: blue">int</span> i=0;i&lt;1500;i++){       </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello3&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello4&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello2&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello3&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello4&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello2&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello3&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello4&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello3&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello4&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello2&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello3&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello4&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello2&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello3&quot;</span>);       </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; result1.append(<span style="color: red">&quot;hello4&quot;</span>);       </div>
<div style="background-color: #e2ecf6">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">long</span> endTime1 = System.currentTimeMillis();       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.<span style="color: blue">out</span>.println(<span style="color: red">&quot;Time taken <span style="color: blue">for</span>&#160;<span style="color: blue">string</span> concatenation <span style="color: blue">using</span> StringBuffer.append :&#160; &quot;</span>&#160; </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; + (endTime1 &#8211; startTime1)+ <span style="color: red">&quot; milli seconds&quot;</span>);       </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      </div>
<div style="background-color: #e2ecf6"></div>
<div style="background-color: #ffccff">/* (non-Java-doc)      </div>
<div style="background-color: #e2ecf6">* @see java.lang.Object#Object()      </div>
<div style="background-color: #ffccff">*/      </div>
<div style="background-color: #e2ecf6"><span style="color: blue">public</span> Main() {       </div>
<div style="background-color: #ffccff">super();      </div>
<div style="background-color: #e2ecf6">}      </div>
<div style="background-color: #ffccff"></div>
<div style="background-color: #e2ecf6">}</div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2010/07/optimizar-las-concatenaciones-del-texto-en-java.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebSphere Message Broker, Introducción</title>
		<link>http://www.probandocodigo.com/2009/11/websphere-message-broker-introduccin.html</link>
		<comments>http://www.probandocodigo.com/2009/11/websphere-message-broker-introduccin.html#comments</comments>
		<pubDate>Fri, 20 Nov 2009 19:56:30 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Aprendiendo Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Aprendiendo MQ Broker]]></category>
		<category><![CDATA[Broker]]></category>
		<category><![CDATA[Integracion de Aplicaciones]]></category>
		<category><![CDATA[Integracion de sistemas]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[MQ Broker]]></category>
		<category><![CDATA[WebSphere Message Broker]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2009/11/websphere-message-broker-introduccin.html</guid>
		<description><![CDATA[&#160; &#160; &#160; WebSphere Message Broker, una tecnología de IBM que es relativamente nueva para muchos desarrolladores en el habla hispana, inclusive se puede verificar buscando MQ Broker en Bing o google, efectivamente se darán cuenta que no ha sido muy difundido. WebSphere Message Broker es conocido en el entorno laboral como MQ Broker(cuando integra [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">&#160;</p>
<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2009/11/message_broker.gif"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="message_broker" border="0" alt="message_broker" src="http://www.probandocodigo.com/wp-content/uploads/2009/11/message_broker_thumb.gif" width="538" height="198" /></a>&#160;</p>
<p align="justify">&#160; WebSphere Message Broker, una tecnología de IBM que es relativamente nueva para muchos desarrolladores en el habla hispana, inclusive se puede verificar buscando MQ Broker en Bing o google, efectivamente se darán cuenta que no ha sido muy difundido.</p>
<p align="justify">WebSphere Message Broker es conocido en el entorno laboral como MQ Broker(cuando integra MQ) o únicamente Broker, la función de este es incrementar la agilidad del negocio y optimizar los costos haciendo la integración de aplicaciones fácil.</p>
<p align="justify">Para explicar exactamente que hace pondré el siguiente ejemplo:</p>
<p align="justify">Existe una empresa multinacional, donde el equipo de IT es tan grande que está dividido incluso en los lenguajes que estos utilizan para el desarrollo de software.</p>
<p align="justify">El grupo 1 utiliza .Net</p>
<p align="justify">El grupo 2 utiliza Java</p>
<p align="justify">El grupo 3 utiliza AS400 (RPG)</p>
<p align="justify">Con el paso del tiempo cada grupo ha desarrollado una cantidad inimaginable de servicios y sistemas en cada herramienta, pero llega el día en el que un nuevo gerente de ventas desee que en un determinado sistema que está programado en java se utilicen servicios o se realicen procesos que ya están funcionando correctamente en el grupo 1 y grupo 3, los cuales utilizan .Net y AS400 (RPG) respectivamente.</p>
<p align="justify">A este punto seria costoso desarrollar un proceso que ya esta funcional en RPG o en .Net para crear un MashUp en una aplicación por lo que la forma más sencilla seria realizar una integración entre los tres grupos por medio de <strong>Enterprise Services Bus (ESB)</strong>, en este caso utilizaremos Broker.</p>
<p> <span id="more-282"></span>
<p align="justify">Preguntas comunes, </p>
<p align="justify">Por medio de que nos comunicamos con otra aplicación?</p>
<p align="justify">Por medio de mensajes, es de ahí el nombre de WebSphere <b>Message</b> Broker, el broker maneja estos mensajes y garantiza que el mensaje sea entregado al solicitante, mientras este mensaje no sea consumido no se elimina.</p>
<p align="justify">Un ejemplo seria, si 500 clientes envían mensajes al Broker desde distintas aplicaciones estos serán respondidos directamente a cada cliente, y si dicho cliente no va a traer el mensaje de respuesta el Broker decide cuanto tiempo espera para poder tenerlo, el tiempo puede ser desde segundos hasta ilimitado lo que garantizaría que el mensaje será respondido al cliente aunque este lo solicite una semana después.</p>
<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2009/11/value_of_mb_on_zos1.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="value_of_mb_on_zos1" border="0" alt="value_of_mb_on_zos1" src="http://www.probandocodigo.com/wp-content/uploads/2009/11/value_of_mb_on_zos1_thumb.jpg" width="446" height="398" /></a> </p>
<p align="justify">Que mas hace el broker para hacer posible la integración?</p>
<p align="justify">El broker además de distribuir los mensajes también los transforma, por ejemplo si un sistema desarrollado en java envía una petición en XML y la aplicación que debe procesar esta información es RPG, entonces el Broker puede transformar el XML en una trama que sea entendible para RPG y así RPG procesa la información, posteriormente envía una trama y el Broker nuevamente la transforma, solo que esta vez la transforma en XML para que el sistema en java pueda convertirla fácilmente en un objeto y utilizar dicha información.</p>
<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2009/11/ab20645a.gif"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ab20645a" border="0" alt="ab20645a" src="http://www.probandocodigo.com/wp-content/uploads/2009/11/ab20645a_thumb.gif" width="346" height="517" /></a> </p>
<p align="justify">*He tratado de explicar lo que es esta tecnología sin usar ningún termino técnico, posteriormente espero estar hablando mas sobre esta tecnología.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2009/11/websphere-message-broker-introduccin.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Formato de fechas en java</title>
		<link>http://www.probandocodigo.com/2009/11/formato-de-fechas-en-java.html</link>
		<comments>http://www.probandocodigo.com/2009/11/formato-de-fechas-en-java.html#comments</comments>
		<pubDate>Mon, 16 Nov 2009 15:58:20 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Aprendiendo Programación]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[fecha]]></category>
		<category><![CDATA[SimpleDateFormat]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2009/11/formato-de-fechas-en-java.html</guid>
		<description><![CDATA[Hace unos cuantos días me pregunte el porqué se dejo de usar el objeto date para convertir fechas, algunos programadores incluso arman las fechas separándolas y luego poniendo el siguiente código: &#160; 1: Date fecha = new Date(); 2: fecha.setDate(16); 3: fecha.setMonth(11); 4: fecha.setYear(2009); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Hace unos cuantos días me pregunte el porqué se dejo de usar el objeto date para convertir fechas, algunos programadores incluso arman las fechas separándolas y luego poniendo el siguiente código: </p>
<p align="justify">&#160; </p>
<div align="left">
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> Date fecha = <span style="color: #0000ff">new</span> Date();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> fecha.setDate(16);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> fecha.setMonth(11);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> fecha.setYear(2009);</pre>
<p><!--CRLF--></div>
</p></div>
</div>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p align="justify">Sin embargo al hacer esto, aparecen advertencias debido a que esos métodos ya están “despreciados” es decir que en las nuevas versiones ya no se utilizan… </p>
<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2009/11/091116092513200x73S1.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="091116-092513-200x73-S" border="0" alt="091116-092513-200x73-S" src="http://www.probandocodigo.com/wp-content/uploads/2009/11/091116092513200x73S_thumb1.jpg" width="204" height="77" /></a> </p>
<p align="justify">Así que como tenía tiempo investigue un poco, y encontré una forma que es más útil que esa y que la mayoría que conozco (si conocen una mejor comentarlaJ) y es la siguiente: </p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> DateFormat formatter = <span style="color: #0000ff">new</span> SimpleDateFormat(<span style="color: #006080">&quot;yyyymmdd&quot;</span>); <span style="color: #008000">//El formato en el que obtenemos la fecha inicialmente</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> Date date = (Date)formatter.parse(<span style="color: #006080">&quot;20091116&quot;</span>); <span style="color: #008000">//Se le pasa la fecha a la que queremos darle formato</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> SimpleDateFormat formato = <span style="color: #0000ff">new</span> SimpleDateFormat(<span style="color: #006080">&quot;MM/dd/yyyy&quot;</span>); <span style="color: #008000">//Formato en que desamos la fecha</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> String fechaConFormato = formato.format(date); //Obtenemos la fecha ya con el formato.</pre>
<p><!--CRLF--></div>
</div>
<p>Si alguien tiene alguna pregunta no dude en comentarla.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2009/11/formato-de-fechas-en-java.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Lista de IDE para java</title>
		<link>http://www.probandocodigo.com/2009/11/lista-de-ide-para-java.html</link>
		<comments>http://www.probandocodigo.com/2009/11/lista-de-ide-para-java.html#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:23:00 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Entorno de Desarrollo Integrado]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Rational]]></category>
		<category><![CDATA[Sun]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2009/11/lista-de-ide-para-java.html</guid>
		<description><![CDATA[A continuación una lista de IDE(Entorno de Desarrollo Integrado) para java: JDeveloper El de oracle, la verdad comparado con NetBeans y Eclipse se siente un poco sencillo, pero es muy poderoso y aunque no es tan rico en funcionalidades sirve para crear prácticamente cualquier proyecto de software, además tiene integrado ADF que es una tecnología [...]]]></description>
			<content:encoded><![CDATA[<p align="justify"><a href="http://www.probandocodigo.com/wp-content/uploads/2009/11/figEclipseWithWhole.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="figEclipseWithWhole" border="0" alt="figEclipseWithWhole" src="http://www.probandocodigo.com/wp-content/uploads/2009/11/figEclipseWithWhole_thumb.png" width="306" height="323" /></a> </p>
<p align="justify">A continuación una lista de IDE(Entorno de Desarrollo Integrado) para java:</p>
<p align="justify"><a href="http://www.oracle.com/technology/jdev/index.html" target="_blank">JDeveloper</a></p>
<p align="justify">El de oracle, la verdad comparado con NetBeans y Eclipse se siente un poco sencillo, pero es muy poderoso y aunque no es tan rico en funcionalidades sirve para crear prácticamente cualquier proyecto de software, además tiene integrado ADF que es una tecnología propia de ORACLE.</p>
<p align="justify"><b><a href="http://www.netbeans.org/" target="_blank">Netbeans</a></b></p>
<p align="justify"><strong>Muy interesante y con muchas funcionalidades de un solo click, web services con un solo click, EJB con un solo click… muy entretenido de usar y contiene una alta variedad de plug in hechos por la comunidad.</strong></p>
<p align="justify"><b><a href="http://www.eclipse.org/" target="_blank">Eclipse</a></b></p>
<p align="justify"><strong>Uno de los mejores ide para java, no por nada es utilizados en Rational de IBM.</strong></p>
<p> <span id="more-207"></span>
<p align="justify"><a href="http://www-01.ibm.com/software/rational/" target="_blank">Rational</a></p>
<p align="justify">Basado en eclipse pero con el poderoso servidor de websphere, uno de los mas usados en empresas de alto nivel que tienen varia tecnología IBM, si quieren utilizarlo pueden bajar el trial o utilizar eclipse.</p>
<p align="justify"><b><a href="http://www.bluej.org/" target="_blank">BlueJ</a></b></p>
<p align="justify"><strong>Para los que empiezan, en teoría te ayuda para la programación orientada a objetos y otras buenas practicas de la programación.</strong></p>
<p align="justify"><strong></strong></p>
<p align="justify">*Si tienen mas que añadir a la lista, no duden en comentarlo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2009/11/lista-de-ide-para-java.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Java EE 6 Preview – Disponible</title>
		<link>http://www.probandocodigo.com/2009/08/java-ee-6-preview-disponible.html</link>
		<comments>http://www.probandocodigo.com/2009/08/java-ee-6-preview-disponible.html#comments</comments>
		<pubDate>Wed, 05 Aug 2009 05:49:36 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[j2se]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Sun]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2009/08/java-ee-6-preview-disponible.html</guid>
		<description><![CDATA[&#160; Para todos los que programamos utilizando J2EE, les comunico que ya esta disponible J2EE 6, el cual pueden descargar desde el siguiente link al igual que las especificaciones. &#160; DESCARGAR ESPECIFICACIONES]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.probandocodigo.com/wp-content/uploads/2009/08/j2ee.jpg"><img title="j2ee" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="331" alt="j2ee" src="http://www.probandocodigo.com/wp-content/uploads/2009/08/j2ee-thumb.jpg" width="277" border="0" /></a>&#160; </p>
<p>Para todos los que programamos utilizando J2EE, les comunico que ya esta disponible J2EE 6, el cual pueden descargar desde el siguiente link al igual que las especificaciones.</p>
<p>&#160;</p>
<p align="center"><a href="http://java.sun.com/javaee/downloads/preview/index.jsp?userOsIndex=6&amp;userOsId=windows&amp;userOsName=Windows" target="_blank">DESCARGAR</a></p>
<p align="center"><a href="http://java.sun.com/javaee/technologies/javaee6.jsp" target="_blank">ESPECIFICACIONES</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2009/08/java-ee-6-preview-disponible.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Añadir Imagen A Un Excel utilizando POI</title>
		<link>http://www.probandocodigo.com/2009/03/aadir-imagen-a-un-excel-utilizando-poi.html</link>
		<comments>http://www.probandocodigo.com/2009/03/aadir-imagen-a-un-excel-utilizando-poi.html#comments</comments>
		<pubDate>Sat, 14 Mar 2009 14:41:00 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Agregar Imagen a Excel utilizando POI]]></category>
		<category><![CDATA[Crear excel en java]]></category>
		<category><![CDATA[Libreria POI]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2009/03/aadir-imagen-a-un-excel-utilizando-poi.html</guid>
		<description><![CDATA[&#160; Antes de todo quiero aclarar los siguientes puntos: No se puede leer una imagen que esta en una dirección web, por ejemplo www.probandocodigo.com/images/hola.jpg, sin embargo si se puede descargar la imagen y luego con el path absoluto acceder a esa imagen, en otras palabras tenemos que leer bit por bit el archivo para poder [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.probandocodigo.com/wp-content/uploads/2009/03/image1.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="125" alt="image" src="http://www.probandocodigo.com/wp-content/uploads/2009/03/image-thumb1.png" width="137" border="0" /></a>&#160;</p>
<p align="justify">Antes de todo quiero aclarar los siguientes puntos:</p>
<p align="justify">No se puede leer una imagen que esta en una dirección web, por ejemplo www.probandocodigo.com/images/hola.jpg, sin embargo si se puede descargar la imagen y luego con el path absoluto acceder a esa imagen, en otras palabras tenemos que leer bit por bit el archivo para poder cargarla en Excel, lo aclaro pues hay varios programadores que creen que pueden acceder a la imagen desde la dirección web.</p>
<p> <span id="more-133"></span>
<p align="justify">Otro punto es que versiones de la POI en la cual no se puede realizar, lamentablemente desconozco desde que versión se puede realizar por lo que les aconsejo que descarguen la ultima versión de POI en la pagina oficial, aunque para los que han utilizado la librería POI para varios reportes, carga de datos entre otras cosas les comento que hay algunas cosas que han cambiado&#8230; mas aun si han estado ocupando la versión de la POI por ahí del 2004 les dará varios problemas, tantos problemas que quizá alguien se de por vencido y prefiera no actualizar la librería.</p>
<p>A continuación el código:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   1:</span> HSSFWorkbook wb = <span style="color: #0000ff">new</span> HSSFWorkbook();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   2:</span>   HSSFPatriarch patriarch = sheet.createDrawingPatriarch();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   3:</span>   HSSFClientAnchor anchor;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   4:</span>   anchor = <span style="color: #0000ff">new</span> HSSFClientAnchor(500,100,600,200,(<span style="color: #0000ff">short</span>)0,0,(<span style="color: #0000ff">short</span>)1,0);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   5:</span>   anchor.setAnchorType( 2 );</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   6:</span>   HSSFPicture picture =  patriarch.createPicture(anchor, loadPicture(files, wb ));</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   7:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">   8:</span>   <span style="color: #008000">//Metodo que permite insertar imagenes a el excel</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">   9:</span>   <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">int</span> loadPicture( File path, HSSFWorkbook wb ) throws IOException</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  10:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  11:</span>     <span style="color: #0000ff">int</span> pictureIndex;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  12:</span>     FileInputStream fis = <span style="color: #0000ff">null</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  13:</span>     ByteArrayOutputStream bos = <span style="color: #0000ff">null</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  14:</span>     <span style="color: #0000ff">try</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  15:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  16:</span>        <span style="color: #008000">// read in the image file</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  17:</span>         fis = <span style="color: #0000ff">new</span> FileInputStream(path);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  18:</span>         bos = <span style="color: #0000ff">new</span> ByteArrayOutputStream( );</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  19:</span>         <span style="color: #0000ff">int</span> c;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  20:</span>        <span style="color: #008000">// copy the image bytes into the ByteArrayOutputStream</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  21:</span>         <span style="color: #0000ff">while</span> ( (c = fis.read()) != -1)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  22:</span>             bos.write( c );</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  23:</span>     </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  24:</span>        <span style="color: #008000">// add the image bytes to the workbook</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  25:</span>         pictureIndex = wb.addPicture(bos.toByteArray(), HSSFWorkbook.PICTURE_TYPE_PNG );</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  26:</span>&#160; </pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  27:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  28:</span>     <span style="color: #0000ff">finally</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  29:</span>     {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  30:</span>         <span style="color: #0000ff">if</span> (fis != <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  31:</span>             fis.close();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  32:</span>         <span style="color: #0000ff">if</span> (bos != <span style="color: #0000ff">null</span>)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  33:</span>             bos.close();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  34:</span>     }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #606060">  35:</span>     <span style="color: #0000ff">return</span> pictureIndex;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #606060">  36:</span>     }</pre>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2009/03/aadir-imagen-a-un-excel-utilizando-poi.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>¿Como llamar a una función PL/SQL desde java?</title>
		<link>http://www.probandocodigo.com/2009/03/como-llamar-a-una-funcin-plsql-desde-java.html</link>
		<comments>http://www.probandocodigo.com/2009/03/como-llamar-a-una-funcin-plsql-desde-java.html#comments</comments>
		<pubDate>Sat, 14 Mar 2009 05:30:00 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Sun]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2009/03/como-llamar-a-una-funcin-plsql-desde-java.html</guid>
		<description><![CDATA[&#160; Aquí les dejo la función para que puedan ocuparla. 1: //Recibe como parámetro un String y retorna un String 2: &#160; 3: private String ExtraerFuncion(String usercode) throws SQLException, Exception, Error{ 4: &#160; 5: String sql = &#34;&#34;, dato=&#34;&#34;; 6: sql = &#34;{? = call FN_RETURN_FUNCION(?)}&#34;; 7: CallableStatement cs = null; 8: &#160; 9: try [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>Aquí les dejo la función para que puedan ocuparla.</p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="rem">//Recibe como parámetro un String y retorna un String</span></pre>
<pre><span class="lnum">   2:  </span>&#160;</pre>
<pre><span class="lnum">   3:  </span>      <span class="kwrd">private</span> String ExtraerFuncion(String usercode) throws SQLException, Exception, Error{</pre>
<pre><span class="lnum">   4:  </span>&#160;</pre>
<pre><span class="lnum">   5:  </span>            String sql = <span class="str">&quot;&quot;</span>, dato=<span class="str">&quot;&quot;</span>;           </pre>
<pre><span class="lnum">   6:  </span>            sql = <span class="str">&quot;{? = call FN_RETURN_FUNCION(?)}&quot;</span>;           </pre>
<pre><span class="lnum">   7:  </span>            CallableStatement cs = <span class="kwrd">null</span>;</pre>
<pre><span class="lnum">   8:  </span>&#160;</pre>
<pre><span class="lnum">   9:  </span>            <span class="kwrd">try</span></pre>
<pre><span class="lnum">  10:  </span>            {</pre>
<pre><span class="lnum">  11:  </span>                cs = sessionManager.getConnection().prepareCall(sql);</pre>
<pre><span class="lnum">  12:  </span>                cs.registerOutParameter(1, Types.VARCHAR);</pre>
<pre><span class="lnum">  13:  </span>                cs.setString(2, usercode);</pre>
<pre><span class="lnum">  14:  </span>                cs.execute();</pre>
<pre><span class="lnum">  15:  </span>                dato = cs.getString(1);</pre>
<pre><span class="lnum">  16:  </span>            }</pre>
<pre><span class="lnum">  17:  </span>            <span class="kwrd">catch</span> (Exception e)</pre>
<pre><span class="lnum">  18:  </span>            {</pre>
<pre><span class="lnum">  19:  </span>                e.printStackTrace();</pre>
<pre><span class="lnum">  20:  </span>            }</pre>
<pre><span class="lnum">  21:  </span>            <span class="kwrd">finally</span></pre>
<pre><span class="lnum">  22:  </span>            {</pre>
<pre><span class="lnum">  23:  </span>                 cs.close();</pre>
<pre><span class="lnum">  24:  </span>            }</pre>
<pre><span class="lnum">  25:  </span>            <span class="kwrd">return</span> dato;</pre>
<pre><span class="lnum">  26:  </span>        }</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2009/03/como-llamar-a-una-funcin-plsql-desde-java.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Novedades en Jdeveloper 11g</title>
		<link>http://www.probandocodigo.com/2008/11/novedades-en-jdeveloper-11g.html</link>
		<comments>http://www.probandocodigo.com/2008/11/novedades-en-jdeveloper-11g.html#comments</comments>
		<pubDate>Sun, 16 Nov 2008 21:24:00 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[entorno de desarrollo]]></category>
		<category><![CDATA[Jdeveloper 11]]></category>
		<category><![CDATA[lo nuevo en jdeveloper 11]]></category>
		<category><![CDATA[Programacion]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2008/11/novedades-en-jdeveloper-11g.html</guid>
		<description><![CDATA[&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Hace un par de días comente que la versión final de jdeveloper 11 salió el octubre pasado, por lo que he decidido darle un vistazo rápido, aunque me faltan muchas cosas nuevas por descubrir, los que dejo a continuación son los primeros que he notado. &#160; Más tecnologías para programar desde el principio, [...]]]></description>
			<content:encoded><![CDATA[<div align="center">
<div class="wlWriterSmartContent" id="scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:1bb47671-2bee-4c58-ad7c-a00d3459d441" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper1118x6.JPG" title="Jdeveloper 11g" rel="thumbnail"><img border="0" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper111.png" /></a></div>
</div>
<div align="justify">&nbsp;</div>
<p align="justify">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hace un par de días comente que la versión final de jdeveloper 11 salió el octubre pasado, por lo que he decidido darle un vistazo rápido, aunque me faltan muchas cosas nuevas por descubrir, los que dejo a continuación son los primeros que he notado.</p>
<p><span id="more-94"></span>
<div align="left">&nbsp;</div>
<div align="left"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper112.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="426" alt="jdeveloper112" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper112_thumb.jpg" width="384" align="left" border="0"></a> </div>
<p align="justify">Más tecnologías para programar desde el principio, como lo pueden notar en la imagen de arriba.
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper113.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="312" alt="jdeveloper113" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper113_thumb.jpg" width="399" align="left" border="0"></a> </div>
<div align="left">&nbsp;</div>
<p align="justify">Pueden ver en la captura de arriba que ahora en una jsp, existen dos tabletas mas, una para un preview de la página y otra llamada bindings (aun no la he explorado)
<p align="justify">&nbsp;
<p align="justify">&nbsp;
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper114.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="275" alt="jdeveloper114" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper114_thumb.jpg" width="407" align="left" border="0"></a> </div>
<div align="left">&nbsp;</div>
<div align="justify">Mas opciones desde los menu, y viendolos pueden notarlo, como por ejemplo task.</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper115.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="241" alt="jdeveloper115" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper115_thumb.jpg" width="284" align="left" border="0"></a> </div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<p align="justify">A partir de esta versión Jdeveloper es ejecutable, lo que para mi mejora notoriamente el performance, además de que el servidor que utiliza por default es WebLogic.
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper116.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="318" alt="jdeveloper116" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper116_thumb.jpg" width="324" align="left" border="0"></a> </div>
<p align="justify">En las versiones anteriores pueden recordar que al eliminar un elemento desde la aplicación, este no lo eliminaba físicamente, a partir de esta versión ya trae consigo esta opción.
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left">&nbsp;</div>
<div align="left"><a href="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper117.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="305" alt="jdeveloper117" src="http://probandocodigo.com/ProbandoCodigo_Images/NovedadesenJdeveloper11g_D837/jdeveloper117_thumb.jpg" width="403" align="left" border="0"></a></div>
<div align="justify">El quick Javadoc (ctrl+D) esta tambien disponible para metodos, por ejemplo en la siguiente imagen vi el javadoc de split, cuando esta buscando la funcion.</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">&nbsp;</div>
<div align="justify">Sabes de otras novedades en Jdeveloper 11g ? compartelas en los comentarios.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2008/11/novedades-en-jdeveloper-11g.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disponible Versión Final De JDeveloper 11</title>
		<link>http://www.probandocodigo.com/2008/10/disponible-versin-final-de-jdeveloper-11.html</link>
		<comments>http://www.probandocodigo.com/2008/10/disponible-versin-final-de-jdeveloper-11.html#comments</comments>
		<pubDate>Wed, 22 Oct 2008 03:27:25 +0000</pubDate>
		<dc:creator>Benjamín Zepeda</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[IDE para java]]></category>
		<category><![CDATA[JDeveloper]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.probandocodigo.com/2008/10/disponible-versin-final-de-jdeveloper-11.html</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Solo quería informarles que la versión definitiva de JDeveloper 11 salió en este mes (actualmente estaba por la release 4) de octubre, por lo que los invito a todos a descargarlo y probarlo, trae nuevas mejoras entre ellas la incorporación de ajax y más compatibilidad con ADF y JSF. Para los que [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p align="center"><a href="http://probandocodigo.com/ProbandoCodigo_Images/DisponibleVersinFinalDeJDeveloper11_12DAF/jd_clr_rgb_sm.gif"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="75" alt="jd_clr_rgb_sm" src="http://probandocodigo.com/ProbandoCodigo_Images/DisponibleVersinFinalDeJDeveloper11_12DAF/jd_clr_rgb_sm_thumb.gif" width="154" border="0"></a>&nbsp;</p>
<p align="justify">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Solo quería informarles que la versión definitiva de JDeveloper 11 salió en este mes (actualmente estaba por la release 4) de octubre, por lo que los invito a todos a descargarlo y probarlo, trae nuevas mejoras entre ellas la incorporación de ajax y más compatibilidad con ADF y JSF.
<p align="justify">Para los que no conocen JDeveloper, es un IDE gratuito por parte de Oracle para la programación en java, que por ser de Oracle trae mucha compatibilidad con herramientas de Oracle, y entre cosas propias del IDE como ADF.
<p>Creo que tienen que registrarse, es poco tiempo y vale la pena ya que sirve para todas las actualizaciones, como por ejemplo de SQLDeveloper y Jdeveloper, entre otras&#8230;
<p>Pueden descargarlo haciendo click en la siguiente imagen:
<p>&nbsp;</p>
<p align="center"> <a href="http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="60" alt="icon_download" src="http://probandocodigo.com/ProbandoCodigo_Images/DisponibleVersinFinalDeJDeveloper11_12DAF/icon_download.gif" width="59" border="0"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.probandocodigo.com/2008/10/disponible-versin-final-de-jdeveloper-11.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

