<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Naming Exception</title>
	<atom:link href="http://namingexception.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://namingexception.wordpress.com</link>
	<description>When naming does matter</description>
	<lastBuildDate>Fri, 14 Oct 2011 10:06:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='namingexception.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Naming Exception</title>
		<link>http://namingexception.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://namingexception.wordpress.com/osd.xml" title="Naming Exception" />
	<atom:link rel='hub' href='http://namingexception.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Implementing URL Shortener with Servlet</title>
		<link>http://namingexception.wordpress.com/2011/10/10/implementing-url-shortener-with-servlet/</link>
		<comments>http://namingexception.wordpress.com/2011/10/10/implementing-url-shortener-with-servlet/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 04:06:20 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/?p=512</guid>
		<description><![CDATA[I bet that most of you already tried Url Shortener Service to make your long link shorter and easier to write and remember. And perhaps you use more than one service, you name it ow.ly, goo.gl, bit.ly and still tons of services like that available freely on the cloud. But, how it works? here i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=512&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I bet that most of you already tried Url Shortener Service to make your long link shorter and easier to write and remember. And perhaps you use more than one service, you name it ow.ly, goo.gl, bit.ly and still tons of services like that available freely on the cloud. But, how it works? here i will share its implementation with Servlet. It&#8217;s easy to implement, believe me.</p>
<p>First of all, prepare several tools below:</p>
<ul>
<li>
<div>MySql Database Server. I use version 5.1.49 Community Edition, you can download newest MySql from <a href="http://www.mysql.com/downloads/mysql/">http://www.mysql.com/downloads/mysql/</a>. Or you can choose another DBMS implementation, like Oracle, Sql Server, etc.</div>
</li>
<li>
<div>MySql Connector/J, as our JDBC driver for MySql. You can download it from <a href="http://www.mysql.com/downloads/connector/j/">http://www.mysql.com/downloads/connector/j/</a>. Please use suitable JDBC Driver if you choose another DBMS.</div>
</li>
<li>
<div>Servlet Container, here i use Apache Tomcat 6.0.32, you can download it<a href="http://tomcat.apache.org/">http://tomcat.apache.org/</a>. Of course, you can replace it with your own most favourite Web Server; Jetty, Glassfish, JBoss, etc.</div>
</li>
<li>
<div><strong>servlet-api.jar</strong>, this is jar of Servlet API. You will need it to create a simple Http Servlet. You can download it from <a href="http://www.java2s.com/Code/Jar/STUVWXYZ/Downloadservletapijar.htm">http://www.java2s.com/Code/Jar/STUVWXYZ/Downloadservletapijar.htm</a> just in case you dont have it.</div>
</li>
<li>
<div>Your favourite Java IDE. In this tutorial I&#8217;m using Eclipse Helios 3.6, feel free to use similar IDE.</div>
</li>
</ul>
<p>After you have all of these things above, we can start it. In order to make this post shorter, i assume that you have experience in creating new Web Project and adding required jars (servlet-api.jar and Mysql Connector/J ) to the classpath.</p>
<p><strong>Scenario</strong> .</p>
<p>Before we started to the code, maybe i have to describe the business scenario first. My scenario is i want to make a simple program that take input of my long url and return a shorter link that formed like <strong>http://myserver/{id}</strong> , where <strong>{id}</strong> is my identifier to find the original url and turn my browser to open it.</p>
<p><strong>Create Database</strong></p>
<p>Run this Sql Script on your DBMS engine to create a table that stores our data. Dont forget, the id column has to be auto-increment. This is our primary key and we need it as a short url. You need to modify the Sql if you use other DBMS.</p>
<p><pre class="brush: sql; pad-line-numbers: false;">
CREATE DATABASE /*!32312 IF NOT EXISTS*/`url_shortener` /*!40100 DEFAULT CHARACTER SET latin1 */;

CREATE TABLE `url_data` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `long_url` text NOT NULL,
  PRIMARY KEY (`id`)
);
</pre><br />
<a name="Insert"></a><br />
<strong>Creating Servlet to Insert Long Url.</strong></p>
<p>Now, create a new Java Class that extends <strong>javax.servlet.http.HttpServlet</strong> object and type below code.</p>
<p><pre class="brush: java;">
package com.namex.shortener;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Insert extends HttpServlet {

    /**
     * Both POST and GET method are allowed to insert new record
     *
     */

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
	    throws ServletException, IOException {

	doGet(request, response);
    }

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
	    throws ServletException, IOException {

	String longUrl = request.getParameter(&quot;longUrl&quot;);
	request.getSession().setAttribute(&quot;a&quot;, &quot;a&quot;);
	String a = response.encodeURL(request.getRequestURI());
	request.getSession().setAttribute(&quot;a&quot;, &quot;a&quot;);
	System.out.println(&quot;-&gt;&quot;+request.getRequestURI());
	System.out.println(a);
	System.out.println(&quot;shortening &quot; + longUrl);
	String serverName = request.getServerName();
	int port = request.getServerPort();
	String contextPath = request.getContextPath();
	String shortUrl = null;
	try {
	    shortUrl = new Logic().getShort(serverName, port, contextPath,
		    longUrl);
	} catch (Exception e) {

	    e.printStackTrace();
	}
	System.out.println(&quot;short url: &quot; + shortUrl);
	request.getSession().setAttribute(&quot;shortUrl&quot;, shortUrl);
	response.sendRedirect(&quot;index.jsp&quot;);
    }
}

</pre></p>
<p>In my case, i want my program to handle both of POST and GET method, so i need to implement both of <strong>doGet</strong> and <strong>doPost</strong> method. Just in case you only want to handle GET method and not the POST, so you only need to override the <strong>doGet</strong> method.</p>
<p>See the <strong>new Logic().getShort(serverName, port, contextPath, longUrl);</strong> line. That is our Logic class that handle the whole business-logic problem. So we can see our servlet neater. Below is complete Logic source code, just type the whole thing, including not used yet function. And dont forget to adjust the <strong>getConnection</strong> according to your DBMS IP Address and credential.</p>
<p><pre class="brush: java;">
package com.namex.shortener;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Logic {
    public Connection getConnection() throws IllegalAccessException,
	    ClassNotFoundException, SQLException {
	//adjust it
	String url = &quot;jdbc:mysql://localhost/url_shortener&quot;;
	Class.forName(&quot;com.mysql.jdbc.Driver&quot;);
	Connection conn = DriverManager.getConnection(url, &quot;root&quot;, &quot;root&quot;);
	return conn;
    }

    public String getId(String longUrl) throws Exception {
	Connection conn = null;
	ResultSet rs = null;
	Statement st = null;

	String query = &quot;SELECT id FROM url_data WHERE long_url='&quot;
		+ longUrl.trim() + &quot;'&quot;;
	String id = null;
	try {
	    try {
		conn = getConnection();
		st = conn.createStatement();
		rs = st.executeQuery(query);
		if (rs.next()) {
		    id = rs.getString(&quot;id&quot;);
		}
	    } finally {

		if (rs != null) {
		    rs.close();
		}
		if (st != null) {
		    st.close();
		}
		if (conn != null) {
		    conn.close();
		}
	    }
	} catch (Exception e) {
	    throw e;
	}
	return id;
    }

    public String getShort(String serverName, int port, String contextPath,
	    String longUrl) throws Exception {

	Connection conn = null;

	Statement st = null;
	String id = getId(longUrl);// check if URL has been shorten already
	if (id != null) {
	    // if id is not null, this link has been shorten already.
	    // nothing to do

	} else {
	    // at this point id is null, make it shorter
	    String sqlInsert = &quot;INSERT INTO url_data(long_url) VALUES('&quot;
		    + longUrl.trim() + &quot;')&quot;;
	    try {
		conn = getConnection();
		st = conn.createStatement();
		st.execute(sqlInsert);
	    } finally {
		if (st != null) {
		    st.close();
		}
		if (conn != null) {
		    conn.close();
		}
	    }
	    // after we insert the record, we obtain the ID as identifier of our
	    // new short link
	    id = getId(longUrl);

	}
	return &quot;http://&quot; + serverName + &quot;:&quot; + port + contextPath + &quot;/&quot; + id;
    }

    public String getLongUrl(String urlId) throws Exception {
	if (urlId.startsWith(&quot;/&quot;)) {
	    urlId = urlId.replace(&quot;/&quot;, &quot;&quot;);
	}
	String query = &quot;SELECT long_url FROM url_data where id=&quot; + urlId;
	String longUrl = null;
	Connection conn = null;
	ResultSet rs = null;
	Statement st = null;

	try {
	    conn = getConnection();
	    st = conn.createStatement();
	    rs = st.executeQuery(query);
	    if (rs.next()) {
		longUrl = rs.getString(&quot;long_url&quot;);
	    }
	} finally {

	    if (rs != null) {
		rs.close();
	    }
	    if (st != null) {
		st.close();
	    }
	    if (conn != null) {
		conn.close();
	    }
	}

	return longUrl;
    }

}
</pre></p>
<p><strong>Adjusting web.xml for Insert Servlet.</strong></p>
<p>To let the Server identify your new created servlet, adjust your web.xml like this.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
	xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot;
	id=&quot;WebApp_ID&quot; version=&quot;3.0&quot;&gt;
	&lt;display-name&gt;URLShortener&lt;/display-name&gt;

	&lt;servlet&gt;
		&lt;servlet-name&gt;Insert&lt;/servlet-name&gt;
		&lt;servlet-class&gt;com.namex.shortener.Insert&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;-1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;

	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;Insert&lt;/servlet-name&gt;
		&lt;url-pattern&gt;/insert&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;
	&lt;welcome-file-list&gt;
		&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
	&lt;/welcome-file-list&gt;
&lt;/web-app&gt;
</pre></p>
<p>You see the <strong>&lt;servlet&gt;&lt;/servlet&gt;</strong> tag, between that tag is our servlet class and we give it a name <strong>Insert</strong>. So whenever we need to do configuration to this servlet, we use the name <strong>Insert</strong>. Dont forget to give negative integer to <strong>&lt;load-on-startup&gt;&lt;/load-on-startup&gt;</strong> because we wont need it to be loaded when the server is up. We only need the servlet loaded when it called explicitly from our program. You can see more detail about <strong>&lt;servlet&gt;&lt;/servlet&gt;</strong> tag here <a href="http://download.oracle.com/docs/cd/E13222_01/wls/docs81/webapp/web_xml.html#1039287">http://download.oracle.com/docs/cd/E13222_01/wls/docs81/webapp/web_xml.html#1039287</a></p>
<p>The <strong>&lt;servlet-mapping&gt;&lt;/servlet-mapping&gt;</strong> identify when the servlet is called by the program. In our case, the Insert servlet will be called when someone make request to /{context-path}/Insert.</p>
<p><strong>Create User Interface.</strong></p>
<p>Now it&#8217;s time to provide some user interface, i make a simple one with only 1 text-field and a simple scriptlet to view our recently shorted link. You can beautify it if you want. Put it on top of WEB-INF folder as index.jsp, because we want it to be the first page of our program.</p>
<p><pre class="brush: xml;">
&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=ISO-8859-1&quot;
	pageEncoding=&quot;ISO-8859-1&quot;%&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;&gt;
&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;form action=&quot;/url/insert&quot; method=&quot;GET&quot;&gt;
		Long URL: &lt;input type=&quot;text&quot; name=&quot;longUrl&quot; size=&quot;100&quot; /&gt; &lt;input
			type=&quot;submit&quot; value=&quot;Get Short !&quot; /&gt;

	&lt;/form&gt;
	&lt;/p&gt;
	&lt;%
	    if (session.getAttribute(&quot;shortUrl&quot;) != null) {
	%&gt;
	Hi, your short url is:
	&lt;br /&gt;
	&lt;br /&gt;
	&lt;%=session.getAttribute(&quot;shortUrl&quot;)%&gt;

	&lt;%
	    }
	%&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre></p>
<p><img src="http://namingexception.files.wordpress.com/2011/10/url_short_001.jpg?w=450&#038;h=99" alt="url short 001" width="450" height="99" /></p>
<p><strong>Testing Shortening</strong></p>
<p>After we did all the steps above, now we can try it in action. Compile and make a WAR of your recently create application and deploy it on Tomcat. And open the program using your browser. Input the long URL, press the button and you can see the short URL generated below.</p>
<p><img src="http://namingexception.files.wordpress.com/2011/10/url_short_002.jpg?w=450&#038;h=68" alt="url short 002" width="450" height="68" /></p>
<p>the result would be</p>
<p><img src="http://namingexception.files.wordpress.com/2011/10/url_short_003.jpg?w=450&#038;h=107" alt="url short 003" width="450" height="107" /></p>
<p>IF, remember the BIG IF everything runs perfectly, our task isnt done yet. We still have to make a redirector that transforming the short url to the original url.</p>
<p><strong>Creating Servlet to Transform Short Url.</strong></p>
<p>Similar proses like <a href="#Insert"> here</a>. Just type the Retrieve servlet, and be aware of line new Logic().getLongUrl(urlId);. We have had created this before and if you did what i told you before to code the Logic class completely, with all of its functions, the Retrieve servlet code should be perfect.</p>
<p><pre class="brush: java;">
package com.namex.shortener;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Retrieve extends HttpServlet {

    private static final long serialVersionUID = 1293961717469276130L;

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
	    throws ServletException, IOException {

	String urlId = request.getServletPath();

	String longUrl = null;
	if (urlId != null &amp;&amp; !&quot;&quot;.equals(urlId)) {
	    try {
		longUrl = new Logic().getLongUrl(urlId);
	    } catch (Exception e) {
		// handling exception here
		e.printStackTrace();
	    }
	}

	if (longUrl == null) {
	    // if long url not found, send to index.jsp
	    System.out.println(&quot;long url not found, back to index.jsp&quot;);
	    response.sendRedirect(&quot;index.jsp&quot;);
	} else {
	    //if long url found, so redirect the browser
	    System.out.println(&quot;redirecting to &quot;+longUrl );
	    response.sendRedirect(longUrl);
	}
    }

}

</pre></p>
<p><strong>Adjusting web.xml for Retrieve Servlet.</strong></p>
<p>Dont forget we have to adjust the web.xml setting to let the Tomcat identify our servlet. The whole web.xml would be like this.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
	xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd&quot;
	id=&quot;WebApp_ID&quot; version=&quot;3.0&quot;&gt;
	&lt;display-name&gt;URLShortener&lt;/display-name&gt;

	&lt;servlet&gt;
		&lt;servlet-name&gt;Insert&lt;/servlet-name&gt;
		&lt;servlet-class&gt;com.namex.shortener.Insert&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;-1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;

	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;Insert&lt;/servlet-name&gt;
		&lt;url-pattern&gt;/insert&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;

	&lt;servlet&gt;
		&lt;servlet-name&gt;Retrieve&lt;/servlet-name&gt;
		&lt;servlet-class&gt;com.namex.shortener.Retrieve&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;-1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;

	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;Retrieve&lt;/servlet-name&gt;
		&lt;url-pattern&gt;/&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;

	&lt;welcome-file-list&gt;
		&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
	&lt;/welcome-file-list&gt;
&lt;/web-app&gt;
</pre></p>
<p><strong>Test the Whole Shortener.</strong></p>
<p>This is our last part, now you can test the program completely. Run your Tomcat and open our program. Insert the long url and open the short url in your browser, see if it return your page or not.</p>
<p>Now, our Url Shortening service has been created. There are still many ways to implement it using various techniques, we can use SOAP, REST or even EJB to handle the shortening and retrieving url. Now it&#8217;s your turn to improve it and implement it for your own need.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/512/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/512/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/512/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=512&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/10/10/implementing-url-shortener-with-servlet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/10/url_short_001.jpg" medium="image">
			<media:title type="html">url short 001</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/10/url_short_002.jpg" medium="image">
			<media:title type="html">url short 002</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/10/url_short_003.jpg" medium="image">
			<media:title type="html">url short 003</media:title>
		</media:content>
	</item>
		<item>
		<title>How Easy to Make Your Own Twitter Client Using Java</title>
		<link>http://namingexception.wordpress.com/2011/09/12/how-easy-to-make-your-own-twitter-client-using-java/</link>
		<comments>http://namingexception.wordpress.com/2011/09/12/how-easy-to-make-your-own-twitter-client-using-java/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 03:41:51 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter4j]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/?p=491</guid>
		<description><![CDATA[Got inspired by my friend, whom built his own Twitter client for his company&#8217;s client. So, i tried to build one using Java. And im surprised that how easy to make Twitter client, of course i still use third-party API to make my job easier. This simple client will only have 2 purposes: reading timeline [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=491&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Got inspired by my friend, whom built his own <a title="Twitter" href="http://www.twitter.com" target="_blank">Twitter</a> client for his company&#8217;s client. So, i tried to build one using Java. And im surprised that how easy to make Twitter client, of course i still use third-party API to make my job easier.</p>
<p>This simple client will only have 2 purposes: reading timeline and post status. Dont worry, you can expand this application later, it&#8217;s simple and easy once you have your app got authorized by Twitter.</p>
<p>First of all, you have to go to official Twitter Developer Registration at <a href="https://dev.twitter.com/apps/new">https://dev.twitter.com/apps/new</a> , and register your application detail there. For this blog purpose, i will create a new application that called &#8220;<strong>Namex Tweet for Demo</strong>&#8220;. It&#8217;s simple, just fill in some required data and voila it&#8217;s done in seconds.</p>
<p>After you passed this registration step, dont forget the most important things in here are these <strong>Consumer and Consumer Secret key</strong>. Just say, it&#8217;s a signature to let Twitter knows your application. These things will be hardcoded at your application. In here, my Consumer key is <strong>DXjHgk9BHPmekJ2r7OnDg</strong> and my Consumer Secret key is <strong>u36Xuak99M9tf9Jfms8syFjf1k2LLH9XKJTrAbftE0</strong> . Dont use these keys in your application, it&#8217;s useless because i will turn off the application as short as this blogging purpose done.</p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/consumer_key.jpg?w=450&#038;h=193" alt="consumer key" width="450" height="193" /></p>
<p>And after registration step dont forget to visit <strong>Setting</strong> page and adjust setting for your application access.</p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/tab_setting.jpg?w=450&#038;h=85" alt="tab setting" width="450" height="85" /></p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/app_type.jpg?w=450&#038;h=150" alt="app type" width="450" height="150" /></p>
<p>Choose <strong>Read, Write and Access direct messages</strong> to get your application at full functional<strong>.</strong> you now can download additional java API for twitter, im using <a title="Twitter4J" href="http://twitter4j.org/en/index.html" target="_blank">Twitter4J</a> . Here, you have to download several jars,</p>
<ul>
<li>twitter4j-async-&lt;a.b.c&gt;</li>
<li>twitter4j-core-&lt;a.b.c&gt;</li>
<li>twitter4j-media-support-&lt;a.b.c&gt;</li>
<li>twitter4j-stream-&lt;a.b.c&gt;</li>
</ul>
<p><strong>Notes</strong>: <strong>Dont use twitter4j-appengine.jar</strong>, it will cause your application thrown to exception on authorizing process.</p>
<p>In my version a is 2, b is 2 and c is 4. So it would look like <strong>twitter4j-async-2.2.4</strong> etc. After these jars being downloaded at your machine, our downloading job has not done yet. We still have to download <a title="Apache Commons Codec" href="http://commons.apache.org/codec/download_codec.cgi" target="_blank">Apache Commons Codec</a> as Twitter4J dependencies. After all of the jars downloaded, now we can start to code. Open your fave IDE and start it with me.</p>
<p><pre class="brush: java;">
package com.namex.tweet;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;

public class NamexTweet {
    private final static String CONSUMER_KEY = &quot;DXjHgk9BHPmekJ2r7OnDg&quot;;
    private final static String CONSUMER_KEY_SECRET = &quot;u36Xuak99M9tf9Jfms8syFjf1k2LLH9XKJTrAbftE0&quot;;

    public void start() throws TwitterException, IOException {

	Twitter twitter = new TwitterFactory().getInstance();
	twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_KEY_SECRET);
	RequestToken requestToken = twitter.getOAuthRequestToken();
	System.out.println(&quot;Authorization URL: \n&quot;
		+ requestToken.getAuthorizationURL());

	AccessToken accessToken = null;

	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	while (null == accessToken) {
	    try {
		System.out.print(&quot;Input PIN here: &quot;);
		String pin = br.readLine();

		accessToken = twitter.getOAuthAccessToken(requestToken, pin);

	    } catch (TwitterException te) {

		System.out.println(&quot;Failed to get access token, caused by: &quot;
			+ te.getMessage());

		System.out.println(&quot;Retry input PIN&quot;);

	    }
	}

	System.out.println(&quot;Access Token: &quot; + accessToken.getToken());
	System.out.println(&quot;Access Token Secret: &quot;
		+ accessToken.getTokenSecret());

	twitter.updateStatus(&quot;hi.. im updating this using Namex Tweet for Demo&quot;);

    }

    public static void main(String[] args) throws Exception {
	new NamexTweet().start();// run the Twitter client
    }
}
</pre></p>
<p>Compile and run the code, it will create permission for &#8220;<strong>Namex Tweet for Demo</strong>&#8221; to be linked with your Twitter account. Just open the &#8220;<strong>Authorization URL</strong>&#8221; shown at the screen and input the PIN shown by the website. Your application will send back the pin to Twitter, if it&#8217;s match your account will be linked with this new application and you can see you just posted a new status using &#8220;<strong>Namex Tweet for Demo</strong> &#8220;. Congratulation!</p>
<p><strong>Notes</strong>: Authorization URL and PIN will generated differently each time it&#8217;s run.</p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/auth_url.jpg?w=450&#038;h=44" alt="auth url" width="450" height="44" /></p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/auth.jpg?w=357&#038;h=219" alt="auth" width="357" height="219" /> <img src="http://namingexception.files.wordpress.com/2011/09/pin.jpg?w=450&#038;h=82" alt="pin" width="450" height="82" /></p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/update_tweet.jpg?w=356&#038;h=177" alt="update tweet" width="356" height="177" /></p>
<p>In here you can see, we input no username and password of Twitter account but we can use our account within application. Yeah it&#8217;s possible because of <a title="Wikipedia: OAuth" href="http://en.wikipedia.org/wiki/OAuth" target="_blank">OAuth</a> . It &#8220;transformed&#8221; password-input-process to sending-receive-token. So dont worry, Third-party Twitter client application cant read and store no password of your Twitter account. In simple, it&#8217;s safer and prevent password thieving.</p>
<p>Now we still have a tiny problem, at this point, your program still need to open Twitter&#8217;s website and input pin back to the application. So, maybe you are asking on the cloud, do i need this annoying authorization on the future ? well, gladly the answer is NO. At the time your app being authorized by Twitter, you have no use to re-authorize it again &#8212; with a simple note you have to save the <strong>Access Token</strong> and <strong>Secret Access Token</strong> . What the hell is that, how could i get that. Well, you have it already, see the image below, i put it in a big red rectangle so it will be more eye-catchy. In here, our token is and our secret token is. These 2 tokens have to be saved somewhere, you can choose your own method to save it: Persistence, CSV, DBMS, etc. It&#8217;s all up to you.</p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/access_token-1.jpg?w=450&#038;h=83" alt="access token" width="450" height="83" /></p>
<p>So, i saved the tokens! How do i reuse it? It&#8217;s simple, see below code. It&#8217;s how to use your tokens, so you wont have the re-authorization process again. Try to post and read your timeline now.</p>
<p><pre class="brush: java;">
package com.namex.tweet;

import java.io.IOException;

import twitter4j.ResponseList;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;

public class NamexTweet {
    private final static String CONSUMER_KEY = &quot;DXjHgk9BHPmekJ2r7OnDg&quot;;
    private final static String CONSUMER_KEY_SECRET = &quot;u36Xuak99M9tf9Jfms8syFjf1k2LLH9XKJTrAbftE0&quot;;

    public void start() throws TwitterException, IOException {

	Twitter twitter = new TwitterFactory().getInstance();
	twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_KEY_SECRET);

	// here's the difference
	String accessToken = getSavedAccessToken();
	String accessTokenSecret = getSavedAccessTokenSecret();
	AccessToken oathAccessToken = new AccessToken(accessToken,
		accessTokenSecret);

	twitter.setOAuthAccessToken(oathAccessToken);
	// end of difference

	twitter.updateStatus(&quot;Hi, im updating status again from Namex Tweet for Demo&quot;);

	System.out.println(&quot;\nMy Timeline:&quot;);

	// I'm reading your timeline
	ResponseList list = twitter.getHomeTimeline();
	for (Status each : list) {

	    System.out.println(&quot;Sent by: @&quot; + each.getUser().getScreenName()
		    + &quot; - &quot; + each.getUser().getName() + &quot;\n&quot; + each.getText()
		    + &quot;\n&quot;);
	}

    }

    private String getSavedAccessTokenSecret() {
	// consider this is method to get your previously saved Access Token
	// Secret
	return &quot;oC8tImRFL6i8TuRkTEaIcWsF8oY4SL5iTGNkG9O0Q&quot;;
    }

    private String getSavedAccessToken() {
	// consider this is method to get your previously saved Access Token
	return &quot;102333999-M4W1Jtp8y8QY8RH7OxGWbM5Len5xOeeTUuG7QfcY&quot;;
    }

    public static void main(String[] args) throws Exception {
	new NamexTweet().start();
    }

}
</pre></p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/post_again.jpg?w=332&#038;h=162" alt="post again" width="332" height="162" /></p>
<p><img src="http://namingexception.files.wordpress.com/2011/09/tl.jpg?w=450&#038;h=71" alt="tl" width="450" height="71" /></p>
<p>Now our simple Twitter application has been -could be- done, we can read and post to Twitter. Of course, many things still on the task list if you want to make it professionally and -perhaps- sell it. A nice UI, reading and sending Direct Message, Searching Users, Follow and Unfollow. I put these jobs on your shoulder, cause i just want to share it&#8217;s easy to make a Twitter client and i hope this short tutorial can help you in developing Twitter client using Java.</p>
<p align="center">Happy Code All !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/491/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=491&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/09/12/how-easy-to-make-your-own-twitter-client-using-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/consumer_key.jpg" medium="image">
			<media:title type="html">consumer key</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/tab_setting.jpg" medium="image">
			<media:title type="html">tab setting</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/app_type.jpg" medium="image">
			<media:title type="html">app type</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/auth_url.jpg" medium="image">
			<media:title type="html">auth url</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/auth.jpg" medium="image">
			<media:title type="html">auth</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/pin.jpg" medium="image">
			<media:title type="html">pin</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/update_tweet.jpg" medium="image">
			<media:title type="html">update tweet</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/access_token-1.jpg" medium="image">
			<media:title type="html">access token</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/post_again.jpg" medium="image">
			<media:title type="html">post again</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/09/tl.jpg" medium="image">
			<media:title type="html">tl</media:title>
		</media:content>
	</item>
		<item>
		<title>Learn fundamental of Java ? Use ancient JDK</title>
		<link>http://namingexception.wordpress.com/2011/06/27/learn-fundamental-of-java-start-using-ancient-jdk/</link>
		<comments>http://namingexception.wordpress.com/2011/06/27/learn-fundamental-of-java-start-using-ancient-jdk/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 09:42:07 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/?p=451</guid>
		<description><![CDATA[Many Java developers are categorized as a good one in developing program using Java. But, i met so many of them are weak and less in java fundamentals itself. They can develop new program easily. But when i asked, what happening in background of java itself. Only few of them can explain it goodly and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=451&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many Java developers are categorized as a good one in developing program using Java. But, i met so many of them are weak and less in java fundamentals itself. They can develop new program easily. But when i asked, what happening in background of java itself. Only few of them can explain it goodly and in appropriate way. Start to investigate what happening with them, reflecting they are not a newbie as Java Developer, 2 or 3 years in field experience.</p>
<p>After some research about situation and background of few developers. I can pull out my own conclusion, they are facing some fundamental problems because they are started to code using JDK 1.5, i classified this version as modern JDK. In 1.5 and later there are boxing-unboxing feature to make easier relationship between primitive and its wrapper, foreach loop statement to make looping process simpler. We wouldn&#8217;t  see those things in 1.4. In 1.4 we have to use primitive data types and the wrapper explicitly and we still have to do explicit type-casting instead of using foreach. In my simple words: &#8220;Almost everything run by write it!&#8221;.</p>
<p>I&#8217;m not saying here that manual is the best way to do everything, but i found many cases during my professional experience, that with manual ways, we can learn how one process in a code could be done and doing analytic about whats happening with the code.</p>
<p>For the simplest example, look at between 2 pieces of code.</p>
<ul>
<li>int myNumber = new Integer(10);</li>
<li>int mySecondNumber = 10;</li>
</ul>
<p>On JDK 1,5 those codes will produce exact results. Nothing error and nothing produce runtime  exception. I give simple question to some people that declared as Java Developer. Only few of them can give me satisfaction answer.</p>
<p>Now with JDK 1.4 one of those 2 codes will produce error. The first one will produce compilation error. Meanwhile with 1.5, the first one will run perfectly but the code will take some unnecessary processes, means the code will use some space of memory for useless thing.</p>
<p>And yet another example,</p>
<ul>
<li>List&lt;SomeClass&gt;  myList= new ArrayList&lt;SomeClass&gt;();</li>
<li>List mySecondList= new ArrayList();</li>
</ul>
<p>Whats the difference between both lists? well the most common answer i got only, &#8220;You can use foreach for myList but not to mySecondList&#8221;, well the answer is right, i wont hesitate about that. But still, the answer i got wasn&#8217;t the answer that i looking for. I&#8217;m looking for deeper answer, fundamentally.</p>
<p>For the ancient one, i still give 1.4 my humble recommendation. Maybe it&#8217;s a little bias because i started my java code using 1.4, forgive me for this. And please dont take me wrong, i&#8217;m not saying that the latest JDK is bad or automatic process is bad. I believe in thought that Java Architects have done very good job by providing simplicity and easiness in use of Java. But still, responsibility to know Java in fundamental way itself still be ours.</p>
<p>So, if you want to know better about Java Fundamental, maybe you should try ancient JDK. Watch and learn the process. And spread your own knowledge.</p>
<p>Well, i wouldn&#8217;t  give you the answer for the differences of my codes above. Let it be your tasks, considered this is your homework <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And for the last, this article based on my truly experience so maybe the content wont fit you at all. Please share your own or give me correction if you are thinking my article is too cheesy, old-style or maybe too idealist. Im glad to read from you soon <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/451/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=451&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/06/27/learn-fundamental-of-java-start-using-ancient-jdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>
	</item>
		<item>
		<title>Making MyBatis more reuseable</title>
		<link>http://namingexception.wordpress.com/2011/04/19/making-mybatis-more-reuseable/</link>
		<comments>http://namingexception.wordpress.com/2011/04/19/making-mybatis-more-reuseable/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 02:15:04 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ibatis]]></category>
		<category><![CDATA[MyBatis]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/2011/04/19/making-mybatis-more-reuseable/</guid>
		<description><![CDATA[I&#8217;ve been using MyBatis (formerly iBatis) since 2 or 3 years ago, and ive no doubt about this framework&#8217;s capability in handling my needs to do many database operations. But, bad practice in using this can make your code ends painfully, especially when you have to do some code refactoring on it. I just want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=434&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.mybatis.org/java.html">MyBatis </a>(formerly <a href="http://en.wikipedia.org/wiki/IBATIS">iBatis</a>) since 2 or 3 years ago, and ive no doubt about this framework&#8217;s capability in handling my needs to do many database operations.</p>
<p>But, bad practice in using this can make your code ends painfully, especially when you have to do some code refactoring on it. I just want to share several tips and tricks to make your MyBatis application easier to refactor, more reuseable and less dependency.</p>
<ul>
<li><strong>Do the IF in Java level</strong>: as a Programmer, you will and always experiencing many cases of IFs statement, for the simplest, when you want to change the output of null value from database to another value, you can do this query on mysql:
<p><pre class="brush: sql; gutter: false;">
SELECT IFNULL(a_column,'null replacement value') FROM a_table</pre></li>
</ul>
<p> <span style="text-decoration:underline;">AVOID</span> that, that way will make your program has heavy dependency on mysql, because IFNULL is mysql native function, you&#8217;ll experiencing problem if you have to change database platform eg: Sql Server or Oracle. It will be better to let Java handle this for you, like this:</p>
<p><pre class="brush: java; gutter: false;">
if(aColumn==null){
aColumn=&quot;null replacement&quot;; }</pre> </p>
<ul>
<li><strong>Avoid data formatting in MyBatis</strong>: We often change the format of the database output, example: Datetime is the most common datatype that need to be formatted before it being an output, we can do the formatting with something like this,</li>
</ul>
<p><pre class="brush: sql; gutter: false;">SELECT DATE_FORMAT(date_column,'%d-%m-%Y') FROM a_table</pre></p>
<p>Avoid that, same as before, that code practice will has heavy dependency. Just use simple <a href="http://en.wikipedia.org/wiki/American_National_Standards_Institute">ANSI </a>query<br />
<pre class="brush: sql; gutter: false;">
SELECT date_column as dateColumn FROM a_table.
</pre></p>
<p>And let Java takes the formatting job with its available classes, <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat </a>to do datetime formatting, <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/text/NumberFormat.html">NumberFormat </a>for number formatting, and so on. And as an added value you can put the format-pattern in constants or properties so it will be easier if you want to change the pattern.</p>
<ul>
<li><strong>Pass value as parameter</strong>: For the example, In mysql you can retrieve current datetime information with now() function, and in case you want to put current date-time in table, you can write sql command like this:<br />
<pre class="brush: sql; gutter: false;"> 
INSERT INTO a_table(column1, time_stamp) VALUES( #{paramValue},now())
</pre><br />
 <br />Well, stop doing this thing, a better solution, you can write more reuseable query by putting timestamp into parameter and pass it, just like this<br />
<br />
<pre class="brush: sql; gutter: false;"> 
INSERT INTO a_table(column1, time_stamp) VALUES( #{paramValue},#{currentTimestamp}))</pre></li>
<li>
<div style="list-style-type:none;"><strong>Group often used query with &lt;sql&gt; &lt;/sql&gt;:</strong> In one MyBatis XML, we often facing several same part-of-queries and MyBatis is smart to add &lt;sql&gt; as a feature and make it capable to grouping the query, so we can use and reuse it. By using this feature, you can make your query more feasible and easier to refactor.</div>
</li>
</ul>
<p>For example: i used to do data pagination, and i can write the worse solution just like this.<br />
<pre class="brush: xml; gutter: false;">
&lt;!-- Not Recommended, AVOID --&gt;

&lt;select id=&quot;select&quot; resultType=&quot;my.resultBean&quot; parameterType=&quot;my.paramBean&quot;&gt;
SELECT column1, column2 FROM my_table

LIMIT #{startData}, #{dataPerPage}

&lt;/select&gt;
</pre><br />
but, with sql grouping feature, now i can write more elegant query just like this,</p>
<p><pre class="brush: xml; gutter: false;">
&lt;sql id=&quot;pagingSql&quot;&gt;
LIMIT #{startData}, #{dataPerPage}
&lt;/sql&gt;

&lt;select id=&quot;select&quot; resultType=&quot;my.resultBean&quot; parameterType=&quot;my.paramBean&quot;&gt;
SELECT column1, column2 FROM my_table

&lt;include refid=&quot;pagingSql&quot; /&gt;

&lt;/select&gt;
</pre></p>
<p>So with this, now my pagingSql can be used by another query by using &lt;include&gt;<br />
Now, i&#8217;m finish and hoping this short article can help you to write more elegant program using Java and MyBatis.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/434/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/434/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/434/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=434&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/04/19/making-mybatis-more-reuseable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>
	</item>
		<item>
		<title>Dont be a Programmer, be a Consultant</title>
		<link>http://namingexception.wordpress.com/2011/03/29/dont-be-a-programmer-be-a-consultant/</link>
		<comments>http://namingexception.wordpress.com/2011/03/29/dont-be-a-programmer-be-a-consultant/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 03:31:11 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/2011/03/29/dont-be-a-programmer-be-a-consultant/</guid>
		<description><![CDATA[So, what is the difference between them? well imagine the situation i had before. My boss told me to develop a system to retrieve CSV(Comma Separated Value) file that sent by another company. As a programmer, it&#8217;s nice and easy to do, the things i have to do are: Listening to the certain connection. Accept [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=429&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, what is the difference between them? well imagine the situation i had before. My boss told me to develop a system to retrieve CSV(Comma Separated Value) file that sent by another company. As a programmer, it&#8217;s nice and easy to do, the things i have to do are:</p>
<ol>
<li>
<div>Listening to the certain connection.</div>
</li>
<li>
<div>Accept the file.</div>
</li>
<li>
<div>Save the file.</div>
</li>
<li>
<div>And done.</div>
</li>
</ol>
<p>Easy and easy, right? but&#8230; as a consultant, i have to think more than those 4 steps. At least i still have many pre and postconditions, such as:</p>
<ul>
<li>
<div>What if the connection isn&#8217;t established well?</div>
</li>
<li>
<div>What if the client is sending the wrong file?</div>
</li>
<li>
<div>What if the connection down meanwhile process is still on progress?</div>
</li>
<li>What if the client is sending the file twice?</li>
</ul>
<p>What if, what if and what if. They are still many of Ifs available. Of course we cant handle all of the IF situations, but at least we prepared for common and certain problems already. We cant anticipated all of them, but we try to reduce the possibilities.</p>
<p>So, from my point of view, the huge and main differences between Programmer and Consultant are:</p>
<ul>
<li>Programmer does ONLY the code, meanwhile Consultant has to be a solution maker.</li>
<li>Programmer is preparing for now situation, meanwhile, Consultant is preparing the &#8216;future&#8217; condition and try anticipating a new born problem.</li>
<li>Programmer does the job with their technical skill, meanwhile, Consultant does it with combination of Technical Skill and Experience.</li>
<li>Programmer solve the task, meanwhile, Consultant solve the problem.</li>
</ul>
<p>Easy to be a Programmer, you can learn it if you have a passion, patience, and practicing the programming language, but not all of us can be a good consultant, it need time and experience, sometimes the problem cant be solve with common and text-book based solution, sometimes we have to solve it (or patch it) with a tricky solution.</p>
<p>So, from now on, prepare and learn to be a Consultant, not only do the code but try to learn the problem with sense, feel, analyze and give solution for it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/429/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/429/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=429&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/03/29/dont-be-a-programmer-be-a-consultant/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>
	</item>
		<item>
		<title>Install mySQL on CentOS Linux</title>
		<link>http://namingexception.wordpress.com/2011/03/11/install-mysql-on-centos-linux/</link>
		<comments>http://namingexception.wordpress.com/2011/03/11/install-mysql-on-centos-linux/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 09:14:07 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/2011/03/11/install-mysql-on-centos-linux/</guid>
		<description><![CDATA[Installing mysql on CentOS, is easy, as 1,2,3. Though i wouldnt say this will be as easy as windows&#8217;s installation. In this short tutorial i will explain how to do it, via console, as most servers dont have GUI installed. And preassumeably, you are login as root and have active internet connection. Get installation package: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=426&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Installing mysql on <a title="wikipedia: CentOS" href="http://en.wikipedia.org/wiki/CentOS" target="_blank">CentOS</a>, is easy, as 1,2,3. Though i wouldnt say this will be as easy as windows&#8217;s installation.</p>
<p>In this short tutorial i will explain how to do it, via console, as most servers dont have GUI installed. And preassumeably, you are login as <strong>root and have active internet connection.</strong></p>
<ul>
<li style="list-style:none;"></li>
<li>Get installation package: to get mysql installation package easy (CentOS has <a title="wikipedia: YUM" href="http://en.wikipedia.org/wiki/Yellowdog_Updater,_Modified" target="_blank">yum</a> repository manager). Just type <strong>yum install mysql-server</strong> on your CentOS&#8217;s console.</li>
</ul>
<p></p>
<blockquote><p><img alt="1" src="http://namingexception.files.wordpress.com/2011/03/1.jpg?w=450&#038;h=337" width="450" height="337" /> </p>
<p>&nbsp;</p>
<p>Type <strong>y</strong>, and let Yum do its job, until below screen appear.</p>
<p><img alt="2" src="http://namingexception.files.wordpress.com/2011/03/2.jpg?w=450&#038;h=161" width="450" height="161" /></p>
</blockquote>
<p></p>
<ul>
<li style="list-style:none;"></li>
<li>
<div style="margin-right:0;">Make sure mysql is started by typing <strong>/etc/init.d/mysql start</strong></div>
<p></li>
</ul>
<p></p>
<blockquote><p><img alt="4" src="http://namingexception.files.wordpress.com/2011/03/4.jpg?w=450&#038;h=29" width="450" height="29" /></p></blockquote>
<p></p>
<ul>
<li style="list-style:none;"></li>
<li>
<div>run <strong>mysql_secure_installation</strong> to set credential and security for your mysql, and enter your current root password, you can leave it blank because we havent set it up yet. And follow instructions on the screen.</div>
<p></p>
<ul>
<li style="list-style:none;"></li>
<li><strong>Set root password? [Y/n]:</strong> fill with Y if you want to set root password for your mysql. Root password is the top level access for your mysql, so be wise in use it. And dont forget the password.</li>
<li><strong>Remove anonymous users? [Y/n]:</strong> By default, mysql has anonymous user account that can be used by anyone to log into mysql without having user account. Remove anonymous user in production, meanwhile in development is up to you.</li>
<li><strong>Disallow root login remotely? [Y/n]:</strong> If you want <strong>root</strong> can be accessed from remote computer, you have to set it with <strong>n</strong>. By allowing root login remotely, your root account can be accessed from any computer that connected with your mysql machine.</li>
<li><strong>Remove test database and access to it [Y/n]:</strong> By default, mysql has database named &#8216;test&#8217; that used only for testing purpose. You can remove it safely because it has no effect to your mysql system.</li>
<li><strong>Reload privilege tables now? [Y/n]:</strong> Fill with <strong>Y</strong> if you want to reload your privilege that had been set up immediately.</li>
</ul>
</li>
</ul>
<p></p>
<ul>
<li style="list-style:none;"></li>
<li>
<div>run <strong>mysql_install_db</strong> to adjust your mysql system tables.</div>
<p></li>
</ul>
<p></p>
<blockquote><p><img alt="mysql centos 07 Mar. 11 15" src="http://namingexception.files.wordpress.com/2011/03/mysql_centos_07mar-1115-54.jpg?w=450&#038;h=74" width="450" height="74" /></p></blockquote>
<p></p>
<ul>
<li style="list-style:none;"></li>
<li>
<div>Setting CentOS firewall. After your mysql has been installed on your machine, now the last step you have to do is giving firewall privilege to your mysql port, so it can be accessed from remote machine. Of course you have to do it, because in many cases i believe you wont access your mysql directly from your machine. To do this, on your CentOS Console, type <strong>setup</strong> and you will have below screen.</div>
<p></li>
</ul>
<p></p>
<blockquote><p><img alt="mysql centos 09 Mar. 11 15" src="http://namingexception.files.wordpress.com/2011/03/mysql_centos_09mar-1115-55.jpg?w=299&#038;h=274" width="299" height="274" /> </p>
<p>&nbsp;</p>
<p>Choose <strong>Firewall configuration</strong> and <strong>Run Tool</strong> to get into Firewall configuration window.</p>
<p><img alt="mysql centos 10 Mar. 11 16" src="http://namingexception.files.wordpress.com/2011/03/mysql_centos_10mar-1116-07.jpg?w=421&#038;h=308" width="421" height="308" /></p>
<p>Choose <strong>Customize</strong>, and fill <strong>Other ports</strong> with <strong>3306</strong> (default mysql port). And press OK.<img alt="mysql centos 11 Mar. 11 16" src="http://namingexception.files.wordpress.com/2011/03/mysql_centos_11mar-1116-07.jpg?w=450&#038;h=264" width="450" height="264" /></p>
</p>
</blockquote>
<p></p>
<p>Voila, your mysql has been set up, and please let me know if you have any problem installing it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=426&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/03/11/install-mysql-on-centos-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/1.jpg" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/2.jpg" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/4.jpg" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/mysql_centos_07mar-1115-54.jpg" medium="image">
			<media:title type="html">mysql centos 07 Mar. 11 15</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/mysql_centos_09mar-1115-55.jpg" medium="image">
			<media:title type="html">mysql centos 09 Mar. 11 15</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/mysql_centos_10mar-1116-07.jpg" medium="image">
			<media:title type="html">mysql centos 10 Mar. 11 16</media:title>
		</media:content>

		<media:content url="http://namingexception.files.wordpress.com/2011/03/mysql_centos_11mar-1116-07.jpg" medium="image">
			<media:title type="html">mysql centos 11 Mar. 11 16</media:title>
		</media:content>
	</item>
		<item>
		<title>Development Tools I Can&#8217;t Live Without</title>
		<link>http://namingexception.wordpress.com/2011/02/25/development-tools-i-cant-live-without/</link>
		<comments>http://namingexception.wordpress.com/2011/02/25/development-tools-i-cant-live-without/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 03:09:32 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/2011/02/25/development-tools-i-cant-live-without/</guid>
		<description><![CDATA[There are so many Software Development Tools that spread widely on the cloud, and these are my favourites. Im not mentioning they are the best, but they are fit me and i&#8217;m happy to use them in my daily professional life. If you have different opinion, so be my guess. Integrated Development Enviroment (IDE). Candidates: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=414&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are so many Software Development Tools that spread widely on the cloud, and these are my favourites. Im not mentioning they are the best, but they are fit me and i&#8217;m happy to use them in my daily professional life. If you have different opinion, so be my guess. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr />
<strong>Integrated Development Enviroment (IDE).</strong> </p>
<p><strong>Candidates</strong>: Eclipse, Netbeans and JBuilder.</p>
<p><strong>Winner</strong>: Eclipse, eclipse is available freely on the cloud. It has so many plugins, start from various servers plugins, subversion integration, Reporting tools integration and still many more. And now it supports other languages too, such as PHP. Well frankly, i&#8217;m start my career with JBuilder as my escoter through the Java code while im a trainee, but lately i found the eclipse is the better solution compared to JBuilder. I use Netbeans several times found it good, but still eclipse is the most suitable for me, the UI, fonts, shortcut and plugins are so into my style.</p>
<hr />
<strong>Versioning Tool</strong> </p>
<p><strong>Candidates</strong>: Microsoft Visual Source Safe (VSS) and Subversion (SVN).</p>
<p><strong>Winner</strong>: SVN. Compared to VSS, SVN is free and open source, thats one point. The second point is, SVN can be installed on cross platforms, server on Linux and Client uses Windows, they are not a problem at all. If you asked me, i have no trust on Windows to handle my entire source codes, since it has so many vulnerabilities on security issues, such as: virus attack. Can you imagine, the whole project&#8217;s source code is vanished by a virus ? just in a second, your job will be gone by (almost) forever. The third point is, SVN can be accessed from many varians of clients, RapidSVN, TortoiuseSVN, can be integrated with Eclipse through plugin feature, and it can be accessed with Command Line Interface too, just in case you have no UI Manager installed.</p>
<hr />
<strong>Application Server</strong> </p>
<p><strong>Candidates</strong>: Weblogic, Tomcat, Glassfish</p>
<p><strong>Winner</strong> : Glassfish and Tomcat. On this category, i have double winners. Tomcat win because of the simplicity, it&#8217;s so easy to install and using it, even if you are still a green developer. If you just (keep in mind: JUST) looking for an application container server and you arent using many J2EE features, such as: JMS, Connection Pooling,etc. i would love to give Tomcat two thumbs up. BUT, if you are looking for a container server and have a need in using many J2EE Enterprise Server Features, use Glassfish, it&#8217;s free, open source, has so many users, easy to use, set up and to manage. Weblogic is a good (if not the best) application server that i had used before, but sometimes, i found it hard to use and expensive too to be use as production server, Weblogic trial version is free but only allow 5 concurrent users.</p>
<hr />
<strong>Database Engine</strong> </p>
<p><strong>Candidates</strong>: Oracle, mySQL, Sql Server.</p>
<p><strong>Winner</strong>: Nobody, each server has their own usage domain. Examples: If you looking for a free, cross-platform,easiness and liteness, use mySQL. If you are a Sql Server Expert and have support license of Sql Server and only use Windows OS, use Sql Server. If you looking for a huge features of DBMS Engines and when money isnt big problem for you use Oracle. So, i cant decided which one is the best, i use them all and found they have their own unique features depend on the case.</p>
<hr />
<strong>Plain Text Editor</strong> </p>
<p><strong>Candidates</strong>: Notepad++, PSPad</p>
<p><strong>Winner</strong>: Notepad++. Both are free, support plugins, and support programming language style highlighter. But i found PSPad works slowly when experiencing with huge size of text files, Log files for the example. Meanwhile, Notepad++ can open it faster (though not fast or fastest).</p>
<p>&nbsp;</p>
<hr />
<strong>Database Designer</strong> </p>
<p>&nbsp;</p>
<p><strong>Candidates</strong>: Mysql Workbench, Software Ideas Modeler, Power Architect, Microsoft Visio.</p>
<p><strong>Winner</strong> : Power Architect. It&#8217;s free, easy to use and cross platforms. Frankly, Workbench works greatly, but i found so many bugs on it and it only supports for the mySQL DBMS. So when i have to handling other DBMSs, it won&#8217;t work, for example:I can&#8217;t design table that handling Oracle&#8217;s Varchar2. So, i choose Architect as a winner. Software Ideas is great too, but i prefer Power Architect because of the taste of UI Flavour. And Visio, though many developers like it, i&#8217;m not a big fan of it.</p>
<hr />
<strong>PDF Creator</strong> </p>
<p><strong>Candidates</strong>: Cute PDF Writer, Primo PDF</p>
<p><strong>Winner</strong>: Cute PDF Writer. Though my main job is Software Developer, sometimes, i have to handling with documentation problem. Such as: Database Design, Source code documentation, and Coding Guideline. I think it would be nice and neat to give the document on PDF format, it can be opened cross platforms, from browsers and even from mobile devices. So I need the PDF Creator to give me a hand to create PDF documentation. I found Cute PDF is faster and more bug free rather than Primo PDF. I use Primo for the first time and got good impression on it, until my OS got crashed and became nag screen every time i tried to create a PDF, meanwhile with Cute PDF, i can create PDF smoothly.</p>
<p>&nbsp;</p>
<hr />
<strong>File Merge and Compare</strong></p>
<p>&nbsp;</p>
<p><strong>Candidates</strong>: Beyond Compare, WinMerge</p>
<p><strong>Winner</strong>: WinMerge. Why WinMerge is my winner, it can be integrated into Subversion, so i can easily use WinMerge from inside the Subversion to determine the difference and do the merge between two files.</p>
<p>&nbsp;</p>
<hr />
<strong>SSH Client</strong></p>
<p><strong>Candidates</strong>: Putty, WinSCP</p>
<p><strong>Winner</strong>: WinSCP. Absolutely WinSCP is a winner. Nice GUI, easy to use, and can &#8216;translate&#8217; the console view into nice UI experience. Though, i&#8217;m still looking for a better SSH Client, still i couldn&#8217;t found anything better.</p>
<hr />
<p>Well, i think those are all. Based from my personal taste, those are the best and the most suitable for me. Please let me know if you have anything better or any disagreement.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/414/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/414/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/414/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=414&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/02/25/development-tools-i-cant-live-without/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>
	</item>
		<item>
		<title>Singleton vs Prototype Spring injection</title>
		<link>http://namingexception.wordpress.com/2011/01/03/singleton-vs-prototype-spring-injection-3/</link>
		<comments>http://namingexception.wordpress.com/2011/01/03/singleton-vs-prototype-spring-injection-3/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 08:27:52 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[singleton]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/?p=399</guid>
		<description><![CDATA[For a newbie developer that just started their journey in the Spring auto injection world. I will explain about the differences Singleton and Protoype Spring Injection. To make it easier i will create a simple POJO Java Class that only contain one property and its setter getter. SINGLETON And for the first, we will advancing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=399&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For a newbie developer that just started their journey in the <a href="http://www.springsource.org" target="_blank">Spring</a> auto injection world. I will explain about the differences Singleton and Protoype Spring Injection.</p>
<p>To make it easier i will create a simple POJO Java Class that only contain one property and its setter getter.</p>
<p><pre class="brush: java;">

package com.namex.spring;

public class NamexBean {
 private String myMessage;

public String getMyMessage() {
 return myMessage;
 }

public void setMyMessage(String myMessage) {
 this.myMessage = myMessage;
 }

}

</pre></p>
<p><strong>SINGLETON</strong></p>
<p>And for the first, we will advancing the singleton scope.</p>
<p><pre class="brush: xml; wrap-lines: false;">

&lt;beans xmlns=&quot;&lt;a href=&quot;http://www.springframework.org/schema/beans&quot;&gt;http://www.springframework.org/schema/beans&lt;/a&gt;&quot;
 xmlns:xsi=&quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&quot;
 xsi:schemaLocation=&quot;&lt;a href=&quot;http://www.springframework.org/schema/beans&quot;&gt;http://www.springframework.org/schema/beans&lt;/a&gt;

&lt;a href=&quot;http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&quot;&gt;http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&lt;/a&gt;&quot;&gt;

&lt;bean id=&quot;namexBean&quot; class=&quot;com.namex.spring.NamexBean&quot; scope=&quot;singleton&quot; /&gt;

&lt;/beans&gt;

</pre></p>
<p>By default, spring has its scope as a &#8220;singleton&#8221;, so you if you not specifiying the scope attribute, it will be the &#8220;singleton&#8221;.</p>
<p>Now, i will create my java tester class, to start to test the effect of the singleton scope.</p>
<p><pre class="brush: java;">

package com.namex.spring;

import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Tester {
 public static void main(String[] args) {
 ApplicationContext context = new ClassPathXmlApplicationContext(
 new String[] { &quot;Spring-Context.xml&quot; });

NamexBean firstBean = (NamexBean) context.getBean(&quot;namexBean&quot;);
 firstBean.setMyMessage(&quot;This is the first bean's message&quot;);
 System.out.println(&quot;firstBean: &quot; + firstBean.getMyMessage());

NamexBean secondBean = (NamexBean) context.getBean(&quot;namexBean&quot;);
 System.out.println(&quot;secondBean: &quot; +secondBean.getMyMessage());
 }
 }

</pre></p>
<p>the output would be:</p>
<p><pre class="brush: plain;">

firstBean: This is the first bean's message

secondBean: This is the first bean's message

</pre></p>
<p>Now, it&#8217;s clear, with the singleton scope, spring will create one instance that will be shared across among others. So they will be have the same memory reference.</p>
<p><strong>PROTOTYPE</strong></p>
<p>Now how about with the Prototype?</p>
<p><pre class="brush: xml; wrap-lines: false;">

&lt;beans xmlns=&quot;&lt;a href=&quot;http://www.springframework.org/schema/beans&quot;&gt;http://www.springframework.org/schema/beans&lt;/a&gt;&quot;
 xmlns:xsi=&quot;&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&quot;
 xsi:schemaLocation=&quot;&lt;a href=&quot;http://www.springframework.org/schema/beans&quot;&gt;http://www.springframework.org/schema/beans&lt;/a&gt;

&lt;a href=&quot;http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&quot;&gt;http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&lt;/a&gt;&quot;&gt;

&lt;bean id=&quot;namexBean&quot; class=&quot;com.namex.spring.NamexBean&quot; scope=&quot;prototype&quot; /&gt;

&lt;/beans&gt;

</pre></p>
<p><pre class="brush: java;">

package com.namex.spring;

import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Tester {
 public static void main(String[] args) {
 ApplicationContext context = new ClassPathXmlApplicationContext(
 new String[] { &quot;Spring-Context.xml&quot; });

NamexBean firstBean = (NamexBean) context.getBean(&quot;namexBean&quot;);
 firstBean.setMyMessage(&quot;This is the first bean's message&quot;);
 System.out.println(&quot;firstBean: &quot; + firstBean.getMyMessage());

NamexBean secondBean = (NamexBean) context.getBean(&quot;namexBean&quot;);
 System.out.println(&quot;secondBean: &quot; +secondBean.getMyMessage());
 }
 }</pre></p>
<p>the output would be:</p>
<p><pre class="brush: plain;">

firstBean: This is the first bean's message

secondBean: null

</pre></p>
<p>It&#8217;s obvious that the Prototype scope create a new instance and not shared the instance among.</p>
<p><strong>WHICH ONE IS BETTER ?</strong></p>
<p>The answer is really simple: it&#8217;s depend. Depend in which way you need the code to do and how you code it.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/399/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=399&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/01/03/singleton-vs-prototype-spring-injection-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>
	</item>
		<item>
		<title>How to run iBatis using Namespace</title>
		<link>http://namingexception.wordpress.com/2011/01/03/how-to-run-ibatis-sqlmap-with-the-namespace/</link>
		<comments>http://namingexception.wordpress.com/2011/01/03/how-to-run-ibatis-sqlmap-with-the-namespace/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 07:43:06 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ibatis]]></category>
		<category><![CDATA[namespace]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/?p=383</guid>
		<description><![CDATA[Have you ever run the query i the iBatis Sqlmap and got the erroneous lines of code when you use the namespace into it? com.ibatis.sqlmap.client.SqlMapException: There is no statement named Salesman.insert  in this SqlMap. It easy enough to solve the problem, just add the line below in your iBatis Configuration and make sure you now use the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=383&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever run the query i the iBatis Sqlmap and got the erroneous lines of code when you use the namespace into it?</p>
<blockquote><p>com.ibatis.sqlmap.client.SqlMapException: There is no statement named Salesman.insert  in this SqlMap.</p></blockquote>
<p>It easy enough to solve the problem, just add the line below in your iBatis Configuration and make sure you now use the namespace when calling it.</p>
<p><pre class="brush: xml;">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;&lt;!DOCTYPE sqlMapConfigPUBLIC &quot;-//iBATIS.com//DTD SQL Map Config 2.0//EN&quot;&quot;http://www.ibatis.com/dtd/sql-map-config-2.dtd&quot;&gt;
&lt;sqlMapConfig&gt;

&lt;settings useStatementNamespaces=&quot;true&quot; /&gt; &lt;!-- add this line --&gt;

&lt;sqlMap resource=&quot;ibatis/Web-Registration-Report.xml&quot; /&gt;

&lt;/sqlMapConfig&gt;

</pre></p>
<p>Be aware. Since now, your code will produce error if you not using the namespace. So it will be wiser to make a final decision whether to use the namespace or not.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/383/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=383&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2011/01/03/how-to-run-ibatis-sqlmap-with-the-namespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>
	</item>
		<item>
		<title>Working with DTD in Eclipse</title>
		<link>http://namingexception.wordpress.com/2010/11/29/working-with-dtd-in-eclipse/</link>
		<comments>http://namingexception.wordpress.com/2010/11/29/working-with-dtd-in-eclipse/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 06:49:50 +0000</pubDate>
		<dc:creator>RDeJourney</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[dtd]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://namingexception.wordpress.com/?p=359</guid>
		<description><![CDATA[DTD, Document Type Definition, can help you when you are writing XML file. DTD can force XML rule integrity, so you won&#8217;t write wrong XML Scheme. In eclipse, DTD can help you in writing XML with its intellisense feature, just like you do the Java. Just type any word and help will came after you. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=359&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Wiki: Document Type Definition" href="http://en.wikipedia.org/wiki/Document_Type_Definition" target="_blank">DTD</a>, Document Type Definition, can help you when you are writing XML file. DTD can force XML rule integrity, so you won&#8217;t write wrong XML Scheme.</p>
<p>In <a title="Wiki: Eclipse IDE" href="http://en.wikipedia.org/wiki/Eclipse_(software)" target="_blank">eclipse</a>, DTD can help you in writing XML with its intellisense feature, just like you do the <a title="Wiki: Java Programming Language" href="http://en.wikipedia.org/wiki/Java_(programming_language)" target="_blank">Java</a>. Just type any word and help will came after you.</p>
<p>To insert DTD file in eclipse is such an easy problem, just run your eclipse and point your mouse at <strong>Window -&gt; Preferences -&gt; Web and XML -&gt; XML Catalog</strong>, if you point it correctly you will see this screen.</p>
<p><img class="alignnone" title="DTD" src="http://img829.imageshack.us/img829/3334/dtd1.gif" alt="" width="522" height="393" /></p>
<p>Click <strong>Add&#8230;</strong> Button and fill Information about your DTD,  i will explain how to determine <span style="text-decoration:underline;">Key </span>and <span style="text-decoration:underline;">Web Address</span> informations from the XML file, later.</p>
<p><img class="alignnone" title="DTD" src="http://img30.imageshack.us/img30/2426/dtd2.gif" alt="" width="509" height="329" /></p>
<p>Now <strong>OK</strong>, and create your XML file, just like below and press<strong> CTRL+SPACE</strong> to ensure you have inserted the DTD correctly. If the intellisense came out perfectly, we can assume that Eclipse can handle your DTD perfectly now.</p>
<p><img class="alignnone" style="border:1px solid black;" title="DTD" src="http://img251.imageshack.us/img251/5008/dtdintellisense.png" alt="" width="611" height="386" /></p>
<p>As i promised, now i will explain about relating XML to its DTD. See the picture below and i thought now you can determine it by yourself.</p>
<p><img class="alignnone" style="border:1px solid black;" title="XML-DTD" src="http://img46.imageshack.us/img46/639/xmldtd.png" alt="" width="511" height="463" /></p>
<p>Pretty simple huh. Well, hope this short tutorial would be useful for you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/namingexception.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/namingexception.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/namingexception.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/namingexception.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/namingexception.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/namingexception.wordpress.com/359/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/namingexception.wordpress.com/359/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/namingexception.wordpress.com/359/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=namingexception.wordpress.com&amp;blog=6617758&amp;post=359&amp;subd=namingexception&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://namingexception.wordpress.com/2010/11/29/working-with-dtd-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/30e3fc0772d51634303d32c5b79e7f26?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Dhe-Jhe</media:title>
		</media:content>

		<media:content url="http://img829.imageshack.us/img829/3334/dtd1.gif" medium="image">
			<media:title type="html">DTD</media:title>
		</media:content>

		<media:content url="http://img30.imageshack.us/img30/2426/dtd2.gif" medium="image">
			<media:title type="html">DTD</media:title>
		</media:content>

		<media:content url="http://img251.imageshack.us/img251/5008/dtdintellisense.png" medium="image">
			<media:title type="html">DTD</media:title>
		</media:content>

		<media:content url="http://img46.imageshack.us/img46/639/xmldtd.png" medium="image">
			<media:title type="html">XML-DTD</media:title>
		</media:content>
	</item>
	</channel>
</rss>
