<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CEUNSH87cCp7ImA9WxNbEEw.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828</id><updated>2009-11-12T04:51:39.108-03:00</updated><title>Software Development</title><subtitle type="html">- Enjoy it !</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://hofmanndavid.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://hofmanndavid.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-sa/3.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><link rel="self" href="http://feeds.feedburner.com/blogspot/owlA" type="application/atom+xml" /><feedburner:emailServiceId>blogspot/owlA</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/blogspot/owlA" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://www.addtoany.com/?linkname=Software%20Development&amp;linkurl=http%3A%2F%2Ffeeds.feedburner.com%2Fblogspot%2FowlA&amp;type=feed" src="http://www.addtoany.com/addfr-b.gif">Add to Any Feed Reader</feedburner:feedFlare><feedburner:browserFriendly>I RECOMENT GOOGLE</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;DkcGQn86eCp7ImA9WxJWFUg.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-5657995736604974284</id><published>2009-05-04T06:36:00.002-04:00</published><updated>2009-06-20T23:13:43.110-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-20T23:13:43.110-04:00</app:edited><title>Timeless quotes ...</title><content type="html">Hi all !&lt;br /&gt;
&lt;br /&gt;
I was looking for interesting quotes every week since I started my last job and now that I've collected a lof of them I want to share it. For some of the quotes I am not sure to whom it belongs, so I decided to let you google for the atributions :)&lt;br /&gt;
&lt;br /&gt;
Enjoy it !&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Realize that declarative programing is as easy as the 1300 pages&amp;nbsp;manual is showing it is :)&lt;/li&gt;
&lt;li&gt;Everything should be made as simple as possible, but not simpler&lt;/li&gt;
&lt;li&gt;Imagination is more important than knowledge&lt;/li&gt;
&lt;li&gt;Don't let your victories go to your head, or your failures go to your heart&lt;/li&gt;
&lt;li&gt;When the only tool you have is a hammer, everything looks like a nail&lt;/li&gt;
&lt;li&gt;Certified coffee addict !&lt;/li&gt;
&lt;li&gt;The question of whether computers can think is like the question of whether submarines can swim&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Knowledge talks, Wisdom listens&lt;/li&gt;
&lt;li&gt;UNIX motto: Provide mechanisms, not policy&lt;/li&gt;
&lt;li&gt;In theory, there is no difference between theory and practice, but in practice, there is :(&lt;/li&gt;
&lt;li&gt;An expert is someone who has made all possible mistakes in a very narrow field&lt;/li&gt;
&lt;li&gt;Before we work on artificial intelligence why don't we do something about natural stupidity ?&lt;/li&gt;
&lt;li&gt;C makes it easy to shut your foot if you want, C++ makes it a little bit harder, but when you finaly do, it blows out your whole leg !&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Imposible, es solo una opinion.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Style distinguishes excellence from accomplishment&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Simplicity is prerequisite for reliability&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;You are finally taking a shower ... now your phone rings ... and when you reach your phone to answer ... it was a wrong number&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;A documented bug is not a bug, it is a feature&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away&lt;/li&gt;
&lt;li&gt;Weeks of programming can save you hours of planning&lt;/li&gt;
&lt;li&gt;Computer science is an immature discipline, and I aim to keep it that way&lt;/li&gt;
&lt;li&gt;The great thing about Object Oriented code is that it can make small,&amp;nbsp;simple problems look like large, complex ones&lt;/li&gt;
&lt;li&gt;A good developer will understand the business implications of&amp;nbsp;technical decisions&lt;/li&gt;
&lt;li&gt;Always code as if the person who will maintain your work is a serial&amp;nbsp;killer that knows where you live&lt;/li&gt;
&lt;li&gt;Simplicity carried to the extreme becomes elegance&lt;/li&gt;
&lt;li&gt;A good developer can translate words and ideas into code, a good engineer creates those words and ideas&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;In order to understand recursion, one must first understand recursion :)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;We follow two rules in the matter of optimization: Rule 1. Don’t do it. Rule 2 (for experts only). Don’t do it yet—that is, not until you have a perfectly clear and unoptimized solution&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;One mistake and you have to support it for the rest of your life&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Working with communities is more productive&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Once you get started, you’ll only stop because you’re exhausted&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;It takes another experienced person to really appreciate what you’re doing&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;One little thing going wrong can ruin everything.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Truly great programmers do not exist, there are only those who claim to be great, and those who know they are not great&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;And these ones comes from wikipedia &lt;a href="http://en.wikipedia.org/wiki/The_Seven_Habits_of_Highly_Effective_People"&gt;Seven habits of higly effective people&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Be Proactive: Principles of Personal Choice&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Begin with the End in Mind: Principles of Personal Vision&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Put First Things First: Principles of Integrity &amp;amp; Execution&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Think Win/Win: Principles of Mutual Benefit&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Seek First to Understand, Then to be Understood: Principles of Mutual Understanding&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Synergize: Principles of Creative Cooperation&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Sharpen the Saw: Principles of Balanced Self-Renewal&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;[UPDATE]&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Typing is not now and never has been the bottleneck in writing code&lt;/li&gt;
&lt;li&gt;Software entities should be open for extension, but closed for modification.&lt;/li&gt;
&lt;li&gt;Buy the best, build the rest&lt;/li&gt;
&lt;li&gt;The most difficult thing in the world is to know how to do a thing and to watch someone else do it wrong without comment.&lt;/li&gt;
&lt;li&gt;Use the simplest thing that could possibly work&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-5657995736604974284?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=5657995736604974284" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/5657995736604974284?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/5657995736604974284?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/EM0vUpd4ocw/timeless-quotes.html" title="Timeless quotes ..." /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2009/05/timeless-quotes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4BSXs5fCp7ImA9WxVVGUg.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-6847785764612037703</id><published>2009-03-11T09:28:00.005-04:00</published><updated>2009-03-13T11:42:38.524-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-13T11:42:38.524-04:00</app:edited><title>Where do you host your website to scale ?</title><content type="html">I have been talking to some colleagues about how to start a project that you know it will probably need to scale in a couple of months, think of a heavy text content site. [&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;update&lt;/span&gt;: like a lyrics site with kind of social features added to it, with urls that makes the search engines happy]&lt;br /&gt;
&lt;br /&gt;
Actually what we have as far as I know are services like &lt;a href="http://code.google.com/appengine/"&gt;google appengine&lt;/a&gt;, that provides you with a full api where you can build your web site. You know they give you processor time, storage space in their&amp;nbsp;datastore, kind of non-relational ( but scalable ) database and a lot of network throughput. What I like about this service is that you pay very little money for a lot of resources, at least as far as know.&lt;br /&gt;
&lt;br /&gt;
Then you have virtualization services like &lt;a href="http://www.linode.com/index.cfm"&gt;linode&lt;/a&gt; and &lt;a href="http://aws.amazon.com/"&gt;amazon ec2&lt;/a&gt; and other services that I like more because it gives you full control of how to program your site without limiting you with a closed api or closed vendeor.&lt;br /&gt;
&lt;br /&gt;
Microsoft also offer public cloud computing services called &lt;a href="http://www.microsoft.com/azure/default.mspx"&gt;azure&lt;/a&gt; and I think &lt;a href="http://developer.yahoo.com/yap/"&gt;yahoo&lt;/a&gt; also.&lt;br /&gt;
&lt;br /&gt;
But here are some things to have in mind. I don't have a good feeling about who's the real owner of your application since you upload your code to google appengine for example. Or then you fear that they'll say you that your application violates some policies you were supposed to follow. Well, I think you understand.&lt;br /&gt;
&lt;br /&gt;
I think comparing services like appengine and the ones that offer virtualization creates you another problem if for any reason you need to move from one to another, because you probably will need to re-enginer the urls if you'll change the way you are programing and you know, there goes all your page ranking and you'll have broken links if you gained some of them before wanting to move your application.&lt;br /&gt;
&lt;br /&gt;
I am sorry if my English is irritating you, but this is as far as I can talk, what I want to know from you is what will be your thoughts on this topic. What will be the service you'll choose and why. Which services are you using and what is your experience in it.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-6847785764612037703?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=6847785764612037703" title="10 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/6847785764612037703?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/6847785764612037703?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/JHGGNxNEdjg/where-do-you-host-your-website-to-scale.html" title="Where do you host your website to scale ?" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">10</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2009/03/where-do-you-host-your-website-to-scale.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcHSHk4eSp7ImA9WxRbFkw.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-8111554329557948191</id><published>2008-11-24T12:55:00.004-03:00</published><updated>2008-12-06T22:07:19.731-03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-06T22:07:19.731-03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="deployment" /><title>An approach to configurable parameters</title><content type="html">It is annoying how much work you need to do just to get all the properties from the file mapped to a class catching all the exceptions and repeating many times the same keys&amp;nbsp;thorough&amp;nbsp;the configuration files. For example, normally I had before a class that has static String variables each one mapping a key in the property file and then I use those variables when loading the properties and validating, etc.&lt;br /&gt;
&lt;br /&gt;
When you need to load some properties from a file to your application in order to have some configurable parameters normally you use an external file in case of having a Java SE application or a resource bundled in your Java package such as yourwar/META-INF/applicationProperties.xml.&lt;br /&gt;
&lt;br /&gt;
I have write some dirty (ugly) code just to give you an idea of how that can be easier.&lt;br /&gt;
&lt;br /&gt;
Supose the next scenario.&lt;br /&gt;
you have a applicationProperties.xml file&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;properties&amp;gt;&lt;br /&gt;
&amp;lt;comment&amp;gt;&lt;br /&gt;
The good thing of using the xml version of properties file is that &lt;br /&gt;
it is "easy" to see the whitespaces that normally endup at the end of &lt;br /&gt;
the strings and most of the times we forget to use value.trim() ...&lt;br /&gt;
and then some time is spent for that stupid bug&lt;br /&gt;
&amp;lt;/comment&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;entry key="connectionString"&amp;gt;jdbc:h2:file:c:\h2db\dbName&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;entry key="user"&amp;gt;sa&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;entry key="password"&amp;gt;saadmin&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;entry key="poolSize"&amp;gt;7&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;entry key="timeoutMillis"&amp;gt;7000&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;entry key="retryInterval"&amp;gt;3&amp;lt;/entry&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/properties&amp;gt;&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
and the next class mapping your file properties&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;public class ConfigurableParameters {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public String _connectionString;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public String _user;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public String _password;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Integer _poolSize;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public Long _timeoutMillis;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public Integer _retryInterval;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; private static ConfigurableParameters instance;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public static ConfigurableParameters getInstance() {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (instance == null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; instance = new ConfigurableParameters();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;return instance;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
You see, the only time where you repeated the keys are in the name of the variables of the class. Now,&amp;nbsp;wouldn't it be nice to load all the properties like this ?&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;public static void main(String[] args) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;boolean confSuccess = ConfigurationHelper.mapConfigurableProperties(&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ConfigurationSource.FILE,&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "applicationProperties.xml",&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ConfigurableParameters.getInstance());&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (!confSuccess) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Error loading configuration");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(ConfigurableParameters.getInstance()._connectionString);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(ConfigurableParameters.getInstance()._user);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(ConfigurableParameters.getInstance()._password);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(ConfigurableParameters.getInstance()._poolSize);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(ConfigurableParameters.getInstance()._timeoutMillis);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(ConfigurableParameters.getInstance()._retryInterval);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
The reason I make that the function recognizes all the fields starting with an underscore is just to make it clear that it will expect that those fields have a key in the properties file.&lt;br /&gt;
&lt;br /&gt;
Actually You can make the fields of&amp;nbsp;ConfigurableParameters class to be private and just provide public getters, it will still set the parameters. Also you can load the properties from a bundle file resource of the packaged jar, just call the method with ConfigurationSource.RESOURCE, and your sourceAddress would be something like "/META-INF/applicationProperties.xml", depending where did you put the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The implementation for the ConfigurationHelper is here&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;public class ConfigurationHelper {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public enum ConfigurationSource {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;RESOURCE, FILE&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; public static boolean mapConfigurableProperties(ConfigurationSource configurationSource, String sourceAddress, Object target) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (configurationSource == null || sourceAddress == null || target == null )&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Properties sourceProperties =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getSourceProperties(configurationSource, sourceAddress, target);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (sourceProperties.isEmpty())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (Field f : target.getClass().getDeclaredFields()) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String fieldName = f.getName();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!fieldName.startsWith("_"))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fieldName = fieldName.substring(1);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!sourceProperties.containsKey(fieldName))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;boolean originalAccesibleValue = f.isAccessible();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;f.setAccessible(true);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;f.set(target, getConvertedValueForType((String) sourceProperties.get(fieldName), f.getType()));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;f.setAccessible(originalAccesibleValue);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (Exception e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; private static Properties getSourceProperties(ConfigurationSource configurationSource, String sourceAddress, Object target) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Properties prop = new Properties();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStream is =&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;configurationSource == ConfigurationSource.FILE ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new FileInputStream(sourceAddress) :&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;target.getClass().getResourceAsStream(sourceAddress);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prop.loadFromXML(is);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; is.close();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;} catch (Exception e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;return prop;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; private static Object getConvertedValueForType(String sourceValue, Class c) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Object convertedValue = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (c == String.class) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; convertedValue = sourceValue;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;else if (c == Long.class) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; convertedValue = new Long((String) sourceValue);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;else if (c == Integer.class) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; convertedValue = new Integer((String) sourceValue);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;else if (c == BigDecimal.class) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; convertedValue = new BigDecimal((String) sourceValue);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;return convertedValue;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
This all may seem out of the standard conventions and I just didn't think of another way of doing this. It is just an idea of how can you make the work of loading configurable properties easier.&lt;br /&gt;
&lt;br /&gt;
Have fun trying it and please give me feedback about how you are doing it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-8111554329557948191?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=8111554329557948191" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/8111554329557948191?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/8111554329557948191?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/w_FNN-TDfpo/approach-to-configurable-parameters.html" title="An approach to configurable parameters" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/11/approach-to-configurable-parameters.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QBRXY6fSp7ImA9WxVUEkQ.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-1062145681464285756</id><published>2008-11-21T00:04:00.007-03:00</published><updated>2009-03-17T10:15:54.815-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-17T10:15:54.815-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="deployment" /><category scheme="http://www.blogger.com/atom/ns#" term="webservices" /><title>Easiest way to publish Java Web Services --how to</title><content type="html">&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;In a &lt;a href="http://hofmanndavid.blogspot.com/2008/10/easy-webservices-in-java-not-common-way.html"&gt;previous post&lt;/a&gt; I wrote about publishing a Web Service through an embeddable ejb3 implementation, which is good since @Stateless beans can have injected managed entityManagers, in some cases that is the way to go if you don't want to deploy your app in a full J2EE server or you need a more flexible environment.&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;Just days ago I found that the J2SE itself has an lightweight http server embedded into, and the API itself has an Endpoint class that allows you to publish a Web Service in a J2SE environment.&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;There is more than one way for doing this, but this is the more automatic I could found, the next is a working example. The JRE version I am using is 6 update 7, I am not sure since when it supports it&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;-----&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.jws.WebService;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.jws.soap.SOAPBinding;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.jws.soap.SOAPBinding.Style;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;import javax.xml.ws.Endpoint;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; font-family: 'Times New Roman'; font-size: 16px; white-space: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;@WebService&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;@SOAPBinding(style=Style.RPC) // without this it does not work automatically.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;public class ASimpleTest {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;    public static class WebServiceTest {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;        public String callMe(String name) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;            return "Hello "+name+" !";       &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;    public static void main(String[] args) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;       Endpoint.publish("http://localhost:8080/sayHello",&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;                        new WebServiceTest());&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;       // http://localhost:8080/sayHello?wsdl will be the&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;       // place for the wsdl generated on the fly&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: 'Courier New'; font-size: 13px; white-space: pre-wrap;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: 'Courier New'; font-size: 13px; white-space: pre-wrap;"&gt;       // remember to use the DNS address of your IP or&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: 'Courier New'; font-size: 13px; white-space: pre-wrap;"&gt;       // your IP itself if you want to expose so&amp;nbsp;as to&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: 'Courier New'; font-size: 13px; white-space: pre-wrap;"&gt;       // be accessible not only from localhost or&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: 'Courier New'; font-size: 13px; white-space: pre-wrap;"&gt;       // 127.0.0.1&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; }&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;-----&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; font-weight: bold; white-space: pre-wrap;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;&lt;span style="font-weight: bold;"&gt;Now you wonder how does this work ?&lt;/span&gt; Well, as you publish(...) it starts its embedded http server and binds the webservice automatically generated from the WebServiceTest class to the ip:port you've specified. The threading configuration should be quite ok for most cases.&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: arial; font-size: 13px; white-space: pre-wrap;"&gt;Have fun trying it !&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-1062145681464285756?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=1062145681464285756" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/1062145681464285756?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/1062145681464285756?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/99NtYeR_bv8/easiest-way-to-publish-java-web.html" title="Easiest way to publish Java Web Services --how to" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/11/easiest-way-to-publish-java-web.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QARnk7eip7ImA9WxRUEUo.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-1906016947233432439</id><published>2008-11-12T18:29:00.002-03:00</published><updated>2008-11-20T05:55:47.702-03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-20T05:55:47.702-03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="deployment" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Run Java application as Windows Services</title><content type="html">Sometimes you need to execute a java program as the machine starts without the needing to log-in. To achieve that you need to make a Windows Service.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;    For the purpose of this short how to, I will assume you have a folder with aRunnableJarFile.jar with maybe a lib folder and a configuration file for the java application, which is the usual way for packaging Java applications&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
One option, and the one I like the most is to use the open source project at &lt;a href="http://jslwin.sourceforge.net/"&gt;Java Service Launcher&lt;/a&gt;, it gives you two important files. jsl.exe and jsl.ini. you normally put those files in the same folder as yourRunnableJarFile.jar.&lt;br /&gt;
You edit the jsl.ini file so as to tell jsl.exe how to launch your runnable jar ( e. g. cmdline= -jar aRunnableJarFile.jar ), you can also configure where the jvm is, where will be the working directory for your application as the service starts, where you'll redirect all the output or erroutput of the sevice to a file and things like that.&lt;br /&gt;
As you have the jsl.ini configured you can run your application with 'jsl.exe -debug' which will launch your java app rigth in the console so you can see if everything went ok with the jsl.ini, you can also run 'jsl.exe -install' and it will create a windows service pointing to that jsl.exe file.&lt;br /&gt;
As you start the windows service ( or normally configure it to automatically start ) it will launch the jsl.exe file wihch will run your java application. When you stop the windows service jsl will call System.exit() in you app, so any shutdown hooks that you configured will be called by default. It is really easy.&lt;br /&gt;
&lt;br /&gt;
Another option is to create a exe wrapping your jar file. &lt;a href="http://jsmooth.sourceforge.net/"&gt;JSmooth &lt;/a&gt;is an open source project that does exactly that.&lt;br /&gt;
It has a graphic user interface that walks you though wizard-like steps to create an exe wrapper for your Java application and as you create the wrapper, you tell jsmooth that you want the wrapper to be a windows service.&lt;br /&gt;
It produces aRunnableFileWrappingYourJarFile.exe which you can run with an 'install' or 'remove' argument to install or remove the application as a windows service.&lt;br /&gt;
&lt;br /&gt;
Although I didn't see something similar to jsl.exe, &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=java+exe+wrapper&amp;amp;btnG=Google+Search&amp;amp;aq=1&amp;amp;oq=java+exe+"&gt;there are lots&lt;/a&gt; of programs like jsmoth but mostly commercial.&lt;br /&gt;
&lt;br /&gt;
Hope you can find useful this post and any problems you have I'll do my best to help you&lt;br /&gt;
&lt;br /&gt;
P.D.: please forgive my bad English&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-1906016947233432439?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=1906016947233432439" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/1906016947233432439?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/1906016947233432439?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/oq-esGq24Vs/run-java-application-as-windows.html" title="Run Java application as Windows Services" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/11/run-java-application-as-windows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UHR388eCp7ImA9WxRWE0o.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-1924932275047502120</id><published>2008-10-30T09:02:00.002-03:00</published><updated>2008-10-30T12:07:16.170-03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-30T12:07:16.170-03:00</app:edited><title>Welcome Intrepid Ibex ! - Ubuntu 8.10 LTS Released</title><content type="html">The &lt;a href="https://lists.ubuntu.com/archives/ubuntu-devel/2008-February/025136.html"&gt;Intrepid Ibex release planing&lt;/a&gt; stated the next:&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
&lt;pre&gt;A particular focus for us will be pervasive internet access, the
ability to tap into bandwidth whenever and wherever you happen to
be. No longer will you need to be a tethered, domesticated animal -
you'll be able to roam (and goats do roam!) the wild lands and
access the web through a variety of wireless technologies. We want
you to be able to move from the office, to the train, and home,
staying connected all the way.&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;
For the needs I have Linux is getting the development platform of preference. Before I have always having to do some tricks to have everything working, but as of each release of Ubuntu, to install software is getting similar to what we do in Windows, click here, now here, now you are done ! :D&lt;br /&gt;
&lt;br /&gt;
I know this is not the spirit of primitive linux users, but what you would normally expect for a development desktop is just to have everything working without worrying about architecture, packages, versions, platforms, I was used to waste a LOT of time installing a full working system everithing integrated. I liked before what Gentoo is for the concept to have everithing compiled for your needs and the portage system was very nice for me, but it is a lot of time waste I don't have.&lt;br /&gt;
&lt;br /&gt;
Of course, no virus on Linux :D, you'll always have a stable system, no matter how much time you have running your sistem, no defrag needed...&lt;br /&gt;
&lt;br /&gt;
Wine is also getting better, so a lot of windows applications are already working in linux without much effort. How much time do you think will pass untill most of us will say a definitive goodbye to Windows ?&lt;br /&gt;
&lt;br /&gt;
In the meantime, go and check to download the new &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu 8.10 LTS&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-1924932275047502120?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=1924932275047502120" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/1924932275047502120?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/1924932275047502120?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/43Ur2wpYVGY/welcome-intrepid-ibex-ubuntu-810-lts.html" title="Welcome Intrepid Ibex ! - Ubuntu 8.10 LTS Released" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/10/welcome-intrepid-ibex-ubuntu-810-lts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cNQX86eip7ImA9WxRWEkQ.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-6051367652456037998</id><published>2008-10-22T22:45:00.011-03:00</published><updated>2008-10-29T11:38:10.112-03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-29T11:38:10.112-03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="ejb" /><category scheme="http://www.blogger.com/atom/ns#" term="webservices" /><title>Easy WebServices in Java (not the common way)</title><content type="html">Where we are working now we needed to have a fast way to create WebServices and I didn't want to deal/manage J2EE containers (packaging/deployment ...) so I tried what &lt;a href="http://openejb.apache.org/"&gt;OpenEJB &lt;/a&gt;&amp;nbsp;has to offer.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;OpenEJB is an embedable and ligthweight implementation of EJB3&lt;/span&gt;, can be used as a standalone server also. In popular words, OpenEJB &amp;nbsp;is a way in&amp;nbsp;which&amp;nbsp;you can have everything that is available in the EJB3 container, but 'outside' the container&amp;nbsp;(well, not really).&lt;/div&gt;&lt;div&gt;Consider the next step by step tutorial for creating a webservice.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Create a sampleproject&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://openejb.apache.org/download.html"&gt;Download &lt;/a&gt;&amp;nbsp;openejb-3.0.zip from http://openejb.apache.org/download.html and unpack it&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Add to the classpath of your sampleproject every .jar file that's in unpacked/lib&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Create a META-INF folder inside your src directory and create a file inside that folder called ejb-jar.xml and just put in it this stringr "&amp;lt;ejb-jar/&amp;gt;" (without quotes)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Create now the interface that defines the contract of your webservice and anotate it with&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; @WebService(targetNamespace="http://yourcompany.com/wsdl")&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; public interface TestWs { ... }&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Create the class that implements your interface and anotate it like this:&lt;/li&gt;
&lt;/ul&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; @Stateless&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; @WebService(portName = "TestPort",&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; serviceName = "TestWsService",&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; targetNamespace = "http://yourcompany.com/wsdl",&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; endpointInterface = "full.qualified.name.of.your.interface.TestWs")&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; public class TestImpl { ... }&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;To start the Webservice you need to do this:&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; pubilc static void main(String[] args) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Properties properties = new Properties();&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;"org.apache.openejb.client.LocalInitialContextFactory");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;properties.setProperty("openejb.embedded.remotable", "true");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;new InitialContext(properties); // here the magic starts ....&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Taran !, after this steps what you have is a stateless bean exposed as a webservice in this location:&amp;nbsp;&lt;a href="http://localhost:4204/TestImpl?wsdl"&gt;http://localhost:4204/TestImpl?wsdl&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;ejb-jar&gt;You can use apache axis2 if you want to generate a Java client for it or just use a dynamic proxy like this:&lt;br /&gt;
&lt;br /&gt;
&lt;/ejb-jar&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; // this code can be placed rigth after InitialContext call,&amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; // can be in another program&amp;nbsp;or in another thread in the&amp;nbsp;same program&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; // Of course, the program that made the call to InitContext need to be&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; // alive for the EJB3 services to be exposed&lt;/span&gt;&lt;br /&gt;
&lt;ejb-jar&gt;&lt;span style="font-size: 13px;"&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; URL serviceUrl = new URL("http:/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;/localhost:4204/TestImpl?wsdl");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; Service testService = Service.create(serviceUrl, null);&lt;/span&gt;&lt;/ejb-jar&gt;&lt;br /&gt;
&lt;ejb-jar&gt;&lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; TestWs&amp;nbsp;testWs =&amp;nbsp;testService.getPort(TestWs.class);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; // test the methods you've implemented ...&lt;/span&gt;&lt;/ejb-jar&gt;&lt;br /&gt;
&lt;ejb-jar&gt;&lt;span style="font-family: 'Courier New'; font-size: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; You would be wondering how does it works ?&lt;/span&gt;&lt;/ejb-jar&gt;&lt;br /&gt;
&lt;ejb-jar&gt;Well, as you request the initial context, openejb automatically searchs for clases in your classpath containing ejb3-related anotations, it automaticaly exposes them as it founds, more or less as it happens when you deploy an application as a .ear in any aplication server, but simpler and with great flexibility due to its embedable architecture.&lt;/ejb-jar&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;ejb-jar&gt;UPDATE 10 / 29&amp;nbsp; / 2008&lt;/ejb-jar&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ejb-jar&gt;By default openejb serves only to localhost request, if you want to use the exposed webservice from other computers add the next properties to InitialContext(prop)&lt;/ejb-jar&gt;&lt;br /&gt;
&lt;ejb-jar&gt;prop.setProperty("httpejbd.bind", "0.0.0.0");&lt;/ejb-jar&gt;&lt;br /&gt;
prop.setProperty("ejbd.bind", "0.0.0.0");&lt;/div&gt;and if you want to change the default port in use, change the next properties:&lt;br /&gt;
httpejbd.port, ejbd.bind&lt;br /&gt;
Suppose your machine has more than one IP and you want that openejb answers only to requests comming from only one of the IPs in the server, then put the desired IP instead of 0.0.0.0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-6051367652456037998?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=6051367652456037998" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/6051367652456037998?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/6051367652456037998?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/jMimNLOzYBg/easy-webservices-in-java-not-common-way.html" title="Easy WebServices in Java (not the common way)" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/10/easy-webservices-in-java-not-common-way.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIEQX44fip7ImA9WxRXGUg.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-3568233514184675350</id><published>2008-09-18T01:50:00.012-04:00</published><updated>2008-10-25T14:41:40.036-03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-25T14:41:40.036-03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sql" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="orm" /><title>LINQ/Hibernate killer API :D</title><content type="html">You don't think I am serious, do you ? :P&lt;br /&gt;
&lt;br /&gt;
There is nothing better than what LINQ and Hibernate/JPA technologies are (you are not crazy, you've hear me say that 'LINQ is good', because it is !)&lt;br /&gt;
&lt;br /&gt;
I am a Java developer and where I am working now sometimes it is not possible to use a ORM technology (sad but normal though, considering the nature of some projects), and as it is so tedious to write SQL inserts/updates/selects  and concatenate each value, single quote the strings, putting commas in a many argument insert ...&lt;br /&gt;
&lt;br /&gt;
I coded in a short night a simple solution for me, I am tired and probably not everything works fine because I haven't had time to stress it, but for most of what I need is done.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;SQLBuilder.java&lt;/span&gt; (and the ported (SQLBuilder.cs) gives you a builder object providing a &lt;span style="font-weight: bold;"&gt;fluent API to make SQL statements&lt;/span&gt;.&amp;nbsp;The API IS FORGIVEN, so &lt;span style="font-weight: bold;"&gt;it will forgive you any errors you make&lt;/span&gt; and will just produce a wrong SQL string (as you would have if you hand write wrong SQL), BUT, if you already know SQL, it gives you a mechanism to&amp;nbsp;easily&amp;nbsp;build them.&lt;br /&gt;
&lt;br /&gt;
// ok, let the code to talk !&lt;br /&gt;
&lt;a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license"&gt;&lt;img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" style="border-width: 0px;" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;-----------------------------------------------------SQLBuilderTest.java&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Bitstream Vera Sans Mono'; font-size: 13px; white-space: pre;"&gt;&lt;span style="color: #007020; font-weight: bold;"&gt;package&lt;/span&gt; com&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;labspy&lt;/span&gt;&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;testcases&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style="background-color: transparent; border-bottom: 1px none rgb(204, 204, 204); border-style: none; border-top: 1px none rgb(204, 204, 204); font-family: 'Bitstream Vera Sans Mono',monospace; font-size: 13px; margin: 0px; overflow: auto; padding: 10px;"&gt;&lt;span style="color: #007020; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #0e84b5; font-weight: bold;"&gt;com.labspy.test.SQLBuilder&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;

&lt;span style="color: #60a0b0; font-style: italic;"&gt;/**&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * LICENCE: http://creativecommons.org/licenses/by-sa/3.0/&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * &lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * @author David Daniel Hofmann&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * @email hofmanndavid@gmail.com&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; */&lt;/span&gt;
&lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;class&lt;/span&gt; &lt;span style="color: #0e84b5; font-weight: bold;"&gt;SQLBuilderTest&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;static&lt;/span&gt; &lt;span style="color: #902000;"&gt;void&lt;/span&gt; &lt;span style="color: #06287e;"&gt;main&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String&lt;span style="color: #666666;"&gt;[]&lt;/span&gt; args&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      String insert &lt;span style="color: #666666;"&gt;=&lt;/span&gt; SQLBuilder&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;insert&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"tableName"&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;"col1, col2, col3"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;values&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #40a070;"&gt;1&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;32&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;"this is a autoquoted string"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;buildSQL&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;

      String update &lt;span style="color: #666666;"&gt;=&lt;/span&gt; SQLBuilder&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;update&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"tablename"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;set&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"col1, col2, col3"&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;1&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt;
            &lt;span style="color: #4070a0;"&gt;"'not autoquotedstring'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;25L&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;where&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"a"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;in&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #40a070;"&gt;1&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;2&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;56&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;or&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"id"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;equalTo&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"89"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;buildSQL&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;

      String delete &lt;span style="color: #666666;"&gt;=&lt;/span&gt; SQLBuilder&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;delete&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"tabletodelete"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;where&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"id"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;equalTo&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;
            &lt;span style="color: #4070a0;"&gt;"59"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// receive only strings and will not autoquote&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;or&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"othercolumn"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;like&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"2008%"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;buildSQL&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;

      String select &lt;span style="color: #666666;"&gt;=&lt;/span&gt; SQLBuilder&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;select&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"*"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// gives you a builder ( using the builder pattern )&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;from&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"ttpy_simchonize"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;where&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"a &amp;gt;"&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;20&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// will take also just one argument ("a &amp;gt; 20")&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;and&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"b &amp;lt; 60"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;andNot&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"a &amp;lt; b"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// will also take ("a &amp;lt;", 20)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;and&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"b"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;like&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"TD%"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;and&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"c"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;in&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"one"&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;"two"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// takes varargs, array or collection&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;and&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"x"&lt;/span&gt;&lt;span style="color: #666666;"&gt;).&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;in&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #40a070;"&gt;1&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;2&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;3&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;7&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// not quoted when not string&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;or&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"x &amp;gt; "&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #40a070;"&gt;2&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;groupBy&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"a"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;orderBy&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"id"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;buildSQL&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt; &lt;span style="color: #60a0b0; font-style: italic;"&gt;// returns the&lt;/span&gt;
                                                                  &lt;span style="color: #60a0b0; font-style: italic;"&gt;// string&lt;/span&gt;

      &lt;span style="color: #60a0b0; font-style: italic;"&gt;// the whole code abobe produces the next:&lt;/span&gt;
      &lt;span style="color: #60a0b0; font-style: italic;"&gt;// INSERT INTO tableName (col1, col2, col3) VALUES (1, 32, 'this is aautoquoted string')&lt;/span&gt;
      &lt;span style="color: #60a0b0; font-style: italic;"&gt;// UPDATE tablename SET col1=1, col2='not autoquotedstring', col3=25 WHERE a IN (1, 2, 56) OR id = 89&lt;/span&gt;
      &lt;span style="color: #60a0b0; font-style: italic;"&gt;// DELETE FROM tabletodelete WHERE id = 59 OR othercolumn LIKE '2008%'&lt;/span&gt;
      &lt;span style="color: #60a0b0; font-style: italic;"&gt;// SELECT * FROM ttpy_simchonize WHERE a &amp;gt; 20 AND b &amp;lt; 60 AND NOT a &amp;lt; b AND b LIKE 'TD%' AND c IN ('one', 'two') AND x IN (1, 2, 3, 7) OR x &amp;gt; 2 GROUP BY a ORDER BY id&lt;/span&gt;

   &lt;span style="color: #666666;"&gt;}&amp;nbsp;&lt;/span&gt;
&lt;/pre&gt;&lt;span style="color: #666666; font-family: 'Bitstream Vera Sans Mono'; font-size: 13px; white-space: pre;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;-----------------------------------------------------SQLBuilder.java&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Bitstream Vera Sans Mono'; font-size: 13px; white-space: pre;"&gt;&lt;span style="color: #007020; font-weight: bold;"&gt;package&lt;/span&gt; com&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;labspy&lt;/span&gt;&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;test&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style="background-color: transparent; border-bottom: 1px none rgb(204, 204, 204); border-style: none; border-top: 1px none rgb(204, 204, 204); font-family: 'Bitstream Vera Sans Mono',monospace; font-size: 13px; margin: 0px; overflow: auto; padding: 10px;"&gt;&lt;span style="color: #007020; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #0e84b5; font-weight: bold;"&gt;java.util.Collection&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;

&lt;span style="color: #60a0b0; font-style: italic;"&gt;/**&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * LICENCE: http://creativecommons.org/licenses/by-sa/3.0/&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * &lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * @author David Daniel Hofmann&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; * @email hofmanndavid@gmail.com&lt;/span&gt;
&lt;span style="color: #60a0b0; font-style: italic;"&gt; */&lt;/span&gt;
&lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;class&lt;/span&gt; &lt;span style="color: #0e84b5; font-weight: bold;"&gt;SQLBuilder&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;static&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;select&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String selectStmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #06287e;"&gt;SQLBuilder&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"SELECT "&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; selectStmt&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;trim&lt;/span&gt;&lt;span style="color: #666666;"&gt;()&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;static&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;update&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String updateStmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #06287e;"&gt;SQLBuilder&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"UPDATE "&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; updateStmt&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;trim&lt;/span&gt;&lt;span style="color: #666666;"&gt;()&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;static&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;delete&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String deleteStmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #06287e;"&gt;SQLBuilder&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"DELETE FROM  "&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; deleteStmt&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;trim&lt;/span&gt;&lt;span style="color: #666666;"&gt;()&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;static&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;insert&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String insertStmt&lt;span style="color: #666666;"&gt;,&lt;/span&gt; String fieldNames&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      SQLBuilder instance &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;new&lt;/span&gt; SQLBuilder&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"INSERT INTO "&lt;/span&gt; &lt;span style="color: #666666;"&gt;+&lt;/span&gt; insertStmt&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;trim&lt;/span&gt;&lt;span style="color: #666666;"&gt;()&lt;/span&gt;
            &lt;span style="color: #666666;"&gt;+&lt;/span&gt; &lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      instance&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;sb&lt;/span&gt;&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"("&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      instance&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;sb&lt;/span&gt;&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;fieldNames&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      instance&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;sb&lt;/span&gt;&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;") "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; instance&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;private&lt;/span&gt; StringBuilder sb &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;new&lt;/span&gt; StringBuilder&lt;span style="color: #666666;"&gt;();&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;private&lt;/span&gt; &lt;span style="color: #06287e;"&gt;SQLBuilder&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String stmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;stmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;set&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String csvFieldsToUpdate&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; respectiveValues&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"SET "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      String&lt;span style="color: #666666;"&gt;[]&lt;/span&gt; split &lt;span style="color: #666666;"&gt;=&lt;/span&gt; csvFieldsToUpdate&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;split&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;","&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;split&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;].&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;trim&lt;/span&gt;&lt;span style="color: #666666;"&gt;());&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"="&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;respectiveValues&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #902000;"&gt;int&lt;/span&gt; i &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: #40a070;"&gt;1&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt; i &lt;span style="color: #666666;"&gt;&amp;lt;&lt;/span&gt; split&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt; i&lt;span style="color: #666666;"&gt;++)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;", "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;split&lt;span style="color: #666666;"&gt;[&lt;/span&gt;i&lt;span style="color: #666666;"&gt;].&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;trim&lt;/span&gt;&lt;span style="color: #666666;"&gt;());&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"="&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;respectiveValues&lt;span style="color: #666666;"&gt;[&lt;/span&gt;i&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;values&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; values&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"VALUES ("&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #902000;"&gt;int&lt;/span&gt; i &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt; i &lt;span style="color: #666666;"&gt;&amp;lt;&lt;/span&gt; values&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt; i&lt;span style="color: #666666;"&gt;++)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
         &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; values&lt;span style="color: #666666;"&gt;[&lt;/span&gt;i&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;

         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;values&lt;span style="color: #666666;"&gt;[&lt;/span&gt;i&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;values&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;-&lt;/span&gt; &lt;span style="color: #40a070;"&gt;1&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; i&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;", "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;") "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;from&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String fromStmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"FROM "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;fromStmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;where&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String stmt&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"WHERE "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;stmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;span style="color: #60a0b0; font-style: italic;"&gt;// we just take one parameter more&lt;/span&gt;
         &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;else&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;equalTo&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String stmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"= "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;stmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;or&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String stmt&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"OR "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;stmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;span style="color: #60a0b0; font-style: italic;"&gt;// we just take one parameter more&lt;/span&gt;
         &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;else&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;between&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Object one&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object two&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; one &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"BETWEEN "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;one&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" AND "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;two&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;and&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String stmt&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"AND "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;stmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;span style="color: #60a0b0; font-style: italic;"&gt;// we just take one parameter more&lt;/span&gt;
         &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;else&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;iLike&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String pattern&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"ILIKE '"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;pattern&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"' "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;notILike&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String pattern&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"NOT ILIKE '"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;pattern&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"' "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;like&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String pattern&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"LIKE '"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;pattern&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"' "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;notLike&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String pattern&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"NOT LIKE '"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;pattern&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"' "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;andNot&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String stmt&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"AND NOT "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;stmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;span style="color: #60a0b0; font-style: italic;"&gt;// we just take one parameter more&lt;/span&gt;
         &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;else&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;in&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Collection&lt;span style="color: #666666;"&gt;&amp;amp;&lt;/span&gt;lt&lt;span style="color: #666666;"&gt;;&lt;/span&gt;Object&lt;span style="color: #666666;"&gt;&amp;amp;&lt;/span&gt;gt&lt;span style="color: #666666;"&gt;;&lt;/span&gt; values&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #06287e;"&gt;in&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;values&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;toArray&lt;/span&gt;&lt;span style="color: #666666;"&gt;());&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;in&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; values&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; values&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"IN ("&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #902000;"&gt;int&lt;/span&gt; i &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt; i &lt;span style="color: #666666;"&gt;&amp;lt;&lt;/span&gt; values&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt; i&lt;span style="color: #666666;"&gt;++)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;

         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;values&lt;span style="color: #666666;"&gt;[&lt;/span&gt;i&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;values&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;-&lt;/span&gt; &lt;span style="color: #40a070;"&gt;1&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; i&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;", "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;") "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;groupBy&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String groupByStmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"GROUP BY "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;groupByStmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;having&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String havingStmt&lt;span style="color: #666666;"&gt;,&lt;/span&gt; Object&lt;span style="color: #666666;"&gt;...&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"HAVING "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;havingStmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;length&lt;/span&gt; &lt;span style="color: #666666;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;span style="color: #60a0b0; font-style: italic;"&gt;// we just take one parameter more&lt;/span&gt;
         &lt;span style="color: #902000;"&gt;boolean&lt;/span&gt; isString &lt;span style="color: #666666;"&gt;=&lt;/span&gt; cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;instanceof&lt;/span&gt; String&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;cat&lt;span style="color: #666666;"&gt;[&lt;/span&gt;&lt;span style="color: #40a070;"&gt;0&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;
         &lt;span style="color: #007020; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #666666;"&gt;(&lt;/span&gt;isString&lt;span style="color: #666666;"&gt;)&lt;/span&gt;
            sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"'"&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #666666;"&gt;}&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;else&lt;/span&gt;
         sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;

      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; SQLBuilder &lt;span style="color: #06287e;"&gt;orderBy&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;String orderByStmt&lt;span style="color: #666666;"&gt;)&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;"ORDER BY "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;orderByStmt&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;append&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;" "&lt;/span&gt;&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; &lt;span style="color: #007020; font-weight: bold;"&gt;this&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;

   &lt;span style="color: #007020; font-weight: bold;"&gt;public&lt;/span&gt; String &lt;span style="color: #06287e;"&gt;buildSQL&lt;/span&gt;&lt;span style="color: #666666;"&gt;()&lt;/span&gt; &lt;span style="color: #666666;"&gt;{&lt;/span&gt;
      String sql &lt;span style="color: #666666;"&gt;=&lt;/span&gt; sb&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;toString&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;
      System&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;out&lt;/span&gt;&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #4070a0;"&gt;println&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;sql&lt;span style="color: #666666;"&gt;);&lt;/span&gt;
      &lt;span style="color: #007020; font-weight: bold;"&gt;return&lt;/span&gt; sql&lt;span style="color: #666666;"&gt;;&lt;/span&gt;
   &lt;span style="color: #666666;"&gt;}&lt;/span&gt;
&amp;nbsp;&lt;/pre&gt;&lt;span style="color: #666666; font-family: 'Bitstream Vera Sans Mono'; font-size: 13px; white-space: pre;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: normal;"&gt;-- I've googled for this solution but I've found nothing simple as what I need. I've made a simple tool for myself that will alleviate the work of hand coding SQL whenever I can not use a decent ORM tool, probably this is YAW (yet another wheel) but I want to&amp;nbsp;&lt;span style="font-weight: bold;"&gt;know how many of you are still needing to hand write full SQL strings, and more important, will a tool like this be useful ?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-3568233514184675350?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=3568233514184675350" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/3568233514184675350?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/3568233514184675350?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/Yb50D8UARHE/linqhibernate-killer-api-d.html" title="LINQ/Hibernate killer API :D" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">8</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/09/linqhibernate-killer-api-d.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQESXY_cCp7ImA9WxRSFE8.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-6800819694113851946</id><published>2008-09-13T15:54:00.005-04:00</published><updated>2008-09-14T15:25:08.848-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-14T15:25:08.848-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="gwt" /><title>Google Web Toolkit in less than 160 Words</title><content type="html">&lt;a href="http://code.google.com/webtoolkit/"&gt;Google Web Toolkit (GWT)&lt;/a&gt; is an opensource project that gives you the tools needed to write Java using a Swing-like API. You then run/debug your Java code within your preferred IDE and immediately see the effect of what you wrote.&lt;br /&gt;&lt;br /&gt;A simple script invocation compiles (translates) your Java classes to JavaScript. The deployment of the files is as easy as copy/paste the output files produced by the compiler to any HTTP server folder.&lt;br /&gt;&lt;br /&gt;Classes that emulates Swing Components are included in the project. It has also a very simple, yet powerful RPC mechanism so you can easily make calls from the Browser to the Server through AJAX (but you never write Javascript !), Servlet technology is used for that, but you really don't care about it, the libraries takes care of all the Serialization mechanisms, it lets you send almost any Object through the wires, easily!&lt;br /&gt;&lt;br /&gt;Really fun to use, Swing lovers will like it !&lt;br /&gt;&lt;br /&gt;[UPDATE September 15, 2008]&lt;br /&gt;Web applications like &lt;a href="http://www.gmail.com/"&gt;GMail&lt;/a&gt;, &lt;a href="http://maps.google.com/"&gt;Google Maps&lt;/a&gt; and &lt;a href="http://reader.google.com/"&gt;Google Reader&lt;/a&gt; are made using GWT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-6800819694113851946?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=6800819694113851946" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/6800819694113851946?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/6800819694113851946?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/XwpclfJb0PE/google-web-toolkit-in-less-than-160.html" title="Google Web Toolkit in less than 160 Words" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/09/google-web-toolkit-in-less-than-160.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4BR3szfCp7ImA9WxdVFU0.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-8634020637712110505</id><published>2008-07-11T23:49:00.005-04:00</published><updated>2008-07-19T17:29:16.584-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-19T17:29:16.584-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="deployment" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><title>Java builds made easy with FatJar</title><content type="html">This plug-in allows you to deploy your working eclipse 'project' in one single jar with just one easy step. It finds all the dependencies your project currently depends on --Jars, External-Jars, User-Libraries, System-Libraries, Classes-Folders and     Project-Exports are taken into account.&lt;br /&gt;
&lt;br /&gt;
In the export wizard you can also select the main class for the jar being exported.&lt;br /&gt;
&lt;br /&gt;
As far as I have used, it performs very well, though the project is still in beta stage. It works joining all the dependency clases and resources into one single jar, very handy for some situations where you develop some swing interfaces, or simple demons or small things like that. Give it a try to &lt;a href="http://fjep.sourceforge.net/"&gt;FatJar Eclipse Plug-in&lt;/a&gt;, it really worth !&lt;br /&gt;
&lt;br /&gt;
Of course, this is not a replacement for tools such &lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt; or &lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt;, because this is a complete different approach for buildings. Do not use it for very big projects, but for small to medium sized applications I think will give you a lot less headaches than dealing with formal building tools, saving you time and effort while providing what you just need: a working Jar :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-8634020637712110505?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=8634020637712110505" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/8634020637712110505?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/8634020637712110505?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/bkrO-eWC_RU/java-builds-made-easy-fatjar-eclipse.html" title="Java builds made easy with FatJar" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/07/java-builds-made-easy-fatjar-eclipse.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UCR3k6eSp7ImA9WxdVEE0.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-413383548856832782</id><published>2008-07-11T23:31:00.005-04:00</published><updated>2008-07-14T00:21:06.711-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-14T00:21:06.711-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="programing languages" /><title>Formal Languages and Natural Languages</title><content type="html">The programing languages we are using has a formal name called "&lt;b&gt;Formal Languages&lt;/b&gt;" (FL), here is a short explanation about it&lt;br /&gt;
&lt;br /&gt;
Let's see first what is "&lt;b&gt;Natural Languages&lt;/b&gt;" (NL), they are languages that people speak, like English, Spanish, Chinese, etc. Though people try to impose some order in them, they end up evolving with the people that speaks it, that is why in each language you'll see different ways of saying the same thing or having the same word in one language meaning completely different things in other countries speaking the same language, That is why they are called natural.&lt;br /&gt;
&lt;br /&gt;
FL does never evolve by themselves, they are &lt;i&gt;designed&lt;/i&gt; by people for specific applications, like mathematicians use a FL that is clear at denoting relationships among numbers and symbols. For &lt;b&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;programing languages&lt;/span&gt;&lt;/b&gt;, we can say that &lt;i style="color: rgb(0, 0, 0);"&gt;they &lt;/i&gt;&lt;b&gt;&lt;i style="color: rgb(0, 102, 0);"&gt;are formal languages that have been designed to express computations&lt;/i&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
In mathematics you have &lt;b&gt;syntax rules&lt;/b&gt; to express statements like 3 = 2 + 1, so something like 3 = 2 1 + is not acceptable because it does not follow the designed syntax rules for the language. In programming languages it is the same, two aspects of syntax rules can be noted. One of them are &lt;b&gt;tokens&lt;/b&gt; being the basic elements of the language such as special characters and words. The second is the &lt;b&gt;structure&lt;/b&gt; that specifies the way tokens can be arranged.&lt;br /&gt;
&lt;br /&gt;
Some key aspects that makes FL differ form NL is that FL allows &lt;b&gt;no ambiguity&lt;/b&gt;, FL tend to be &lt;b&gt;less redundant&lt;/b&gt; than NL witch has a lot of different ways of saying the same thing. NL are full of metaphor where FL are &lt;b&gt;completely literal&lt;/b&gt;, one expression will &lt;i&gt;always&lt;/i&gt; mean the same thing, no matter the context. &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Backus-Naur_form"&gt;BNF&lt;/a&gt; is a way to describe FL and will be the subject of a more advanced and interesting topic I will post later in this blog.&lt;br /&gt;
&lt;br /&gt;
If you are a newbe in Software Development, I will heavily recommend that you to read this book: "&lt;a href="http://openbookproject.net/thinkCSpy/index.xhtml"&gt;How to think like a Computer Scientist&lt;/a&gt;". It introduces you from the very beginning going though the fundamental concepts for computer programing and makes you understand in an easy but practical way how can you make programs the way a former Developer would do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-413383548856832782?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=413383548856832782" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/413383548856832782?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/413383548856832782?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/Bbydf4pj8bY/formal-languages-and-natural-languages.html" title="Formal Languages and Natural Languages" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/07/formal-languages-and-natural-languages.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YNQXY4eyp7ImA9WxdVGUU.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-7252037317595599745</id><published>2008-07-11T23:29:00.004-04:00</published><updated>2008-07-25T08:33:10.833-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-25T08:33:10.833-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="personal" /><title>Welcome to my blog !</title><content type="html">Hi there !&lt;br /&gt;
&lt;br /&gt;
The past two posts where for testing the style of the blog and related stuff . So this is the formal starting :)&lt;br /&gt;
&lt;br /&gt;
You will find here topics of my personal interest, mainly articles about Software Development. I am a self taught, not an engineer, so only expect practical information that I found useful for my work or hobbyist hours.&lt;br /&gt;
&lt;br /&gt;
When writing about technical information, I will do my best to present practical info. I hope you will find them useful, but if you don't, just email me or post a comment and I promise I will help you on the discussed topic.&lt;br /&gt;
&lt;br /&gt;
Internet is already full of blogs and technical info about Software Development&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;&lt;b&gt;Question:&lt;/b&gt; Why another blog ?&lt;br /&gt;
&lt;b&gt;Answer:&lt;/b&gt; Haven't you found most (if not everything) you needed to build up your developer skills in the internet ?&lt;br /&gt;
Well, now you know my reason.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Sometimes you just know a lot and want to share ( keeping a healthy community&amp;nbsp;)&lt;/li&gt;
&lt;li&gt;Sometimes you are just so frustrated to not have found the right info you need so you spend hours of your time getting all the small peaces of necessary information from different sources to solve a problem that in the end it is worth it to put them all in one place for future reference for yourselves and others.&lt;/li&gt;
&lt;/ol&gt;&lt;/blockquote&gt;So those two points are the main goal of this blog, it doesn't exactly mean that only, but I will do my best to match that goal.&lt;br /&gt;
&lt;br /&gt;
You'll find subscription links in the side panel&lt;br /&gt;
Hope you enjoy it !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-7252037317595599745?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=7252037317595599745" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/7252037317595599745?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/7252037317595599745?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/lAhFPasr4GE/welcome-to-my-blog.html" title="Welcome to my blog !" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/07/welcome-to-my-blog.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04ESHg4eCp7ImA9WxdVEE0.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-2967483802991628618</id><published>2008-07-11T00:30:00.002-04:00</published><updated>2008-07-13T22:18:29.630-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-13T22:18:29.630-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="internet" /><title>WayBack Machine - The Internet Archived !</title><content type="html">Sometimes you post some content on the internet and then you regret it, don't you ? Well, increase your pain knowing the WayBack Machine&amp;nbsp;at &lt;a href="http://www.archive.org/"&gt;www.archive.org&lt;/a&gt; :).&lt;br /&gt;
&lt;br /&gt;
The site states that they're "building a digital library of Internet sites and other cultural artifacts in digital form. Like a paper library, we provide free access to researchers, historians, scholars, and the general public". So they let you "browse through &lt;b&gt;85 billion&lt;/b&gt; web pages archived &lt;b&gt;from 1996 to a few months ago&lt;/b&gt;" -quotes from the site.&lt;br /&gt;
&lt;br /&gt;
It is quite interesting the web collections that they have though, for example the "historical record of the devastation caused by Hurricane Katrina and the massive relief effort which followed".&lt;br /&gt;
&lt;br /&gt;
You can drag this link to your bookmarks toolbar &lt;a href="javascript:location.href='http://web.archive.org/web/*/'+document.location.href;"&gt;WayBack&lt;/a&gt;, once you have the button on your toolbar, whenever you visit a web page you can click on the WayBack button and it will show to you the archived past versions of the page you are browsing, witch is handy and useful.&lt;br /&gt;
&lt;br /&gt;
Enjoy your Internet Time Machine !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-2967483802991628618?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=2967483802991628618" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/2967483802991628618?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/2967483802991628618?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/BiLxDRAsCpA/wayback-machine-internet-archived.html" title="WayBack Machine - The Internet Archived !" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/07/wayback-machine-internet-archived.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYBR3g5fSp7ImA9WxdWGE4.&quot;"><id>tag:blogger.com,1999:blog-104781243427600828.post-155876601149968504</id><published>2008-05-08T10:28:00.005-04:00</published><updated>2008-07-11T23:25:56.625-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-11T23:25:56.625-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="personal" /><category scheme="http://www.blogger.com/atom/ns#" term="blood" /><title>Blood Transfusion Risks</title><content type="html">&lt;span style="font-size: 85%;"&gt;&lt;span style="font-family: times new roman;"&gt;-- Read the &lt;/span&gt;&lt;a href="http://hofmanndavid-es.blogspot.com/2008/07/riesgo-en-las-transfusiones-de-sangre.html" style="font-family: times new roman;"&gt;spanish&lt;/a&gt;&lt;span style="font-family: times new roman;"&gt; version&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Recent studies regarding the absence of nitric oxide in banked blood have shown that, contrary to what was previously known, could enclose more risks than benefits. Another risk involved is the possibility to get diseases that can not always be detected in time prior to a transfusion of donated blood, as is AIDS&lt;br /&gt;
&lt;br /&gt;
Since nitric oxide is a highly reactive gas, it lasts only a few seconds, it is produced and used by our body to dilate blood vessels so that blood can flow freely across blood vessels and thus allow the passage of oxygen to all the tissues of our body.&lt;br /&gt;
&lt;br /&gt;
When the blood is stored, in a few hours it loses considerably its nitric oxide, and no matter how much oxygen the red blood cells are carrying, they are not going to reach the tissues. Another related problem is that the nitric oxide influences the flexibility of red blood cells, which can no longer slurry to enter into blood vessels to deposit the oxygen that they are carrying, this prevents the oxygen to reach the tissues but also prevents the passage of good red cells that are able to deliver oxygen. If that tissue is part of the heart, it will be on the rist of high risk for heart attacks.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.scientificblogging.com/news_account/blood_transfusion_banked_blood_may_do_more_harm_than_good_say_researchers"&gt;Blood Transfusion: Banked blood may do more harm than good&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.rsc.org/chemistryworld/News/2007/October/08100704.asp"&gt;Blood transfusion risks explained&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.forbes.com/health/feeds/hscout/2007/10/08/hscout608924.html"&gt;Studies prove weaknesses in donated blood&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://medgadget.com/archives/2007/10/trouble_found_with_blood_transfusions.html"&gt;Depletion of Nitric Oxide in Bank Blood Spells Trouble&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;object height="355" width="425"&gt;
&lt;param name="movie" value="http://www.youtube.com/v/WwjNOu4Asiw&amp;amp;hl=en"&gt;
&lt;param name="wmode" value="transparent"&gt;&lt;embed src="http://www.youtube.com/v/WwjNOu4Asiw&amp;amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;br /&gt;
Keep in mind also that there are diseases such as AIDS, which may be present in the blood of the donor, however, is not detectable in 100% until 3 months after contracting the disease.&lt;br /&gt;
&lt;a href="http://www.ntahc.org.au/hivbbvq&amp;amp;amp;a.htm"&gt;HIV FAQ&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This is not an official document, I am not even a doctor, but I am interested in the subject and I have done much research about it. Apparently millions of people are receiving blood which does not fulfil its primary function, carry oxygen, and many of them have contracted diseases due to receiving transfusions. Sadly, the solution to these problems does not seem to be available in a short-term period.&lt;br /&gt;
&lt;br /&gt;
It is good to know that there are alternatives to blood transfusions&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/104781243427600828-155876601149968504?l=hofmanndavid.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=104781243427600828&amp;postID=155876601149968504" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/155876601149968504?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/104781243427600828/posts/default/155876601149968504?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/owlA/~3/o88wWuOXCDg/blood-transfusion-risks.html" title="Blood Transfusion Risks" /><author><name>David Hofmann</name><uri>http://www.blogger.com/profile/09222395386938208735</uri><email>hofmanndavid@gmail.com</email><gd:extendedProperty name="OpenSocialUserId" value="15456177697331830265" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://hofmanndavid.blogspot.com/2008/05/blood-transfusion-risks.html</feedburner:origLink></entry></feed>
