<?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"
	>

<channel>
	<title>TATTODECASTRO.com</title>
	<atom:link href="http://www.tattodecastro.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tattodecastro.com</link>
	<description>stay hungry, stay foolish..</description>
	<pubDate>Sun, 16 Mar 2008 17:35:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>HSQL e PHP</title>
		<link>http://www.tattodecastro.com/2008/02/29/hsql-e-php/</link>
		<comments>http://www.tattodecastro.com/2008/02/29/hsql-e-php/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 03:24:45 +0000</pubDate>
		<dc:creator>Tatto</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[hsql]]></category>

		<guid isPermaLink="false">http://www.tattodecastro.com/2008/02/29/hsql-e-php/</guid>
		<description><![CDATA[Estes dias me deparei com um problema, precisava fazer somas de colunas de valores expressos em notação monetária brasileira (em real) a partir de uma tabela em hsql.
hsql ou hsqldb é um banco de dados desenvolvido em Java, como ainda não o utilizei intensivamente não tenho uma visão muito clara dele. Mas ele parece ser [...]]]></description>
			<content:encoded><![CDATA[<p>Estes dias me deparei com um problema, precisava fazer somas de colunas de valores expressos em notação monetária brasileira (em real) a partir de uma tabela em <a href="http://hsqldb.org/" title="hsqldb - 100% Java Database" target="_blank">hsql</a>.</p>
<p><em>hsql</em> ou <em>hsqldb</em> é um banco de dados desenvolvido em Java<strike>, como ainda não o utilizei intensivamente não tenho uma visão muito clara dele</strike>. Mas ele parece ser bem versátil, funciona tanto no modo servidor através do protocolo HTTP, ou com um protocolo próprio, como também no modo embarcado (com menos de 100Kb). Dentre os softwares que estão o utilizando posso citar OpenOffice 2.0, JBoss e aqui no Brasil já encontrei um aplicativo da Receita Federal que também utiliza este <acronym title="Sistema Gerenciador de Banco de Dados">BD</acronym>.</p>
<p>Apesar de ter lido no <a href="http://freshmeat.net/projects/hsqldb" title="freshmeat.net: Project details for hsqldb Database Engine">freshmeat</a> que existia suporte de hsql para PHP, não o encontrei e única solução que me veio a cabeça foi usar a biblioteca <acronym title="Java Database Connectivity">JDBC</acronym> para acessar o banco no php através do suporte a Java no PHP.</p>
<p>Tentei usar a extensão Java com o PHP 5.2.5 no Windows Vista, segui um tutorial do site <a href="http://www.onlamp.com/pub/a/php/2001/06/14/php_jav.html" title="PHP and Java">ONLAMP.com</a>. Só que sempre que criava um objecto Java(), o PHP tinha um crash. Ao buscar por bugs relacionados a isso em <a href="http://bugs.php.net/">bugs.php.net</a> econtrei o <a href="http://bugs.php.net/bug.php?id=32215" title="#32215: Java Crash">#32215: Java Crash</a> onde o Andrey diz que a extensão Java do PHP não é mais mantida e recomenda o uso do <a href="http://sourceforge.net/projects/php-java-bridge/" title="PHP/Java Bridge">PHP/Java Bridge</a>.</p>
<p>Segui o conselho do Andrey, baixei a versão 5.1.2 do PHP/Java Bridge. No site deles a última versão que fazem referência é a 3.2.1 lançada em dezembro de 2006. Mas na área de downloads do projeto no <a href="http://sourceforge.net/project/showfiles.php?group_id=117793">SourceForge.net</a> você encontra versões mais atuais. Tentei usar um <a href="http://www.dsl.uow.edu.au/~sk33/php5java.htm">tutorial</a> disponível através do site deles para ambiente Windows, sem sucesso. Após algum tempo lendo e pensando em soluções consegui fazer um exemplo bem simples sem usar nenhuma extensão do PHP e que funciona com qualquer JRE (sem a necessidade do JDK).</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Modifications to allow the use of Java by PHP/Java Bridge</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">"Java.inc"</span> <span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#FF9933; font-style:italic;">// Content of http://localhost:8080/JavaBridge/java/Java.inc or JavaBridge.jar/META-INF/java/Java.inc</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">* Example used in PHP.net/Java</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// get instance of Java class java.lang.System in PHP</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$system</span> = <span style="color:#000000; font-weight:bold;">new</span> Java<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"java.lang.System"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// demonstrate property access</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Java version='</span> . <span style="color:#0000FF;">$system</span>-&gt;<span style="color:#006600;">getProperty</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'java.version'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Java vendor='</span> . <span style="color:#0000FF;">$system</span>-&gt;<span style="color:#006600;">getProperty</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'java.vendor'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'OS='</span> . <span style="color:#0000FF;">$system</span>-&gt;<span style="color:#006600;">getProperty</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'os.name'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">' '</span> .</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$system</span>-&gt;<span style="color:#006600;">getProperty</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'os.version'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">' on '</span> .</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$system</span>-&gt;<span style="color:#006600;">getProperty</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'os.arch'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">' '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// java.util.Date example</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$formatter</span> = <span style="color:#000000; font-weight:bold;">new</span> Java<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'java.text.SimpleDateFormat'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$formatter</span>-&gt;<span style="color:#006600;">format</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#000000; font-weight:bold;">new</span> Java<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#FF0000;">'java.util.Date'</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>O arquivo Java.inc se comunida com o serviço do JavaBridge, para iniciar você pode digitar o comando java -jar JavaBridge.jar SERVLET:8080 ou executar o start_javabridge.bat que esta disponível no <a href="http://www.tattodecastro.com/wp-content/uploads/2008/02/phpjavabridge.zip" title="Exemplo do PHP/Java Bridge">Exemplo do PHP/Java Bridge</a>.</p>
<p>Depois que o Java deixou de ser um problema o JDBC com o hsql foi tranquilo <img src='http://www.tattodecastro.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Já que o exemplo ficou muito grande com o JDBC resolvi deixar aqui o link para download: <a href="http://www.tattodecastro.com/wp-content/uploads/2008/02/phphsqldb.zip" title="Exemplo do PHP com HSQL através de JDBC">Exemplo do PHP com HSQL através de JDBC</a>. Vale lembrar que este exemplo é facilmente modificado para qualquer banco de dados que tenha suporte JDBC, só não se esqueça de mover o driver correspondente que no exemplo é o arquivo hsqldb.jar para a pasta de extensões da JRE.</p>
<p>Acho que isso é tudo. Abraço!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tattodecastro.com/2008/02/29/hsql-e-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Novo layout do blog</title>
		<link>http://www.tattodecastro.com/2007/12/10/novo-layout-do-blog/</link>
		<comments>http://www.tattodecastro.com/2007/12/10/novo-layout-do-blog/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 14:15:39 +0000</pubDate>
		<dc:creator>Tatto</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Off Topic]]></category>

		<category><![CDATA[WebStandarts]]></category>

		<category><![CDATA[layout]]></category>

		<category><![CDATA[template]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.tattodecastro.com/2007/12/10/novo-layout-do-blog/</guid>
		<description><![CDATA[Passei uma parte do meu final de semana arrumando alguns detalhes deste layout para o WordPress. Não foi nenhum bicho de sete cabeças não.
Toda documentação que eu precisei encontrei em http://codex.wordpress.org/. Nesse endereço você encontra de tudo, desde dicas de como instalar ou fazer o upgrade da sua versão do WordPress até a descrição de [...]]]></description>
			<content:encoded><![CDATA[<p>Passei uma parte do meu final de semana arrumando alguns detalhes deste layout para o WordPress. Não foi nenhum bicho de sete cabeças não.</p>
<p>Toda documentação que eu precisei encontrei em <a href="http://codex.wordpress.org/" title="WordPress Codex">http://codex.wordpress.org/</a>. Nesse endereço você encontra de tudo, desde dicas de como instalar ou fazer o upgrade da sua versão do WordPress até a descrição de toda a API.</p>
<p>O layout ainda esta um pouco bugado, caso você encontre algo fora do lugar por favor me avise :D.</p>
<p>Segue o template <a href="http://www.tattodecastro.com/wp-content/uploads/2007/12/tattodecastro.zip" title="Download do tema TATTODECASTRO.com para o WordPress">TATTODECASTRO.com para o WordPress (Versão 0.1)</a>.</p>
<p>Em caso de dúvidas ou sugestões, entre em contato.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tattodecastro.com/2007/12/10/novo-layout-do-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Olá Blog</title>
		<link>http://www.tattodecastro.com/2007/12/02/ola-blog/</link>
		<comments>http://www.tattodecastro.com/2007/12/02/ola-blog/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 13:09:47 +0000</pubDate>
		<dc:creator>Tatto</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Off Topic]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[WebStandarts]]></category>

		<category><![CDATA[offtopic]]></category>

		<guid isPermaLink="false">http://www.tattodecastro.com/index2.php/2007/12/02/ola-blog/</guid>
		<description><![CDATA[Olá a todos. Este é o primeiro post do meu blog. Espero que com ele me estimule a aprender mais sobre tecnologias, principalmente o PHP. Também pretendo falar sobre webstandarts, SOA, CSS assuntos que também chamam muito a minha atenção.
Então acho que é isso. Abraço a todos.
]]></description>
			<content:encoded><![CDATA[<p>Olá a todos. Este é o primeiro post do meu blog. Espero que com ele me estimule a aprender mais sobre tecnologias, principalmente o PHP. Também pretendo falar sobre webstandarts, SOA, CSS assuntos que também chamam muito a minha atenção.</p>
<p>Então acho que é isso. Abraço a todos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tattodecastro.com/2007/12/02/ola-blog/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
