<?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>A Curious Aries</title>
	<atom:link href="http://acaries.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://acaries.com</link>
	<description>Curiosity keeps you young</description>
	<lastBuildDate>Thu, 24 Mar 2011 07:54:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Suppress TimeZone info of a Java Calendar object</title>
		<link>http://acaries.com/2011/03/suppress-timezone-info-of-a-java-calendar-object/</link>
		<comments>http://acaries.com/2011/03/suppress-timezone-info-of-a-java-calendar-object/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 07:54:20 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://acaries.com/2011/03/suppress-timezone-info-of-a-java-calendar-object/</guid>
		<description><![CDATA[Overview  To objective is to tell the Calendar object not to show timezone info (i.e. Show &#8216;2011-03-24&#8242; instead of &#8216;2011-03-24+08:00&#8242;) when printing out date. One of the example is when using with XMLBeans.  Reference  suppressing time zone when printing an xsd:date : Weblogic  Calendar (Java 2 Platform SE v1.4.2) – clear(int) [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>To objective is to tell the Calendar object not to show timezone info (i.e. Show &#8216;2011-03-24&#8242; instead of &#8216;2011-03-24+08:00&#8242;) when printing out date. One of the example is when using with <a href="http://xmlbeans.apache.org/" target="_blank">XMLBeans</a>.</p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <p><a href="http://objectmix.com/weblogic/571202-suppressing-time-zone-when-printing-xsd-date.html" target="_blank">suppressing time zone when printing an xsd:date : Weblogic</a></p>  <p><a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/Calendar.html#clear%28int%29" target="_blank">Calendar (Java 2 Platform SE v1.4.2) – clear(int)</a></p>  <p><strong><font color="#0080ff">Steps</font></strong></p>  <p>The key is the Calendar.clear(int) function. We can use it to tell the Calendar object that time zone info is not set, thus the info will not be printed out.</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">Calendar calNoTz = Calendar.getInstance();</pre>
<!--CRLF-->

    <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">calNoTz.clear(Calendar.ZONE_OFFSET); <span style="color: #008000">// Clear the 'Zone offset' info</span></pre>
<!--CRLF--></div>
</div>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2011/03/suppress-timezone-info-of-a-java-calendar-object/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stop remote desktop from locking host</title>
		<link>http://acaries.com/2011/03/stop-remote-desktop-from-locking-host/</link>
		<comments>http://acaries.com/2011/03/stop-remote-desktop-from-locking-host/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 09:19:30 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Misc. IT stuff]]></category>

		<guid isPermaLink="false">http://acaries.com/2011/03/stop-remote-desktop-from-locking-host/</guid>
		<description><![CDATA[Overview  Remote desktop is one of my favorite Windows features. That’s one of the reasons why I only use Windows with professional+ edition.  Everyone who have used remote desktop knows that the host will be locked after the remote session is logged out. Sometimes this characteristic is not convenient to us. I found [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>Remote desktop is one of my favorite Windows features. That’s one of the reasons why I only use Windows with professional+ edition.</p>  <p>Everyone who have used remote desktop knows that the host will be locked after the remote session is logged out. Sometimes this characteristic is not convenient to us. I found a tricks to work-around it on XP Pro. </p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <p><a href="http://forum.soft32.com/windows/stop-Remote-Desktop-locking-host-ftopict360189.html" target="_blank">Can I stop Remote Desktop from locking host?</a></p>  <p><strong><font color="#0080ff">Steps</font></strong></p>  <p>The secret is very simple: run <em><font color="#ffffff">”tscon.exe 0 /dest:console”</font></em> command on the remote computer.</p>  <p>This command will terminate the remote desktop session and left the remote computer unlocked. It is tested on XP Pro (Doubt that it&#160; would work on Vista/Win7)</p>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2011/03/stop-remote-desktop-from-locking-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts 2 Reference Materials</title>
		<link>http://acaries.com/2010/09/struts-2-reference-materials/</link>
		<comments>http://acaries.com/2010/09/struts-2-reference-materials/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 07:34:28 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Struts 2]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/09/struts-2-reference-materials/</guid>
		<description><![CDATA[Overview  This blog serves as summary of links to useful Struts 2 Reference Materials. I only list the reference materials that I have read and found useful.  Reference  Getting Started Documents     Struts 2 Documentation – Getting Started    Convention Plugin     Struts 2 [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>This blog serves as summary of links to useful Struts 2 Reference Materials. I only list the reference materials that I have read and found useful.</p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <p><strong><u>Getting Started Documents</u></strong></p>  <ol>   <li><a href="http://struts.apache.org/2.x/docs/getting-started.html" target="_blank">Struts 2 Documentation – Getting Started</a> </li> </ol>  <p><strong><u>Convention Plugin</u></strong></p>  <ol>   <li><a href="http://struts.apache.org/2.x/docs/convention-plugin.html" target="_blank">Struts 2 Documentation – Convention Pugin</a> </li> </ol>  <p><strong><u>Spring Integration / Spring Plugin</u></strong></p>  <ol>   <li><a href="https://cwiki.apache.org/WW/spring-plugin.html" target="_blank">Struts 2 Documentation – Spring Pugin</a> </li>    <li><a href="https://cwiki.apache.org/WW/struts-2-spring-2-jpa-ajax.html" target="_blank">Struts 2 Tutorial – Struts 2 + Spring 2 + JPA + AJAX</a> </li> </ol>  <p><strong><u>Tile Plugin</u></strong></p>  <ol>   <li><a href="http://tiles.apache.org/getting_started.html" target="_blank">Struts 2 Documentation – Tile Pugin</a> </li>    <li><a href="http://www.vaannila.com/struts-2/struts-2-example/struts-2-tiles-example-1.html" target="_blank">Struts 2 Tiles Example &#8211; VaanNila</a></li>    <li><a href="http://tiles.apache.org/tutorial/index.html" target="_blank">Tiles 2 &#8211; Tutorial</a> </li> </ol>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/09/struts-2-reference-materials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning resources for REST</title>
		<link>http://acaries.com/2010/08/learning-resources-for-rest/</link>
		<comments>http://acaries.com/2010/08/learning-resources-for-rest/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 09:25:01 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[AJAX / Comet]]></category>
		<category><![CDATA[Misc. IT stuff]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/08/learning-resources-for-rest/</guid>
		<description><![CDATA[Overview  I’ve heard of REST, or Representational State Transfer many times. My impression is on the SEO Url like http://bookstore.com/books/isdn/978-0-596-52926-0. Actually REST is much more than that, it can applies on HTTP and many other protocols. And by learning REST, we can design/develope better web sites.  Below are some good sites about REST, [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>I’ve heard of REST, or Representational State Transfer many times. My impression is on the SEO Url like <em><font color="#ffffff">http://bookstore.com/books/isdn/978-0-596-52926-0</font></em>. Actually REST is much more than that, it can applies on HTTP and many other protocols. And by learning REST, we can design/develope better web sites.</p>  <p>Below are some good sites about REST, they are good for learning as well as reminding on REST’s concepts.</p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <ol>   <li><a href="http://cafe.elharo.com/web/why-rest-failed/" target="_blank">Why REST Failed</a> – <a href="http://cafe.elharo.com/" target="_blank">The Cafes</a></li>    <li><a href="http://www.javaworld.com/javaworld/jw-10-2008/jw-10-rest-series-1.html" target="_blank">REST for Java developers, Part 1</a> – <a href="http://www.javaworld.com/" target="_blank">JavaWorld</a></li>    <li><a href="http://www.artima.com/lejava/articles/why_put_and_delete.html" target="_blank">Why PUT and DELETE</a> – <a href="http://www.artima.com/index.jsp" target="_blank">artima developer</a></li> </ol>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/08/learning-resources-for-rest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get started with JPA 2.0 (EclipseLink 2.1)</title>
		<link>http://acaries.com/2010/08/get-started-with-jpa-2-0-eclipselink-2-1/</link>
		<comments>http://acaries.com/2010/08/get-started-with-jpa-2-0-eclipselink-2-1/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 11:51:00 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[EJB]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/08/get-started-with-jpa-2-0-eclipselink-2-1/</guid>
		<description><![CDATA[Overview  Recently I just started playing with JPA (I used Hibernate and JDBC before). After reading some examples, I built a very simple program with JPA 2.0 (EclipseLink 2.1), Eclipse 3.5 Galileo and MySQL Server 5.1. I would like to summarize steps to build the program here.  Reference     EclipseLink [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>Recently I just started playing with JPA (I used Hibernate and JDBC before). After reading some examples, I built a very simple program with JPA 2.0 (EclipseLink 2.1), Eclipse 3.5 Galileo and MySQL Server 5.1. I would like to summarize steps to build the program here.</p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <ol>   <li><a href="http://www.eclipse.org/eclipselink/downloads/index.php#2.1.0" target="_blank">EclipseLink 2.1.0 download page</a> </li>    <li><a href="http://dev.mysql.com/downloads/connector/j/">Connector/J – MySQL JDBC driver</a> </li>    <li><a href="http://www.roseindia.net/ejb/entity-bean-example.shtml" target="_blank">A Java Persistence Example</a> </li>    <li><a href="http://javahowto.blogspot.com/2006/07/helloworld-with-jpa-toplink-and-mysql.html" target="_blank">HelloWorld with JPA, TopLink and MySql</a> </li> </ol>  <p><strong><font color="#0080ff">Steps</font></strong></p>  <p><strong><font color="#ff8000">Download EclipseLink 2.1 and JDBC driver for MySQL Server 5.1</font></strong></p>  <p>Use the above reference links to download EclipseLink 2.1 and MySQL 5.1 JDBC Driver. The JAR files we needed are <em><font color="#ffffff">eclipselink.jar</font></em>, <em><font color="#ffffff">javax.persistence_2.0.1.v201006031150.jar</font></em> and <em><font color="#ffffff">mysql-connector-java-5.1.13-bin.jar</font></em></p>  <p><strong><font color="#ff8000">Create Table</font></strong></p>  <p>Use this SQL to create table bookbank for the example</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: #0000ff">DROP</span> <span style="color: #0000ff">TABLE</span> <span style="color: #0000ff">IF</span> <span style="color: #0000ff">EXISTS</span> `bookbank`;</pre>
<!--CRLF-->

    <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: #0000ff">CREATE</span> <span style="color: #0000ff">TABLE</span> `bookbank` (</pre>
<!--CRLF-->

    <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">  `id` <span style="color: #0000ff">int</span>(10) unsigned <span style="color: #0000ff">NOT</span> <span style="color: #0000ff">NULL</span> AUTO_INCREMENT,</pre>
<!--CRLF-->

    <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">  `title` <span style="color: #0000ff">varchar</span>(45) <span style="color: #0000ff">NOT</span> <span style="color: #0000ff">NULL</span> <span style="color: #0000ff">DEFAULT</span> <span style="color: #006080">''</span>,</pre>
<!--CRLF-->

    <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">  `author` <span style="color: #0000ff">varchar</span>(45) <span style="color: #0000ff">NOT</span> <span style="color: #0000ff">NULL</span> <span style="color: #0000ff">DEFAULT</span> <span style="color: #006080">''</span>,</pre>
<!--CRLF-->

    <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">  `price` <span style="color: #0000ff">double</span> <span style="color: #0000ff">DEFAULT</span> <span style="color: #0000ff">NULL</span>,</pre>
<!--CRLF-->

    <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: #0000ff">PRIMARY</span> <span style="color: #0000ff">KEY</span> (`id`)</pre>
<!--CRLF-->

    <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">)</pre>
<!--CRLF--></div>
</div>

<p><strong><font color="#ff8000">Create a Connection Profile in Eclipse</font></strong></p>

<p>A Connection Profile let you define a DB Connection and view Table Schema and Data in it. and the best part is it can generated Entity Bean for you according to connected DB Schemas!</p>

<ol>
  <li>Start <font color="#ff0000">&quot;Eclipse&quot;</font>, choose <font color="#ff0000">&quot;File&quot;</font> –&gt; <font color="#ff0000">&quot;New&quot;</font> –&gt; <font color="#ff0000">&quot;Other…&quot;</font>. Select <font color="#ff0000">&quot;Connection Profile&quot;</font> in the wizard 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb.png" width="244" height="237" /></a> </li>

  <li>At New Connection Profile, select MySQL for Connection Profile Type. Enter the name of the connection profile. Click Next 
    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb1.png" width="235" height="244" /></a> </li>

  <li>At next page. You have to choose a driver definition. If you don’t already have a MySQL 5.1 driver definition, you have to create it here. Click the <font color="#ff0000">&quot;New Driver Definition&quot;</font> button (red rectangle) to do that. 

    <br />You can jump to step 6 if you already have a MySQL 5.1 driver definition. 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb2.png" width="244" height="77" /></a> </li>

  <li>At New Driver Definition, select the driver template with System Version 5.1. Enter <em><font color="#ffffff">MySQL 5.1</font></em> as the driver name. Click <font color="#ff0000">&quot;Jar List&quot;</font> tab 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb3.png" width="381" height="262" /></a> </li>

  <li>At <font color="#ff0000">&quot;Jar List&quot;</font> tab, remove any existing jar listed here. Than click <font color="#ff0000">&quot;Add JAR/Zip…&quot;</font> and choose the <em><font color="#ffffff">mysql-connector-java-5.1.13-bin.jar</font></em> file you just downloaded. 

    <br />Then click <font color="#ff0000">&quot;OK&quot;</font> to create the definition 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb4.png" width="379" height="260" /></a> </li>

  <li>Back to the <font color="#ff0000">&quot;New Connection Profile&quot;</font> window, choose the MySQL 5.1 driver definition you just created. Enter the Database, URL, Username and password for the connection. Remember to check <font color="#ff0000">&quot;Save password&quot;</font> for future connection. Click <font color="#ff0000">&quot;Finish&quot;</font> to create the profiile. 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb5.png" width="337" height="337" /></a> </li>
</ol>

<p><strong><font color="#ff8000">Create JPA Project in Eclipse</font></strong></p>

<p>Next we have to create a JPA project in Eclipse.</p>

<ol>
  <li>Start <font color="#ff0000">&quot;Eclipse&quot;</font>, choose <font color="#ff0000">&quot;File&quot;</font> –&gt; <font color="#ff0000">&quot;New&quot;</font> –&gt; <font color="#ff0000">&quot;Project…&quot;</font>. Select <font color="#ff0000">&quot;JPA Project&quot;</font> in the wizard 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb6.png" width="272" height="329" /></a> </li>

  <li>At <font color="#ff0000">&quot;New JPA Project&quot;</font>, enter project name. Select <em><font color="#ffffff">&lt;None&gt;</font></em> for <font color="#ff0000">&quot;Target runtime&quot;</font>. Click <font color="#ff0000">&quot;Next&quot;</font> twice 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb7.png" width="319" height="386" /></a> </li>

  <li>At this page, use the values listed below: 
    <br />- <font color="#ff0000">&quot;Platform&quot;</font>: Generic 

    <br />- <font color="#ff0000">&quot;JPA Implementation&quot;</font>: Disable Library Configuration (we will add the EclipseLink library manually) 

    <br />- <font color="#ff0000">&quot;Connection&quot;</font>: Choose the connection profile you have just created 

    <br /><strong><u>Note:</u></strong> If you select <font color="#ff0000">&quot;Add driver library to build path&quot;</font>, the driver library used in your connection profile will be added to the project. Otherwise you need to manually add the correct driver library. 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb8.png" width="321" height="431" /></a> </li>

  <li>Click <font color="#ff0000">&quot;Finish&quot;</font> to create the project </li>
</ol>

<p></p>

<p><strong><font color="#ff8000">Create Entity Bean from DB Table</font></strong></p>

<ol>
  <li>In the JPA projec, add reference to <em><font color="#ffffff">eclipselink.jar</font></em>, <em><font color="#ffffff">javax.persistence_2.0.1.v201006031150.jar</font></em> libraries </li>

  <li>Right click on the JPA project, select <font color="#ff0000">&quot;New&quot;</font> –&gt; <font color="#ff0000">&quot;Entities From Tables&quot;</font> 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb9.png" width="330" height="223" /></a> </li>

  <li>The connection profile should be automatically selected, choose the <em><font color="#ffffff">bookbank</font></em> table. Click <font color="#ff0000">&quot;Next&quot;</font> three times 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb10.png" width="296" height="279" /></a> </li>

  <li>At this page, choose <font color="#ff0000">&quot;identity&quot;</font> for <font color="#ff0000">&quot;Key generator&quot;</font>. Click <font color="#ff0000">&quot;Finish&quot;</font> 

    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/08/image11.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/08/image_thumb11.png" width="298" height="410" /></a> </li>
</ol>

<p><strong><font color="#ff8000">Modify persistence.xml File</font></strong></p>

<ol>
  <li>Open the <font color="#ff0000">&quot;persistence.xml&quot;</font> file inside folder <font color="#ff0000">&quot;META-INF&quot;</font>, replace the <font color="#ff0000">&quot;persistence-unit&quot;</font> tag with the following content: 

    <br />

    <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: #0000ff">&lt;</span><span style="color: #800000">persistence-unit</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;JpaTest&quot;</span> <span style="color: #ff0000">transaction-type</span><span style="color: #0000ff">=&quot;RESOURCE_LOCAL&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">provider</span><span style="color: #0000ff">&gt;</span>org.eclipse.persistence.jpa.PersistenceProvider<span style="color: #0000ff">&lt;/</span><span style="color: #800000">provider</span><span style="color: #0000ff">&gt;</span></pre>
<!--CRLF-->

        <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">    </pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">class</span><span style="color: #0000ff">&gt;</span>Bookbank<span style="color: #0000ff">&lt;/</span><span style="color: #800000">class</span><span style="color: #0000ff">&gt;</span></pre>
<!--CRLF-->

        <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">    </pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">properties</span><span style="color: #0000ff">&gt;</span></pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">property</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;javax.persistence.jdbc.driver&quot;</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;com.mysql.jdbc.Driver&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">property</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;javax.persistence.jdbc.url&quot;</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;jdbc:mysql://localhost:3306/jpa_test&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">property</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;javax.persistence.jdbc.user&quot;</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;MySQL_user_id&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<!--CRLF-->

        <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: #0000ff">&lt;</span><span style="color: #800000">property</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;javax.persistence.jdbc.password&quot;</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;MySQL_password&quot;</span> <span style="color: #0000ff">/&gt;</span> </pre>
<!--CRLF-->

        <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: #0000ff">&lt;/</span><span style="color: #800000">properties</span><span style="color: #0000ff">&gt;</span></pre>
<!--CRLF-->

        <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">    </pre>
<!--CRLF-->

        <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: #0000ff">&lt;/</span><span style="color: #800000">persistence-unit</span><span style="color: #0000ff">&gt;</span></pre>
<!--CRLF--></div>
    </div>
  </li>
</ol>

<p><strong><font color="#ff8000">Create the testing console app</font></strong></p>

<p>Now it’s time to test our JPA app! Let’s add a Java Class with the following code to the JPA project.</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: #0000ff">public</span> <span style="color: #0000ff">class</span> TestMain {</pre>
<!--CRLF-->

    <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">&#160;</pre>
<!--CRLF-->

    <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: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> main(String[] args) {</pre>
<!--CRLF-->

    <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">        EntityManager em = Persistence</pre>
<!--CRLF-->

    <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">            .createEntityManagerFactory(<span style="color: #006080">&quot;JpaTest&quot;</span>)</pre>
<!--CRLF-->

    <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">            .createEntityManager();</pre>
<!--CRLF-->

    <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">        EntityTransaction t = em.getTransaction();</pre>
<!--CRLF-->

    <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">&#160;</pre>
<!--CRLF-->

    <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">        t.begin();</pre>
<!--CRLF-->

    <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">        Bookbank book = <span style="color: #0000ff">new</span> Bookbank();</pre>
<!--CRLF-->

    <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">        book.setTitle(<span style="color: #006080">&quot;test title&quot;</span>);</pre>
<!--CRLF-->

    <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">        book.setAuthor(<span style="color: #006080">&quot;test author&quot;</span>);</pre>
<!--CRLF-->

    <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">        book.setPrice(123.456);</pre>
<!--CRLF-->

    <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">        em.persist(book);</pre>
<!--CRLF-->

    <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">        t.commit();</pre>
<!--CRLF-->

    <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">        </pre>
<!--CRLF-->

    <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">        t.begin();</pre>
<!--CRLF-->

    <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">        Bookbank resultBook = (Bookbank)em</pre>
<!--CRLF-->

    <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">            .createQuery(<span style="color: #006080">&quot;select b from Bookbank b order by b.id desc&quot;</span>)</pre>
<!--CRLF-->

    <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">            .setMaxResults(1)</pre>
<!--CRLF-->

    <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">            .getSingleResult();</pre>
<!--CRLF-->

    <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">        System.out.println(<span style="color: #006080">&quot;Query result:&quot;</span>);</pre>
<!--CRLF-->

    <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">        System.out.println(<span style="color: #006080">&quot;Id: &quot;</span> + resultBook.getId() </pre>
<!--CRLF-->

    <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: #006080">&quot;, title: &quot;</span> + resultBook.getTitle() </pre>
<!--CRLF-->

    <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: #006080">&quot;, author: &quot;</span> + resultBook.getAuthor() </pre>
<!--CRLF-->

    <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: #006080">&quot;, price: &quot;</span> + resultBook.getPrice());</pre>
<!--CRLF-->

    <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">        t.commit();</pre>
<!--CRLF-->

    <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">        </pre>
<!--CRLF-->

    <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">        em.close();</pre>
<!--CRLF-->

    <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">        System.exit(0);</pre>
<!--CRLF-->

    <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">    }</pre>
<!--CRLF-->

    <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">&#160;</pre>
<!--CRLF-->

    <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">}</pre>
<!--CRLF--></div>
</div>

<p></p>

<p>What the class do is simply insert a record with hardcoded values into bookbank table, and then select the newest record. We can start the <font color="#ff0000">&quot;TestMain&quot;</font> class in Eclipse by right-clicking the class, <font color="#ff0000">&quot;Run As&quot;</font> –&gt; <font color="#ff0000">&quot;Java Application&quot;</font></p>

<p><a href="http://acaries.com/it/wp-content/uploads/2010/08/image12.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://acaries.com/it/wp-content/uploads/2010/08/image_thumb12.png" width="506" height="119" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/08/get-started-with-jpa-2-0-eclipselink-2-1/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WebSphere MQ triggering techniques</title>
		<link>http://acaries.com/2010/08/websphere-mq-triggering-techniques/</link>
		<comments>http://acaries.com/2010/08/websphere-mq-triggering-techniques/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 07:30:10 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[WebSphere]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/08/websphere-mq-triggering-techniques/</guid>
		<description><![CDATA[Overview  How to make a program to run whenever a new message is received on a specific queue? There are two ways to implement this &#34;MQ trigger&#34; features:     Use triggers function of WebSphere MQ             WebSphere MQ have a [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>How to make a program to run whenever a new message is received on a specific queue? There are two ways to implement this <font color="#ff0000">&quot;MQ trigger&quot;</font> features:</p>  <ol>   <li><strong><font color="#ff8000">Use triggers function of WebSphere MQ</font></strong>       <br />      <br />WebSphere MQ have a function called <font color="#ff0000">&quot;Trigger Monitor&quot;</font>. It can listen to queue continuously and trigger a program(written by you) to run when messages are received.       <br />      <br />To use this function you (at least) have to:       <br />- Configure the MQ Server for trigger (e.g. create / associate initiation queue)       <br />- Write the program to handle the trigger event, usually this is a standalone program       <br />- Configure and start Trigger Monitor to monitor the target initiaition queue       <br />      <br />I did not use this method for MQ triggering, as this method seems quite troublesome and require lots of configuration. Instead I use the next method to achieve MQ trigger. You may refer to <a href="http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/fg13830_.htm" target="_blank">this</a> WebSphere MQ help page for more info on this method.       <br />      <br /></li>    <li><strong><font color="#ff8000">Deploy a Message-Driven Bean to WebSphere App Server connected to the MQ</font></strong>       <br />      <br />A <font color="#ff0000">&quot;Message-Driven Bean&quot;</font> (MDB) is an <font color="#ff0000">&quot;Enterprise Java Bean&quot;</font> (EJB) which acts as a JMS message listener. It can listen to a port and be started when a JMS message arrive. For more info, please refer to <a href="http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts5.html" target="_blank">this</a> J2EE Tutorial.       <br />      <br />To use JMS technology to achieve MQ triggering function, we first need a WebSphere Application Server (I used WebSphere v6.0). Other J2EE App Server would need WebSphere MQ integration to work. Then we need to configure WebSphere MQ as JMS provider in the App Server. After that, we have to configure some JMS stuff on the App Server, write the MDB and deploy it.       <br />      <br /><a href="http://www.ibm.com/developerworks/websphere/techjournal/0505_woolf/0505_woolf.html" target="_blank">This</a> great tutorial at <a href="http://www.ibm.com/developerworks/views/websphere/library.jsp" target="_blank">IBM</a> have everything you need to know to do MQ trigger thru JMS. It even come with sample code! Please refer to <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0504_barcia/0504_barcia.html" target="_blank">this</a> page for importing the sample code.       <br />      <br />I would try to outline the steps here:       <br />      <br />      <div>       <ol>         <li>Create the queue (As I already have a queue I skipped this step) </li>          <li>Define the JMS connection factory for WebSphere MQ </li>          <li>Define the JMS queue </li>          <li>Define the listener ports </li>          <li>Write the MDB, deploy it to App Server </li>          <li>Restart App Server, done! </li>       </ol>     </div>   </li> </ol>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <ol>   <li><a href="http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzal.doc/fg13830_.htm" target="_blank">Starting WebSphere MQ applications using triggers</a> </li>    <li><a href="http://www.ibm.com/developerworks/websphere/techjournal/0505_woolf/0505_woolf.html" target="_blank">Make WebSphere MQ the JMS provider for Apps deployed in WebSphere</a> </li>    <li><a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0803_titheridge/0803_titheridge.html" target="_blank">How WebSphere Application Server V6 handles poison messages</a> </li>    <li><a href="http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts5.html" target="_blank">What Is a Message-Driven Bean? – The J2EE Tutorial</a> </li> </ol>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/08/websphere-mq-triggering-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting SYSDATE in UTC (GMT) time</title>
		<link>http://acaries.com/2010/08/getting-sysdate-in-utc-gmt-time/</link>
		<comments>http://acaries.com/2010/08/getting-sysdate-in-utc-gmt-time/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 04:23:05 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/08/getting-sysdate-in-utc-gmt-time/</guid>
		<description><![CDATA[Overview  Recently I have a task to change all the “last_update_date” column in our tables to store UTC (GMT) time. The “last_update_date” column with data type DATE stores the datetime where the row is last updated.  I found that the system originally use SYSDATE to populate the value of “last_update_date” column, and the [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>Recently I have a task to change all the “last_update_date” column in our tables to store UTC (GMT) time. The “last_update_date” column with data type <em><font color="#ffffff">DATE</font></em> stores the datetime where the row is last updated.</p>  <p>I found that the system originally use <em><font color="#ffffff">SYSDATE</font></em> to populate the value of “last_update_date” column, and the value of <em><font color="#ffffff">SYSDATE</font></em> depends on DB server’s time zone.</p>  <p>There are two ways to get <em><font color="#ffffff">SYSDATE</font></em> in UTC (GMT) time:</p>  <ol>   <li><strong><font color="#ff8000">Use function SYS_EXTRACT_UTC(SYSTIMESTAMP)</font></strong>       <br />Use function <em><font color="#ffffff">SYS_EXTRACT_UTC(SYSTIMESTAMP)</font></em> to get <em><font color="#ffffff">SYSTIMESTAMP</font></em> in UTC time. In my Oracle 9i DB I can save this directly to a column with date type <em><font color="#ffffff">DATE</font></em>.       <br />- <em><font color="#ffffff">SYSTIMESTAMP</font></em> is very similar to <em><font color="#ffffff">SYSDATE</font></em> except that it also includes fractional seconds and time zone.       <br />- <em><font color="#ffffff">SYS_EXTRACT_UTC</font></em> is a function to shows a <em><font color="#ffffff">TIMESTAMP</font></em> with UTC time.       <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: #0000ff">SELECT</span> SYSTIMESTAMP, SYS_EXTRACT_UTC(SYSTIMESTAMP) <span style="color: #0000ff">FROM</span> DUAL;</pre>
<!--CRLF--></div>
    </div>
Result: 

    <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">SYSTIMESTAMP</pre>
<!--CRLF-->

        <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">---------------------------------------------------------------------------</pre>
<!--CRLF-->

        <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">12-AUG-10 11.54.45.147229 AM +08:00</pre>
<!--CRLF-->

        <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">&#160;</pre>
<!--CRLF-->

        <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">SYS_EXTRACT_UTC(SYSTIMESTAMP)</pre>
<!--CRLF-->

        <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">---------------------------------------------------------------------------</pre>
<!--CRLF-->

        <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">12-AUG-10 03.54.45.147229 AM</pre>
<!--CRLF--></div>
    </div>
  </li>

  <li><strong><font color="#ff8000">Alter session time zone and use CURRENT_DATE instead of SYSDATE</font></strong> 

    <br />Because <em><font color="#ffffff">SYSDATE</font></em> depends on OS of the DB Server, we cannot change its time zone setting. However, we can change the time zone of current session and use <em><font color="#ffffff">CURRENT_DATE</font></em> instead of <em><font color="#ffffff">SYSDATE</font></em> to get date according to current session time zone. 

    <br />

    <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: #0000ff">ALTER</span> <span style="color: #0000ff">SESSION</span> <span style="color: #0000ff">SET</span> TIME_ZONE = <span style="color: #006080">'00:00'</span>;</pre>
<!--CRLF-->

        <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: #0000ff">SELECT</span> <span style="color: #0000ff">CURRENT_DATE</span> <span style="color: #0000ff">FROM</span> DUAL;</pre>
<!--CRLF--></div>
    </div>
  </li>
</ol>

<p><strong><font color="#0080ff">Reference</font></strong></p>

<ol>
  <li><a href="http://download.oracle.com/docs/cd/B13789_01/server.101/b10759/functions152.htm" target="_blank">SYS_EXTRACT_UTC – Oracle SQL Reference</a> </li>

  <li><a href="http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/functions158.htm" target="_blank">SYSTIMESTAMP – Oracle SQL Reference</a> </li>

  <li><a href="http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/functions032.htm#sthref1213" target="_blank">CURRENT_DATE – Oracle SQL Reference</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/08/getting-sysdate-in-utc-gmt-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Use Eclipse PDT to develop and debug PHP</title>
		<link>http://acaries.com/2010/07/use-eclipse-pdt-to-develop-and-debug-php/</link>
		<comments>http://acaries.com/2010/07/use-eclipse-pdt-to-develop-and-debug-php/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 03:41:14 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/07/use-eclipse-pdt-to-develop-and-debug-php/</guid>
		<description><![CDATA[Overview  Eclipse is a popular IDE for Java/J2EE development. But indeed it can be used for developing on other languages too! Eclipse PHP Development Tools (PDT) is a powerful plugin for PHP development, it includes the following features:     Code Assist (Intelli-sense)     PHP Debug perspective which is [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>Eclipse is a popular IDE for Java/J2EE development. But indeed it can be used for developing on other languages too! Eclipse PHP Development Tools (PDT) is a powerful plugin for PHP development, it includes the following features:</p>  <ul>   <li>Code Assist (Intelli-sense) </li>    <li>PHP Debug perspective which is very similar to Java Debug perspective </li>    <li>PHP project template </li> </ul>  <p>In this blog, we will see how to quickly setup a PHP development environment with Eclipse PDT. Below shows the initial configuration:</p>  <ul>   <li>Windows 2003 with IIS 6.0 </li>    <li>Eclipse 3.5 Galileo </li> </ul>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <ol>   <li><a href="http://www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf" target="_blank">Debugging PHP using Eclipse and PDT</a> (pdf) </li>    <li><a href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">Microsoft Web Platform Installer 2.0</a> </li>    <li><a href="http://download.eclipse.org/releases/galileo" target="_blank">Eclipse 3.5 (Galileo) update site</a> </li>    <li><a href="http://www.xdebug.org/index.php" target="_blank">“xdebug” HomePage</a> </li> </ol>  <p><strong><font color="#0080ff">Steps</font></strong></p>  <p><strong><font color="#ff8000">Install PHP 5.2.14</font></strong></p>  <p>I used <font color="#ff0000">&quot;Microsoft Web Platform Installer (WPI) 2.0&quot;</font> to install and configure PHP. The procedures are quite simple:</p>  <ol>   <li>Download and install WPI <a href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">here</a> </li>    <li>Start WPI, select <font color="#ff0000">&quot;Web Platform&quot;</font> on the left pane, then click <font color="#ff0000">&quot;Customize&quot;</font> under <font color="#ff0000">&quot;Web Server&quot;</font> </li>    <li>Check <font color="#ff0000">&quot;FastCGI 1.5 for IIS 6.0 and IIS 5.1&quot;</font>, click <font color="#ff0000">&quot;Back to Web Platform&quot;</font>       <br /><a href="http://acaries.com/it/wp-content/uploads/2010/07/image5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/07/image_thumb5.png" width="391" height="144" /></a> </li>    <li>Click <font color="#ff0000">&quot;Customize&quot;</font> under <font color="#ff0000">&quot;Frameworks and Runtimes&quot;</font>, check all two items under <font color="#ff0000">&quot;PHP&quot;</font>       <br /><a href="http://acaries.com/it/wp-content/uploads/2010/07/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/07/image_thumb6.png" width="392" height="221" /></a> </li>    <li>Click <font color="#ff0000">&quot;Install&quot;</font> button to install the selected components </li> </ol>  <p><strong><font color="#ff8000">Install PDT on Eclipse 3.5 Galileo</font></strong></p>  <p>Installing PDT is easy as it can be found in the Eclipse update site</p>  <ol>   <li>Start Eclipse and go to <font color="#ff0000">&quot;Help&quot;</font> –&gt; <font color="#ff0000">&quot;Install New Software…&quot;</font> </li>    <li>Select or add the Eclipse Galileo update site <a title="http://download.eclipse.org/releases/galileo" href="http://download.eclipse.org/releases/galileo">http://download.eclipse.org/releases/galileo</a> </li>    <li>PDT is under <font color="#ff0000">&quot;Programming Languages&quot;</font>       <br />&#160;<a href="http://acaries.com/it/wp-content/uploads/2010/07/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://acaries.com/it/wp-content/uploads/2010/07/image_thumb7.png" width="408" height="129" /></a> </li> </ol>  <p><strong><font color="#ff8000">Setup “xdebug” for PHP debugging</font></strong></p>  <p>Although PDT have a PHP debug perspective, you have to install a PHP debugger to use it. There are two debugger supported by PDT: <font color="#ff0000">&quot;Zend Debugger&quot;</font> and <font color="#ff0000">&quot;xdebug&quot;</font>. I’ve tried using both of them, and find that there is a <a href="http://www.devcomments.com/CGI-Error-with-zenddebugger-and-eclipse-PDT-to235410.htm" target="_blank">problem debugging PHP web pages</a> with Zend Debugger. On the other hand, xdebug works great. So I will use xdebug in this post.</p>  <p>To set up xdebug on Windows 2003, you need to download the precompiled dll from xdebug site and modify your php.ini file accordingly:</p>  <ol>   <li>Download the right dll at <a href="http://www.xdebug.org/index.php" target="_blank">“xdebug” HomePage</a>, the dll I use is <em><font color="#ffffff">php_xdebug-2.1.0-5.2-vc6-nts.dll</font></em> </li>    <li>Put the dll in a local folder, I use <em><font color="#ffffff">C:\Program Files\PHP\ext</font></em> (PHP extension folder) </li>    <li>Add the following line to the PHP configure file, mine is <em><font color="#ffffff">C:\Program Files\PHP\php.ini</font></em>       <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">[xdebug]</pre>
<!--CRLF-->

        <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">zend_extension=&quot;C:\Program Files\PHP\ext\php_xdebug-2.1.0-5.2-vc6-nts.dll&quot;</pre>
<!--CRLF-->

        <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">xdebug.remote_enable=On</pre>
<!--CRLF-->

        <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">xdebug.remote_host=&quot;localhost&quot;</pre>
<!--CRLF-->

        <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">xdebug.remote_port=9000</pre>
<!--CRLF-->

        <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">xdebug.remote_handler=&quot;dbgp&quot;</pre>
<!--CRLF--></div>
    </div>
  </li>

  <li>Restart IIS and verify that the phpinfo() page contains a section for xdebug
    <br /><a href="http://acaries.com/it/wp-content/uploads/2010/07/image8.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://acaries.com/it/wp-content/uploads/2010/07/image_thumb8.png" width="412" height="172" /></a> </li>
</ol>

<p><strong><font color="#ff8000">Try it out!</font></strong></p>

<p></p>

<p>With the previous step done, now it’s time to test out our setting! You may follow <a href="http://www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf" target="_blank">this</a> pdf guide to create a test PHP project and tty the debugging function. The guide also tell you how to setup PDT and debugger, you can skip those parts as they are already done.</p>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/07/use-eclipse-pdt-to-develop-and-debug-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert MOV video to AVI and rotate to vertical</title>
		<link>http://acaries.com/2010/07/convert-mov-video-to-avi-and-rotate-to-vertical/</link>
		<comments>http://acaries.com/2010/07/convert-mov-video-to-avi-and-rotate-to-vertical/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:29:48 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Misc. IT stuff]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/07/convert-mov-video-to-avi-and-rotate-to-vertical/</guid>
		<description><![CDATA[Overview  Here are the two major problems I always face when storing videos taken by my DC:     Convert video from MOV to other format (and keeping good video/audio quality)     Rotate video from landscape to portrait (as the video is taken vertically)    I want [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>Here are the two major problems I always face when storing videos taken by my DC:</p>  <ol>   <li>Convert video from MOV to other format (and keeping good video/audio quality) </li>    <li>Rotate video from landscape to portrait (as the video is taken vertically) </li> </ol>  <p>I want to do this because I want to play the videos on my PC or TV (via PlayStation 3). After trying a number of softwares I settle with the following two great open source freewares:</p>  <ol>   <li><a href="http://sourceforge.net/projects/mp4cam2avi/" target="_blank">MP4Cam2AVI Easy Converter</a> by <a href="http://sourceforge.net/users/graywolf2004" target="_blank">graywolf2004</a> </li>    <li><a href="http://www.virtualdub.org/index.html" target="_blank">VirtualDub</a> by <a href="http://www.virtualdub.org/contact.html" target="_blank">Avery Lee</a> </li> </ol>  <p>The first software, as its name suggests, is used to convert MOV videos to AVI format. It provides MPEG-4 video and MP3 audio compression. I found that its performance is high and output quality is quite good.</p>  <p>The second is a famous free video editing tool. It is originally designed for handling AVI video, so I need to convert MOV videos first to use it. On the other hand, there are a number of third-party plugins for this software, including the plugin for importing MOV videos. Bad news is I have tried that plugin but still cannot edit MOV file.</p>  <p><strong><u><font color="#ff0000">Note:</font></u></strong></p>  <p>In order to import MP4 videos into VirtualDub, you need to install ffdshow and its plugin for VirtualDub (included in the install package). Otherwise you will not see anything but black screen on VirtualDub.</p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <ol>   <li><a href="http://sourceforge.net/projects/mp4cam2avi/" target="_blank">MP4Cam2AVI Easy Converter</a> </li>    <li><a href="http://www.virtualdub.org/index.html" target="_blank">VirtualDub</a> </li>    <li><a href="http://www.free-codecs.com/ffdshow_download.htm" target="_blank">ffdshow</a> </li>    <li><a href="http://www.youtube.com/watch?v=kVZ4FiHKArE" target="_blank">VirtualDub rotate video demo – YouTube</a> by <a href="http://www.youtube.com/user/proditech" target="_blank">proditech</a></li> </ol>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/07/convert-mov-video-to-avi-and-rotate-to-vertical/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Started with Spring Framework</title>
		<link>http://acaries.com/2010/07/getting-started-with-spring-framework/</link>
		<comments>http://acaries.com/2010/07/getting-started-with-spring-framework/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 07:58:54 +0000</pubDate>
		<dc:creator>arieslee</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://acaries.com/2010/07/getting-started-with-spring-framework/</guid>
		<description><![CDATA[Overview  Learning Spring Framework is somewhat diffcult as there are too many Products on SpringSource.org. I just can’t figure out where to start. One way to sort things out is to ignore all Spring features except the core one: Spring IoC container.  Below listed two very good pages for learning Spring Framework quickly. [...]]]></description>
			<content:encoded><![CDATA[<p><strong><font color="#0080ff">Overview</font></strong></p>  <p>Learning Spring Framework is somewhat diffcult as there are too many Products on SpringSource.org. I just can’t figure out where to start. One way to sort things out is to ignore all Spring features except the core one: Spring IoC container.</p>  <p>Below listed two very good pages for learning Spring Framework quickly. The first one explains the core feature of Spring container: Dependency Injection (DI), and use a very simple (maybe the simplest IMHO) HelloWorld example to illustrate the idea. The example is super simple, with no extra Spring features at all (it is not even a Web App!)</p>  <p>The second web pages contains many Spring tutorials, each on a Spring’s feature. It’s good for learning Spring’s features one at a time.</p>  <p><strong><font color="#0080ff">Reference</font></strong></p>  <ol>   <li><a href="http://www.developer.com/java/ent/article.php/10933_3496416_1/A-Spring-Jump-Start.htm" target="_blank">A Spring Jump Start</a> </li>    <li><a href="http://www.vaannila.com/spring/spring-tutorial/spring-tutorial.html" target="_blank">Spring Tutorial &#8211; VaanNila</a> </li> </ol>]]></content:encoded>
			<wfw:commentRss>http://acaries.com/2010/07/getting-started-with-spring-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.618 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-21 02:41:58 -->

