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

<channel>
	<title>Axino.net &#187; Java</title>
	<atom:link href="http://www.axino.net/category/programming/java-programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.axino.net</link>
	<description>The other side of atom.</description>
	<lastBuildDate>Thu, 15 Jul 2010 12:45:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>java glassfish and ubuntu server</title>
		<link>http://www.axino.net/programming/java-programming/2010/04/java-glassfish-and-ubuntu-server</link>
		<comments>http://www.axino.net/programming/java-programming/2010/04/java-glassfish-and-ubuntu-server#comments</comments>
		<pubDate>Fri, 30 Apr 2010 20:10:32 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=798</guid>
		<description><![CDATA[Installing Java and glassfish can be demanding since there wasn&#8217;t complete tutorial so I composed this one after weekend I was creating my own server. First of all you have to install Java on ubuntu. I assume you have already established and checked connection to the internet. Enter the following code in the terminal, this [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Java and glassfish can be demanding since there wasn&#8217;t complete tutorial so I composed this one after weekend I was creating my own server.</p>
<p><span id="more-798"></span>First of all you have to install Java on ubuntu. I assume you have already established and checked connection to the internet.</p>
<p>Enter the following code in the terminal, this will install everything you require to run Java apps. Java 5 is optional.</p>
<pre>sudo apt-get update

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

sudo apt-get install sun-java5-bin

sudo apt-get install sun-java5-jdk</pre>
<p>I have obtained list from the Ubuntu web site of packages Ubuntu contains regarding Java:</p>
<blockquote><p>=&gt; <strong>sun-java6-bin</strong> : Sun Java Runtime Environment  (JRE) 6</p>
<p>=&gt; <strong>sun-java6-demo</strong> : Sun Java Development Kit  (JDK) 6 demos</p>
<p>=&gt; <strong>sun-java6-jdk</strong> : Sun Java Development Kit  (JDK) 6</p>
<p>=&gt; <strong>sun-java6-jre</strong> : Sun Java Runtime Environment  (JRE) 6</p></blockquote>
<p>Next step is to install Glassfish. You should download Glassfish from the following web site. Save it somewhere on your comp and remember name of file.</p>
<blockquote><p>http://download.java.net/glassfish/v3/release/glassfish-v3-unix.sh</p></blockquote>
<p>Now navigate towards folder where you saved file and write the following statement in terminal:</p>
<p>sudo sh nameoffile.sh</p>
<p>Starting Glassfish is simple in terminal write following statement to start Glassfish admin terminal:</p>
<pre>
sudo sh asadmin
</pre>
<p>Following statements allow you to start Glassfish working:</p>
<ol>
<li>
<pre>asadmin&gt; <strong>start-database</pre>
<p></strong></li>
<li>
<pre>asadmin&gt; <strong>start-domain domain1</pre>
<p></strong></li>
</ol>
<p>Now you may go to admin panel via link ip-address.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2010/05/mysql-server-and-ubuntu" rel="bookmark" title="Saturday 01.05.2010">mysql server and ubuntu</a></li>
<li><a href="http://www.axino.net/tutorial/2010/01/basic-web-hacking-17-java-decompiler" rel="bookmark" title="Tuesday 26.01.2010">Basic Web Hacking 17 :: java decompiler</a></li>
<li><a href="http://www.axino.net/tutorial/2009/05/how-to-switch-default-netbeans-jdk" rel="bookmark" title="Friday 08.05.2009">How to switch default Netbeans JDK</a></li>
<li><a href="http://www.axino.net/tutorial/2009/10/connect-to-mysql-database-in-java" rel="bookmark" title="Wednesday 21.10.2009">Connect to mysql database in java</a></li>
<li><a href="http://www.axino.net/tutorials" rel="bookmark" title="Wednesday 07.01.2009">Tutorials</a></li>
</ul>
<p><!-- Similar Posts took 4.896 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=798" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/programming/java-programming/2010/04/java-glassfish-and-ubuntu-server/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SWAT2010 :: unavailable</title>
		<link>http://www.axino.net/programming/java-programming/2010/04/swat2010-unavailable</link>
		<comments>http://www.axino.net/programming/java-programming/2010/04/swat2010-unavailable#comments</comments>
		<pubDate>Thu, 29 Apr 2010 21:59:37 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[SWAT2010]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google API]]></category>
		<category><![CDATA[Google Docs]]></category>
		<category><![CDATA[jsp]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=858</guid>
		<description><![CDATA[Unfortunately I noticed that server serving swat2010 web service failed and isn&#8217;t working anymore for everyone on outside network. I will try to fix it as soon as possible, but due to changes in my ISP this might take some time to resolve.Similar Posts: SWAT2010 :: available again SWAT2010 preview SWAT2010 :: new location How [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately I noticed that server serving swat2010 web service failed and isn&#8217;t working anymore for everyone on outside network. I will try to fix it as soon as possible, but due to changes in my ISP this might take some time to resolve.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/projects/swat2010/2010/05/swat2010-available-again" rel="bookmark" title="Monday 31.05.2010">SWAT2010 :: available again</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/02/swat2010-preview" rel="bookmark" title="Friday 05.02.2010">SWAT2010 preview</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/03/swat2010-new-position" rel="bookmark" title="Monday 15.03.2010">SWAT2010 :: new location</a></li>
<li><a href="http://www.axino.net/tutorial/2010/06/how-to-redirect-site-in-php" rel="bookmark" title="Tuesday 01.06.2010">How to redirect site in php</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/basic-web-hacking-10-ip-range" rel="bookmark" title="Wednesday 18.11.2009">Basic web hacking 10 :: ip range</a></li>
</ul>
<p><!-- Similar Posts took 4.721 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=858" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/programming/java-programming/2010/04/swat2010-unavailable/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWAT2010 :: new location</title>
		<link>http://www.axino.net/programming/java-programming/2010/03/swat2010-new-position</link>
		<comments>http://www.axino.net/programming/java-programming/2010/03/swat2010-new-position#comments</comments>
		<pubDate>Mon, 15 Mar 2010 07:35:02 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[SWAT2010]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google API]]></category>
		<category><![CDATA[Google Docs]]></category>
		<category><![CDATA[jsp]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=833</guid>
		<description><![CDATA[I know it was long month but I&#8217;ll try to find more time following month and update site a bit. First thing was setting new link for the SWAT2010 small java project which is now available on the the following link: swat2010.axino.net Well, if anyone tried it out give a buzz in comments. Similar Posts: [...]]]></description>
			<content:encoded><![CDATA[<p>I know it was long month but I&#8217;ll try to find more time following month and update site a bit. First thing was setting new link for the SWAT2010 small java project which is now available on the the following link: <a href="http://swat2010.axino.net">swat2010.axino.net</a></p>
<p>Well, if anyone tried it out give a buzz in comments. <img src='http://www.axino.net/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> <strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/projects/swat2010/2010/05/swat2010-available-again" rel="bookmark" title="Monday 31.05.2010">SWAT2010 :: available again</a></li>
<li><a href="http://www.axino.net/programming/javascript-programming/2010/01/kingsagex-version-0-66" rel="bookmark" title="Sunday 24.01.2010">Kingsagex :: version 0.66</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/02/swat2010-preview" rel="bookmark" title="Friday 05.02.2010">SWAT2010 preview</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/04/java-glassfish-and-ubuntu-server" rel="bookmark" title="Friday 30.04.2010">java glassfish and ubuntu server</a></li>
<li><a href="http://www.axino.net/projects/kingsagex/2009/07/kingsagex-version-0-51" rel="bookmark" title="Thursday 09.07.2009">KingsAgeX :: version 0.51</a></li>
</ul>
<p><!-- Similar Posts took 4.898 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=833" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/programming/java-programming/2010/03/swat2010-new-position/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWAT2010 preview</title>
		<link>http://www.axino.net/programming/java-programming/2010/02/swat2010-preview</link>
		<comments>http://www.axino.net/programming/java-programming/2010/02/swat2010-preview#comments</comments>
		<pubDate>Fri, 05 Feb 2010 17:36:20 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[SWAT2010]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google API]]></category>
		<category><![CDATA[Google Docs]]></category>
		<category><![CDATA[jsp]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=828</guid>
		<description><![CDATA[Few weeks ago, for school project I had to use Google API to create certain potentially useful application. So after short thinking I decided to create web archiving software. And therefore the origin of the name SWAT aka. Simple Web Archive sofTware . Project source code is accessible on the google code. You have to [...]]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago, for school project I had to use Google API to create certain potentially useful application. So after short thinking I decided to create web archiving software. And therefore the origin of the name SWAT aka. Simple Web Archive sofTware <img src='http://www.axino.net/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .</p>
<p><img class="alignright" title="Formats for SWAT2010" src="http://i49.tinypic.com/ljej6.jpg" alt="" width="226" height="180" />Project source code is accessible on the <a href="http://code.google.com/p/swat2010/" target="_blank">google code</a>. You have to understand that not the very last version of source code is provided. Since the project ended I rewrote certain parts of code. Predominantly regarding upload of files. Which are now stored on server for very brief period of time before being uploaded to Google servers. Also the procedure of uploading is now more reliable and since project was officially finished before Google decided to allow uploading all types of files. I had to work trough and fix certain issues. Mostly because of speedy programming <img src='http://www.axino.net/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://95.87.145.187/SWAT2010/" target="_blank">Project preview</a> is available on my local server.</p>
<p><span id="more-828"></span></p>
<p>Now what is this all about. Well, basically it offers almost all of functionality as Google Docs. With a bit of twist. We integrated statistics and calendar for storing certain data. Both functions are not yet integrated in public server version.Reasons for this are numerous but the main one being there was no time to debug all possible exceptions and errors that might occur in public version.</p>
<p>Also probably the most important feature that SWAT allows to you is that you can keep track of your revisions. For example. You would upload document to Google Docs and later you would change it on your local machine. Now when you upload it again to Google docs you will have completely new document. What SWAT allows you is to update document you already have updated with new version, and simply keep track of changes with revision history.</p>
<p>Currently download is disabled due to server resources and certain complications that still occur in format conversions. I expect that all of these problems will be regulated when protocol version 3 exits lab.</p>
<p>Modular design allows also for possible integration in desktop application with little effort. Which would have ability to synchronize chosen folder on your local machine with folder on Google docs.</p>
<p>Note that sometimes Google services are a bit slow and it will take time to refresh data available so even when you upload document you might wait certain time before it gets deleted. Or when you upload document, it will pass few minutes before it becomes available trough service interface and therefore visible in archive preview.</p>
<p>Questions, ideas, suggestions basically everything just put it in comments. I will read it gladly.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2010/05/hackthissite-org-application-3-127-0-0-1" rel="bookmark" title="Thursday 27.05.2010">hackthissite.org Application 3 :: 127.0.0.1</a></li>
<li><a href="http://www.axino.net/tutorial/2009/05/local-domain-or-set-up-of-local-site" rel="bookmark" title="Monday 04.05.2009">Local domain || set up of local site</a></li>
<li><a href="http://www.axino.net/projects/swat2010/2010/05/swat2010-available-again" rel="bookmark" title="Monday 31.05.2010">SWAT2010 :: available again</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/03/swat2010-new-position" rel="bookmark" title="Monday 15.03.2010">SWAT2010 :: new location</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/gif-support-for-paint-net" rel="bookmark" title="Thursday 26.11.2009">GIF support for Paint.net</a></li>
</ul>
<p><!-- Similar Posts took 5.015 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=828" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/programming/java-programming/2010/02/swat2010-preview/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Basic Web Hacking 17 :: java decompiler</title>
		<link>http://www.axino.net/tutorial/2010/01/basic-web-hacking-17-java-decompiler</link>
		<comments>http://www.axino.net/tutorial/2010/01/basic-web-hacking-17-java-decompiler#comments</comments>
		<pubDate>Mon, 25 Jan 2010 23:04:51 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[hellboundhackers.org]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=769</guid>
		<description><![CDATA[As you know java uses interpreter for executing on target system. Why am I talking about java now. Because,  java also allows applets web applications executed in web browser.  Now let&#8217;s continue to our mission. Enter Your Password to Login only.Samurai made this login thinking it wasn&#8217;t vulnerable to any injection, he was right, however; [...]]]></description>
			<content:encoded><![CDATA[<p>As you know java uses interpreter for executing on target system. Why am I talking about java now.</p>
<p><span id="more-769"></span></p>
<p>Because,  java also allows applets web applications executed in web browser.  Now let&#8217;s continue to our mission.</p>
<blockquote><p><strong>Enter Your Password to Login</strong></p>
<p>only.Samurai made this login thinking it wasn&#8217;t vulnerable to any  injection, he was right, however; there was another hole.</p></blockquote>
<p>From introduction we see that this mission is not vulnerable to anything used in previous examples.</p>
<p>However, if we inspect code you will find something similar to this:</p>
<p><strong> </strong></p>
<blockquote><p><code> </code></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;lt; applet width=&quot;150&quot; height=&quot;40&quot; code=&quot;basic17.class&quot;&amp;gt;
&amp;lt;/applet&amp;gt;</pre></div></div>

</blockquote>
<p>Here we have link to source: <strong>basic17.class </strong>you can download this file from: http://www.hellboundhackers.org/challenges/basic17/basic17.class</p>
<p>Now since we have compiled java class try downloading <a href="http://java.decompiler.free.fr/?q=jdgui#downloads" target="_blank">java decompiler</a>. Next step is to open basic17.class with decompiler and obtain java code.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.applet.Applet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.applet.AppletContext</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.Color</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.TextField</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.event.ActionEvent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.event.ActionListener</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.MalformedURLException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URL</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> basic17 <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">Applet</span>
  <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">ActionListener</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #003399;">String</span> file4 <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;baysick-seventeen.complete.php?pass=&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #003399;">TextField</span> inputLine <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">TextField</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003399;">String</span> file2 <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    setBackground<span style="color: #009900;">&#40;</span><span style="color: #003399;">Color</span>.<span style="color: #006633;">WHITE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> basic17<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">inputLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">inputLine</span>.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">file2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;challenges&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed<span style="color: #009900;">&#40;</span><span style="color: #003399;">ActionEvent</span> paramActionEvent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003399;">String</span> str1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">inputLine</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>str1.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ifYOU'REhereYOU'REelite&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #003399;">URL</span> localURL <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
      <span style="color: #003399;">String</span> str2 <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.hellboundhackers.org/&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #003399;">String</span> str3 <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;basic17&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        localURL <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span>getDocumentBase<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, str2 <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">file2</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">+</span> str3 <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">file4</span> <span style="color: #339933;">+</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;elite&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">MalformedURLException</span> localMalformedURLException<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #009900;">&#125;</span>
      getAppletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">showDocument</span><span style="color: #009900;">&#40;</span>localURL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">inputLine</span>.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;not yet&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>After inspecting this code for some time you will notice following line:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>str1.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ifYOU'REhereYOU'REelite&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>This in fact means that password we need is:</p>
<blockquote><p>&#8220;ifYOU&#8217;REhereYOU&#8217;REelite</p></blockquote>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2009/11/basic-web-hacking-12-include-me-in" rel="bookmark" title="Saturday 21.11.2009">Basic web hacking 12 :: include me in</a></li>
<li><a href="http://www.axino.net/tutorial/2010/01/basic-web-hacking-15-my-robot" rel="bookmark" title="Monday 11.01.2010">Basic Web Hacking 15 :: My robot</a></li>
<li><a href="http://www.axino.net/tutorial/2009/10/basic-web-hacking-4-bad-upload" rel="bookmark" title="Friday 23.10.2009">Basic web hacking 4 :: bad upload</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/basic-web-hacking-7-double-login" rel="bookmark" title="Tuesday 10.11.2009">Basic web hacking 7 :: double login</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/basic-web-hacking-9-null-poison-byte" rel="bookmark" title="Tuesday 17.11.2009">Basic web hacking 9 :: null poison byte</a></li>
</ul>
<p><!-- Similar Posts took 5.239 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=769" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/tutorial/2010/01/basic-web-hacking-17-java-decompiler/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Kingsage defense simulator</title>
		<link>http://www.axino.net/programming/java-programming/2010/01/kingsage-defense-simulator</link>
		<comments>http://www.axino.net/programming/java-programming/2010/01/kingsage-defense-simulator#comments</comments>
		<pubDate>Sat, 23 Jan 2010 16:53:37 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[KAdef]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[kingsage]]></category>
		<category><![CDATA[simulator]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=761</guid>
		<description><![CDATA[Yesterday, I was wandering what would be the best defense no matter resources. And from that initial idea I developed this very simple application that may be used for optimizing your defensive structure. On the right side you may see that program allows input of population, by default population is set to maximum number of [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I was wandering what would be the best defense no matter resources. And from that initial idea I developed this very simple application that may be used for optimizing your defensive structure.</p>
<p><span id="more-761"></span></p>
<p><img class="alignleft" title="Kingsage defense simulator " src="http://i47.tinypic.com/ygw42.jpg" alt="" width="587" height="545" /> On the right side you may see that program allows input of population, by default population is set to maximum number of soldiers in case settlement is fully built.</p>
<p>Also application allows input of existing units. After you click on <strong>Start sim</strong> button you  will in fact see that other units were filled in to maximize that is optimize defense points. Usually, you will see higher defense points for archers because of my assumption that squires are best unit to defend against cavalry and archer units. Meanwhile, the most useful unit for defense against infantry is considered to be archer.</p>
<p>After simulation ends you will also be able to see how much resources is needed for gaining that many units.</p>
<p>If you have any suggestion or idea that might be fitted into this program please feel free to suggest.</p>
<p>To run application <a href="http://www.speedyshare.com/files/20510218/KAdef.rar" target="_blank">download rar file</a>. Unrar this folder and run KAdef.jar in case something is wrong and you cannot start application check if you have <a href="http://java.com" target="_blank">java </a>installed.</p>
<p>P.S. Please put requests ideas and similar for other scripts and apps available on axino.net in their respective folders.<br />
Regards,</p>
<p>Ax<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/hack/2009/10/keylogger-in-c-hiding-unhiding" rel="bookmark" title="Thursday 29.10.2009">Keylogger in C# :: Hiding &#038;&#038; unhiding</a></li>
<li><a href="http://www.axino.net/tutorial/2009/09/scilab-oxygen-saturation" rel="bookmark" title="Friday 18.09.2009">SciLab oxygen saturation</a></li>
<li><a href="http://www.axino.net/projects/2009/06/kingsagex-project" rel="bookmark" title="Sunday 14.06.2009">KingsAgeX project</a></li>
<li><a href="http://www.axino.net/tutorial/2009/02/hackthissiteorg-basic-1-password-is" rel="bookmark" title="Sunday 01.02.2009">hackthissite.org basic 1 :: password is</a></li>
<li><a href="http://www.axino.net/tutorial/2009/01/psd-support-for-paintnet" rel="bookmark" title="Thursday 22.01.2009">PSD support for Paint.net</a></li>
</ul>
<p><!-- Similar Posts took 5.377 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=761" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/programming/java-programming/2010/01/kingsage-defense-simulator/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to use Netbeans and Google code</title>
		<link>http://www.axino.net/tutorial/2009/12/how-to-use-netbeans-and-google-code</link>
		<comments>http://www.axino.net/tutorial/2009/12/how-to-use-netbeans-and-google-code#comments</comments>
		<pubDate>Mon, 28 Dec 2009 19:33:13 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[google code]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=726</guid>
		<description><![CDATA[I used to use Google code subversion repository before. However, since that time some things changed. So I though I already knew how to connect to subversion repository but new security features forced me to spend a lot more time expected. First thing you need to do is either register new project or be assigned [...]]]></description>
			<content:encoded><![CDATA[<p>I used to use Google code subversion repository before. However, since that time some things changed. So I though I already knew how to connect to subversion repository but new security features forced me to spend a lot more time expected.</p>
<p><span id="more-726"></span></p>
<p>First thing you need to do is either register new project or be assigned as project committer or owner at <a href="http://code.google.com/ " target="_blank">Google Code</a>. After you gain access to project you have to go to <strong>Source(tab)-&gt;Checkout.</strong></p>
<p>Now you have to generate <strong>googlecode.com password</strong> in the first blue square you will see googlecode.com password link click on this link. After new page opens click on the button <strong>Generate </strong>or if you already have generated password it will be written in bold after text:<strong> Your googlecode.com password:</strong></p>
<p>If you have password, access to project and google user account we may proceed to Netbeans part of tutorial.</p>
<p>At the time of writing current version of <strong>Netbeans IDE</strong> is 6.8.</p>
<p>So from menu click on the <strong>Team-&gt;Subversion-&gt;Checkout&#8230;</strong></p>
<p style="text-align: center;"><a href="http://tinypic.com" target="_blank"><img class="aligncenter" style="border: 0pt none;" src="http://i46.tinypic.com/6r1s0i.jpg" border="0" alt="Image and video hosting by TinyPic" width="440" height="343" /></a></p>
<p>In the <strong>Repository URL: </strong>you should enter <strong>https://yourproject.googlecode.com/svn</strong></p>
<p>In <strong>User: </strong>for example if your gmail username is <strong>yourname@gmail.com</strong> you should enter only<strong> yourname</strong>.</p>
<p><strong>Password: </strong>for password field you should use password generated on the google code for the specific project.</p>
<p>Now click <strong>Next</strong>.</p>
<p>On the next screen just click <strong>Finish </strong>and after that Netbeans will require from you to either open new project or open existing project if repository is empty.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2009/05/how-to-switch-default-netbeans-jdk" rel="bookmark" title="Friday 08.05.2009">How to switch default Netbeans JDK</a></li>
<li><a href="http://www.axino.net/tutorials" rel="bookmark" title="Wednesday 07.01.2009">Tutorials</a></li>
<li><a href="http://www.axino.net/programming/javascript-programming/2009/10/kingsagex-version-0-55" rel="bookmark" title="Saturday 03.10.2009">KingsAgeX :: version 0.55</a></li>
<li><a href="http://www.axino.net/tutorial/2010/05/hack-test-com-5-annoying-window" rel="bookmark" title="Wednesday 12.05.2010">hack-test.com 5 :: annoying window</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/02/swat2010-preview" rel="bookmark" title="Friday 05.02.2010">SWAT2010 preview</a></li>
</ul>
<p><!-- Similar Posts took 5.411 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=726" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/tutorial/2009/12/how-to-use-netbeans-and-google-code/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Addind content in JTable</title>
		<link>http://www.axino.net/tutorial/2009/11/addind-content-in-jtable</link>
		<comments>http://www.axino.net/tutorial/2009/11/addind-content-in-jtable#comments</comments>
		<pubDate>Tue, 03 Nov 2009 05:49:00 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JTable]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=582</guid>
		<description><![CDATA[Java tutorial on this subject is complex and long opposite to other java tutorials. And as I have problem figuring this out, let me share with you probably the simplest way of inputting content into JTable. First thing you need is DefaultTableModel. We will initialize one object named mod. DefaultTableModel mod = new DefaultTableModel&#40;&#41;; Next step is [...]]]></description>
			<content:encoded><![CDATA[<p>Java tutorial on this subject is complex and long opposite to other java tutorials. And as I have problem figuring this out, let me share with you probably the simplest way of inputting content into JTable.</p>
<p><span id="more-582"></span>First thing you need is <strong>DefaultTableModel</strong>. We will initialize one object named <strong>mod</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">DefaultTableModel</span> mod <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">DefaultTableModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next step is entering column names. As usual you want to represent some sort of data in table. Now let&#8217;s say we want to enter some student data in the table.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">mod.<span style="color: #006633;">addColumn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mod.<span style="color: #006633;">addColumn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Surname&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mod.<span style="color: #006633;">addColumn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Student ID&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mod.<span style="color: #006633;">addColumn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Dorm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mod.<span style="color: #006633;">addColumn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Room number&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So we will have five columns named <strong>Name, Surname, Student ID, Dorm, Room number</strong>. Now we need to enter data in rows of table. We will do this by initializing <strong>Object array</strong>. I strongly suggest that the size of this array is as the number of columns therefore 5.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> data <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now we need to fill out this array with data.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;John&quot;</span><span style="color: #339933;">;</span>
data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Doe&quot;</span><span style="color: #339933;">;</span>
data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;666&quot;</span><span style="color: #339933;">;</span>
data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #339933;">;</span>
data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;203&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now as we this array filled out next step is to add it in the row of table.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">mod.<span style="color: #006633;">addRow</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you want to add more rows then I suggest you wrap previous two code blocks into some loop. As shown below.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">do</span><span style="color: #009900;">&#123;</span>
     data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;John&quot;</span><span style="color: #339933;">;</span>
     data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Doe&quot;</span><span style="color: #339933;">;</span>
     data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;666&quot;</span><span style="color: #339933;">;</span>
     data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;F&quot;</span><span style="color: #339933;">;</span>
     data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;203&quot;</span><span style="color: #339933;">;</span>
     mod.<span style="color: #006633;">addRow</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     i<span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Technically this code will add five same rows. But if you read data from somewhere else then you will be able to enter different data. Point here was to show how you may enter several rows one behind the other.</p>
<p>Final thing we need to do is to set our model (<strong>mod</strong>) as default model for table and data will appear in it.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">jTable1.<span style="color: #006633;">setModel</span><span style="color: #009900;">&#40;</span>mod<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now, sometimes you might not obtain desired result so you should just refresh table and your content will appear. <strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2009/10/connect-to-mysql-database-in-java" rel="bookmark" title="Wednesday 21.10.2009">Connect to mysql database in java</a></li>
<li><a href="http://www.axino.net/tutorial/2009/12/hackthissite-org-extbasic-1-over-and-out" rel="bookmark" title="Wednesday 23.12.2009">hackthissite.org extbasic 1 :: Over and out?</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/basic-web-hacking-8-simple-sql" rel="bookmark" title="Monday 16.11.2009">Basic web hacking 8 :: simple SQL</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/04/java-glassfish-and-ubuntu-server" rel="bookmark" title="Friday 30.04.2010">java glassfish and ubuntu server</a></li>
<li><a href="http://www.axino.net/tutorial/2009/06/how-to-obtain-get-parameters-from-url-with-javascript" rel="bookmark" title="Tuesday 09.06.2009">How to obtain get parameters from URL with javascript</a></li>
</ul>
<p><!-- Similar Posts took 6.062 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=582" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/tutorial/2009/11/addind-content-in-jtable/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connect to mysql database in java</title>
		<link>http://www.axino.net/tutorial/2009/10/connect-to-mysql-database-in-java</link>
		<comments>http://www.axino.net/tutorial/2009/10/connect-to-mysql-database-in-java#comments</comments>
		<pubDate>Wed, 21 Oct 2009 21:37:05 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=497</guid>
		<description><![CDATA[Since this is not trivial as one might think. I will go slowly trough the process of creating connection and finally statement (reading data, writing or deleting ). First thing you need is access to the mysql server, I strongly suggest using WAMP or XAMPP for windows based users or LAMP or XAMPP for linux based users. After [...]]]></description>
			<content:encoded><![CDATA[<p>Since this is not trivial as one might think. I will go slowly trough the process of creating connection and finally statement (reading data, writing or deleting ).</p>
<p><span id="more-497"></span></p>
<p>First thing you need is access to the mysql server, I strongly suggest using <a href="http://www.wampserver.com/en/download.php" target="_blank">WAMP </a>or <a href="http://www.apachefriends.org/en/xampp-windows.html" target="_blank">XAMPP </a>for windows based users or <a href="http://www.sph.umich.edu/csg/abecasis/LAMP/download/" target="_blank">LAMP </a>or <a href="http://www.apachefriends.org/en/xampp-linux.html">XAMPP </a>for linux based users. After you install any of these packages you are required to start mysql database server (service). Of course if you want to create some sort of database you should either use command line interface for mysql or phpmyadmin which comes included in packages I suggested before. PhpMyAdmin is used for operating MySQL based database and great learning tool as it for any action you do trough interface you will be able to see SQL code.</p>
<p>Now let&#8217;s continue with Java.</p>
<p>To star connection you will require following code:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Connection</span> conn <span style="color: #339933;">=</span> <span style="color: #003399;">DriverManager</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jdbc:mysql://127.0.0.1:3306/somedb&quot;</span>, <span style="color: #0000ff;">&quot;root&quot;</span>, <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The following statement means that you are using <strong>java database connection</strong> using <strong>mysql protocol</strong> connecting to <strong>somedb </strong>meanwhile user with which you connect to database is <strong>root</strong> and this user is using <strong>empty password</strong> as it is default in the previously mentioned packages.</p>
<p>When you execute previous statement you are establishing connection to database. On the other hand very important thing is to close connection to database otherwise you will slow down your server and your application will work slowly.</p>
<p>To close connection to database you need to invoke method in Connection object:&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">conn.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now let&#8217;s say that we have table in the database <strong>somedb </strong>named <strong>students</strong>. Table students contains fields <strong>student_id</strong>, <strong>name</strong>, <strong>surname</strong>, <strong>citizenship</strong>.  To read data from this table we are going to use basic SQL statement.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> students</pre></div></div>

<p>Upper statement means that we select all fields that is all columns and rows from table students. Now let&#8217;s see how to execute this statement.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">PreparedStatement</span> studs <span style="color: #339933;">=</span> conn.<span style="color: #006633;">prepareStatement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM students&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This means that we are preparing statement to be execute <em>trough</em> our established connection. Also if you have googled or binged then you might have noticed that some are using statement instead of preparedstatement. Difference is huge! Not in this particular example but as you get better it is always good to use proper programming from beginning then to start changing something later on when you figure that it is <strong>insecure</strong> or wrong. Yes the difference is in security just on short notice. In statement you can place trough SQL injection but if you use preparedstatement this will not pass checking or all special characters will be escaped.</p>
<p>Next step is to execute our query!</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">ResultSet</span> rs <span style="color: #339933;">=</span> studs.<span style="color: #006633;">executeQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This represents execution of preparedstatement studs. Returned object is ResultSet from which we are able to obtain data from database.</p>
<p>Now let&#8217;s say that you would like read data about student in the first row. You should use following code.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">rs.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;student_id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rs.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rs.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;surname&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rs.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;citizenship&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Using that code you can obtain all data that can be stored in this table. To move on the next record you will use following method:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">rs.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And always remember to close the connection to the database!<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2010/05/how-to-grant-privilege-to-users-on-mysql-database" rel="bookmark" title="Sunday 02.05.2010">How to grant privilege to users on MySQL database</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/addind-content-in-jtable" rel="bookmark" title="Tuesday 03.11.2009">Addind content in JTable</a></li>
<li><a href="http://www.axino.net/tutorial/2010/05/mysql-server-and-ubuntu" rel="bookmark" title="Saturday 01.05.2010">mysql server and ubuntu</a></li>
<li><a href="http://www.axino.net/tutorial/2009/11/basic-web-hacking-8-simple-sql" rel="bookmark" title="Monday 16.11.2009">Basic web hacking 8 :: simple SQL</a></li>
<li><a href="http://www.axino.net/programming/java-programming/2010/04/java-glassfish-and-ubuntu-server" rel="bookmark" title="Friday 30.04.2010">java glassfish and ubuntu server</a></li>
</ul>
<p><!-- Similar Posts took 5.941 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=497" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/tutorial/2009/10/connect-to-mysql-database-in-java/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Toxic pool simulator in java</title>
		<link>http://www.axino.net/programming/2009/09/toxic-pool-simulator-in-java</link>
		<comments>http://www.axino.net/programming/2009/09/toxic-pool-simulator-in-java#comments</comments>
		<pubDate>Tue, 22 Sep 2009 18:37:07 +0000</pubDate>
		<dc:creator>Arxleol</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programs]]></category>

		<guid isPermaLink="false">http://www.axino.net/?p=464</guid>
		<description><![CDATA[This is same as previous post. The only difference is this one is written in Java in netbeans therefore has user interface more suitable for fast testing Any suggestions are welcomed of course&#8230; toxicpoolsSimilar Posts: How to switch default Netbeans JDK Connect to mysql database in java KingsAgeX :: version 0.57 milestone How to use [...]]]></description>
			<content:encoded><![CDATA[<p>This is same as <a href="http://www.axino.net/programming/2009/09/scilab" target="_blank">previous post</a>. The only difference is this one is written in Java in netbeans therefore has user interface more suitable for fast testing <img src='http://www.axino.net/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><span id="more-464"></span>Any suggestions are welcomed of course&#8230;</p>
<p><a href="http://www.axino.net/wordpress/wp-content/uploads/2009/09/bazeni.jar">toxicpools</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.axino.net/tutorial/2009/05/how-to-switch-default-netbeans-jdk" rel="bookmark" title="Friday 08.05.2009">How to switch default Netbeans JDK</a></li>
<li><a href="http://www.axino.net/tutorial/2009/10/connect-to-mysql-database-in-java" rel="bookmark" title="Wednesday 21.10.2009">Connect to mysql database in java</a></li>
<li><a href="http://www.axino.net/programming/javascript-programming/2009/10/kingsagex-version-0-57" rel="bookmark" title="Wednesday 28.10.2009">KingsAgeX :: version 0.57 milestone</a></li>
<li><a href="http://www.axino.net/tutorial/2009/12/how-to-use-netbeans-and-google-code" rel="bookmark" title="Monday 28.12.2009">How to use Netbeans and Google code</a></li>
<li><a href="http://www.axino.net/programming/javascript-programming/2009/11/kingsagex-version-0-60" rel="bookmark" title="Friday 20.11.2009">Kingsagex :: version 0.60</a></li>
</ul>
<p><!-- Similar Posts took 5.649 ms --></p>
 <img src="http://www.axino.net/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=464" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.axino.net/programming/2009/09/toxic-pool-simulator-in-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
