<?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>The Bucket @ Utropicmedia &#187; Java</title>
	<atom:link href="http://utropicmedia.net/blog/category/development/java/feed" rel="self" type="application/rss+xml" />
	<link>http://utropicmedia.net/blog</link>
	<description>SaaS, Managed Hosting, Disaster Recovery, Colocation News and Information</description>
	<lastBuildDate>Sun, 29 Apr 2018 04:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Asymmetric Cryptography in Java</title>
		<link>http://utropicmedia.net/blog/asymmetric-cryptography-in-java</link>
		<comments>http://utropicmedia.net/blog/asymmetric-cryptography-in-java#comments</comments>
		<pubDate>Sat, 04 Sep 2010 02:52:23 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Asymmetric]]></category>
		<category><![CDATA[Cryptography]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/asymmetric-cryptography-in-java</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><strong>Asymmetric Cryptography in Java</strong></p>
<p> </p>
<p>&#13;</p>
<p>Security plays a significant role in our day to day life. So far software applications are concerned, security of data is required for authentication and for several validations. Normally while developing the applications, we use the concept of cryptography for password encryption and decryption. Some applications require more security, so they go for high end security system like trusted security certificates. The security mainly focuses on the integrity of the data at the several ends.</p>
<p>&#13;</p>
<p>Technicalities For data security Java Cryptography provides a suitable framework to implement several kinds of cryptography. However there are basically two types of cryptography. Once is Symmetric Cryptography and Asymmetric Cryptography. When both the ends communicate the secured data with a common key for encryption and decryption, it is called the Symmetric Cryptography. In this case a shared key is used by both the parties to encrypt and decrypt the data. However there is a problem relating to exchange of key for symmetric cryptography. To overcome this problem java provides another approach for the cryptography called Asymmetric Cryptography. In case of Asymmetric cryptography, there will be two keys unlike one key in case of symmetric cryptography. One key is called Private key and other is called Public key. These two keys are generated together and can be used for encryption and decryption. In this case the Public key is used by anyone who wishes to communicate securely with the owner of the Private key. The Private key is used by the main owner and the owner gives the Public key so that they can decrypt the data. In this article I will give you the example on Asymmetric cryptography. You can find more tutorials and concept on Sun’s JCE(Java Cryptography Extension). In my next article, I will provide you the example on Symmetric cryptography.</p>
<p>&#13;</p>
<p>Complete Example This example is only meant for learning and not for any specific use. You can take the piece of code to test in your system to learn the above concept.</p>
<p>&#13;</p>
<p>The following class is used to create the Public key and Private key. This class contains generic methods to generate the Public and Private key. If you run the testharness class, you will find the two files called “Public.key” and “Private.key”. Please go through the java docs mentioned in the methods.</p>
<p>&#13;</p>
<p>Class Name : &#8211; KeyCreator.java</p>
<p>&#13;</p>
<p><p>package com.dds.security;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.io.FileOutputStream;</p>
<p>&#13;</p>
<p>import java.io.IOException;</p>
<p>&#13;</p>
<p>import java.security.KeyPair;</p>
<p>&#13;</p>
<p>import java.security.KeyPairGenerator;</p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This class is used to generate the Private and Public key file.</p>
<p>&#13;</p>
<p> * The Public.key file and Private.key file will be generated in the</p>
<p>&#13;</p>
<p> * current directory.</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class KeyCreator</p>
<p>&#13;</p>
<p>{</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Object of type {@link PublicKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private PublicKey publicKey = null;</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Object of type {@link PrivateKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private PrivateKey privateKey = null;</p>
<p>&#13;</p>
<p>           </p>
<p>&#13;</p>
<p>            /**Default constructor.</p>
<p>&#13;</p>
<p>             * Here KeyPair object is initialized and</p>
<p>&#13;</p>
<p>             * thereby public key and private key objects</p>
<p>&#13;</p>
<p>             * are created.</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public KeyCreator() throws Exception</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        super();</p>
<p>&#13;</p>
<p>                        /*</p>
<p>&#13;</p>
<p>                         * The following line is used to</p>
<p>&#13;</p>
<p>                         * generate the Public and Private</p>
<p>&#13;</p>
<p>                         * key.</p>
<p>&#13;</p>
<p>                         */</p>
<p>&#13;</p>
<p>                        KeyPair keyPair = KeyPairGenerator</p>
<p>&#13;</p>
<p>                        .getInstance(&#8220;RSA&#8221;)</p>
<p>&#13;</p>
<p>                        .generateKeyPair();</p>
<p>&#13;</p>
<p>                        publicKey = keyPair.getPublic();</p>
<p>&#13;</p>
<p>                        privateKey = keyPair.getPrivate();</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>           </p>
<p>&#13;</p>
<p>            /**Method to return the {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @return the {@link PublicKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PublicKey getPublicKey() {</p>
<p>&#13;</p>
<p>                        return publicKey;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**Method to return the {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @return the {@link PrivateKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PrivateKey getPrivateKey() {</p>
<p>&#13;</p>
<p>                        return privateKey;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>           </p>
<p>&#13;</p>
<p>            /**Method used to write the Public or Private</p>
<p>&#13;</p>
<p>             * key file.</p>
<p>&#13;</p>
<p>             * @param filename of type String indicating</p>
<p>&#13;</p>
<p>             * the name of Public or Private key</p>
<p>&#13;</p>
<p>             * @param contents of the key</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public void writeKey(String filename, byte[] contents)</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>        try</p>
<p>&#13;</p>
<p>        {</p>
<p>&#13;</p>
<p>            FileOutputStream fos = new FileOutputStream(filename);</p>
<p>&#13;</p>
<p>            fos.write(contents);</p>
<p>&#13;</p>
<p>            fos.flush();</p>
<p>&#13;</p>
<p>            fos.close();</p>
<p>&#13;</p>
<p>        }</p>
<p>&#13;</p>
<p>        catch (IOException e)</p>
<p>&#13;</p>
<p>        {</p>
<p>&#13;</p>
<p>            e.printStackTrace();</p>
<p>&#13;</p>
<p>        }</p>
<p>&#13;</p>
<p>    }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;
</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The following class is used to read the “Public.key” and “Private.key” generated by the above program. If you are the owner you can have the “Private.key” file based upon which you have to encrypt the data and give your “Public.key” file to other end who wants to decrypt the data. In this following class, you can read both the “Public.key” and “Private.key” files.</p>
<p>&#13;</p>
<p>Class Name:- KeyReader.java</p>
<p>&#13;</p>
<p><p>package com.dds.security;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.io.ByteArrayOutputStream;</p>
<p>&#13;</p>
<p>import java.io.FileInputStream;</p>
<p>&#13;</p>
<p>import java.io.IOException;</p>
<p>&#13;</p>
<p>import java.security.KeyFactory;</p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p>import java.security.spec.PKCS8EncodedKeySpec;</p>
<p>&#13;</p>
<p>import java.security.spec.X509EncodedKeySpec;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**</p>
<p>&#13;</p>
<p> * This class is used to read the Private and Public key</p>
<p>&#13;</p>
<p> * files generated using the Java&#8217;s Asysmmetric Security</p>
<p>&#13;</p>
<p> * system.</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class KeyReader</p>
<p>&#13;</p>
<p>{</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Object of type {@link KeyFactory}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private KeyFactory keyFactory = null;</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Default constructor to initialize the</p>
<p>&#13;</p>
<p>             * keyFactory.</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public KeyReader()</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        super();</p>
<p>&#13;</p>
<p>                        try</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    keyFactory = KeyFactory.getInstance(&#8220;RSA&#8221;);</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        catch( Exception e )</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to read the bytes from the file.</p>
<p>&#13;</p>
<p>             * The file can be a Public key file or a Private key</p>
<p>&#13;</p>
<p>             * file. In this file, you have stored the security key,</p>
<p>&#13;</p>
<p>             * based upon which encryption and decryption can be</p>
<p>&#13;</p>
<p>             * performed.</p>
<p>&#13;</p>
<p>             * @param fileName of type String indicating the file name</p>
<p>&#13;</p>
<p>             * @return the bytes from the file</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private byte[] getKeyData( String fileName ) throws Exception</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        FileInputStream fis = new FileInputStream(fileName);</p>
<p>&#13;</p>
<p>                        ByteArrayOutputStream baos = new ByteArrayOutputStream();</p>
<p>&#13;</p>
<p>                        int b;</p>
<p>&#13;</p>
<p>                        try</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    while ((b = fis.read()) != -1)</p>
<p>&#13;</p>
<p>                                    {</p>
<p>&#13;</p>
<p>                                                baos.write(b);</p>
<p>&#13;</p>
<p>                                    }</p>
<p>&#13;</p>
<p>                                    fis.close();</p>
<p>&#13;</p>
<p>                                    baos.flush();</p>
<p>&#13;</p>
<p>                                    baos.close();</p>
<p>&#13;</p>
<p>                        } catch (IOException e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return baos.toByteArray();</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to return the object of type</p>
<p>&#13;</p>
<p>             * {@link PrivateKey}. In this method you have to pass</p>
<p>&#13;</p>
<p>             * the file name of the Private.key file.</p>
<p>&#13;</p>
<p>             * @param filename of type String indicating the</p>
<p>&#13;</p>
<p>             * file name.</p>
<p>&#13;</p>
<p>             * @return the object of type {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PrivateKey getPrivateKey( String filename ) throws Exception</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        PrivateKey privateKey = null;</p>
<p>&#13;</p>
<p>                        try</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    byte[] keydata = getKeyData(filename);</p>
<p>&#13;</p>
<p>                                    PKCS8EncodedKeySpec encodedPrivateKey = new PKCS8EncodedKeySpec(keydata);</p>
<p>&#13;</p>
<p>                                    privateKey = keyFactory.generatePrivate(encodedPrivateKey);</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        catch( Exception e )</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return privateKey;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>            /**This method is used to return the object of type</p>
<p>&#13;</p>
<p>             * {@link PublicKey}. In this method you have to pass</p>
<p>&#13;</p>
<p>             * the file name of the Public.key file.</p>
<p>&#13;</p>
<p>             * @param filename of type String indicating the</p>
<p>&#13;</p>
<p>             * file name.</p>
<p>&#13;</p>
<p>             * @return the object of type {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PublicKey getPublicKey( String filename ) throws Exception</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        PublicKey publicKey = null;</p>
<p>&#13;</p>
<p>                        try</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    byte[] keydata = getKeyData(filename);</p>
<p>&#13;</p>
<p>                                    X509EncodedKeySpec encodedPublicKey = new X509EncodedKeySpec(keydata);</p>
<p>&#13;</p>
<p>                                    publicKey = keyFactory.generatePublic(encodedPublicKey);</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        catch( Exception e )</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return publicKey;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;
</p>
<p>&#13;</p>
<p>The following class is a utility class which is used to encrypt and decrypt the data.</p>
<p>&#13;</p>
<p>ClassName :- SecurityUtil.java</p>
<p>&#13;</p>
<p><p>package com.dds.security;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import javax.crypto.Cipher;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This is a utility class to provide</p>
<p>&#13;</p>
<p> * encryption and decryption based upon</p>
<p>&#13;</p>
<p> * the key. The key can be your either</p>
<p>&#13;</p>
<p> * Public or Private .</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class SecurityUtil</p>
<p>&#13;</p>
<p>{</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Object of type {@link Cipher}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private static Cipher cipher = null;</p>
<p>&#13;</p>
<p>            /*</p>
<p>&#13;</p>
<p>             * The following static is used to</p>
<p>&#13;</p>
<p>             * initialize the Cipher object</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            static</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        try</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    cipher = Cipher.getInstance(&#8220;RSA&#8221;);</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        catch( Exception e )</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>            /**Method used to encrypt the string and return as bytes.</p>
<p>&#13;</p>
<p>             * Here the input parameter will be your Private key.</p>
<p>&#13;</p>
<p>             * You have to encrypt the string using your private</p>
<p>&#13;</p>
<p>             * key at your end.</p>
<p>&#13;</p>
<p>             * @param messsageBytes , it is the bytes from the</p>
<p>&#13;</p>
<p>             * string to encrypt</p>
<p>&#13;</p>
<p>             * @param privateKey of type {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @return encrypted bytes</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public static byte[] getEncryptedBytes( byte[] messsageBytes , PrivateKey privateKey) throws Exception</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        byte[] encryptedBytes = null;</p>
<p>&#13;</p>
<p>                        cipher.init(Cipher.ENCRYPT_MODE , privateKey );</p>
<p>&#13;</p>
<p>                        encryptedBytes = cipher.doFinal(messsageBytes);</p>
<p>&#13;</p>
<p>                        return encryptedBytes;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>            /**Method used to decrypt the string and return as bytes.</p>
<p>&#13;</p>
<p>             * Here the input parameter will be your Public key.</p>
<p>&#13;</p>
<p>             * You have to decrypt the string using your Public</p>
<p>&#13;</p>
<p>             * key at the destination end.</p>
<p>&#13;</p>
<p>             * @param messsageBytes , it is the bytes from the</p>
<p>&#13;</p>
<p>             * string to encrypt</p>
<p>&#13;</p>
<p>             * @param publicKey of type {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @return decrypted bytes</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public static byte[] getDecryptedBytes( byte[] messsageBytes , PublicKey publicKey)throws Exception</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        byte[] decryptedBytes = null;</p>
<p>&#13;</p>
<p>                        cipher.init(Cipher.DECRYPT_MODE , publicKey );</p>
<p>&#13;</p>
<p>                        decryptedBytes = cipher.doFinal( messsageBytes );</p>
<p>&#13;</p>
<p>                        return decryptedBytes;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;
</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The following is test harness class to test the functionality of the above program. Please go through the comments and java docs of the above and below programs.</p>
<p>&#13;</p>
<p>Class Name :- SecurityTestHarness.java</p>
<p>&#13;</p>
<p><p>package com.security.testharness;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import com.dds.security.KeyCreator;</p>
<p>&#13;</p>
<p>import com.dds.security.KeyReader;</p>
<p>&#13;</p>
<p>import com.dds.security.SecurityUtil;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This is a test harness class used to</p>
<p>&#13;</p>
<p> * encrypt and decrypt the string based</p>
<p>&#13;</p>
<p> * upon the Public and Private key.</p>
<p>&#13;</p>
<p> * This class also helps to test how</p>
<p>&#13;</p>
<p> * Public and Private key can be created.</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class SecurityTestHarness</p>
<p>&#13;</p>
<p>{</p>
<p>&#13;</p>
<p>            public static void main(String[] args)</p>
<p>&#13;</p>
<p>            {</p>
<p>&#13;</p>
<p>                        try</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    /*</p>
<p>&#13;</p>
<p>                                     * The following lines will generate the</p>
<p>&#13;</p>
<p>                                     * PublicKey and PrivateKey files.</p>
<p>&#13;</p>
<p>                                     */</p>
<p>&#13;</p>
<p>                                    KeyCreator keyCreator = new KeyCreator();</p>
<p>&#13;</p>
<p>                                    PublicKey publicKey = keyCreator.getPublicKey();</p>
<p>&#13;</p>
<p>                                    PrivateKey privateKey = keyCreator.getPrivateKey();</p>
<p>&#13;</p>
<p>                                    /*</p>
<p>&#13;</p>
<p>                                     * Generate two files named Public.key and Private.key</p>
<p>&#13;</p>
<p>                                     */</p>
<p>&#13;</p>
<p>                                    keyCreator.writeKey(&#8220;Public.key&#8221;, publicKey.getEncoded());</p>
<p>&#13;</p>
<p>                                    keyCreator.writeKey(&#8220;Private.key&#8221;, privateKey.getEncoded());</p>
<p>&#13;</p>
<p>                                    /*</p>
<p>&#13;</p>
<p>                                     * Get the public and private key</p>
<p>&#13;</p>
<p>                                     */</p>
<p>&#13;</p>
<p>                                    KeyReader keyReader = new KeyReader();</p>
<p>&#13;</p>
<p>                                    PublicKey publicKey2 = keyReader.getPublicKey(&#8220;Public.key&#8221;);</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;Public Key&#8212;-&#8221;+publicKey2);</p>
<p>&#13;</p>
<p>                                    PrivateKey privateKey2 = keyReader.getPrivateKey(&#8220;Private.key&#8221;);</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;Private Key&#8212;-&#8221;+privateKey2);</p>
<p>&#13;</p>
<p>                                   </p>
<p>&#13;</p>
<p>                                    String str = &#8220;Hi, Hello World, Welcome to the World of Java&#8221;;</p>
<p>&#13;</p>
<p>                                    byte[] stringBytes = str.getBytes();</p>
<p>&#13;</p>
<p>                                    byte[] encryptedBytes = SecurityUtil.getEncryptedBytes(</p>
<p>&#13;</p>
<p>                                                            stringBytes, privateKey2);</p>
<p>&#13;</p>
<p>                                    String encryptedString = new String(encryptedBytes);</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;EncryptedString&#8212;-&#8221;+encryptedString);</p>
<p>&#13;</p>
<p>                                   </p>
<p>&#13;</p>
<p>                                    byte[] decryptedBytes = SecurityUtil.getDecryptedBytes(encryptedBytes, publicKey2);</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;Decrypted String&#8212;-&#8221;+new String(decryptedBytes));</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        catch( Exception e )</p>
<p>&#13;</p>
<p>                        {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;
</p>
<p>&#13;</p>
<p>To test the above programs, please create the appropriate package as mentioned in the program. You can also create your own package and modify the package name in the above programs. You can all the code in your favorable java editor.</p>
<p>&#13;</p>
<p>Conclusion I hope that you will enjoy my article. If you find any problems or errors, please feel free to send me a mail in the address debadattamishra@aol.com . This article is only meant for those who are new to java development. This article does not bear any commercial significance. Please provide me the feedback about this article.</p>
<p>&#13;</p>
<p> </p>
<div></div>
<p>Related <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/asymmetric-cryptography-in-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use of Hibernate With Java Persistence Api</title>
		<link>http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api</link>
		<comments>http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api#comments</comments>
		<pubDate>Fri, 27 Aug 2010 11:31:52 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Persistence]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api</guid>
		<description><![CDATA[Use of Hibernate With Java Persistence Api   &#13; Before we start any discussion about Persistence technologies, we need to understand what exactly Persistence is in computer science. Persistence, in simple terms is the ability to retain data structures between various program executions. A perfect example of this would be a word processor saving undo [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Use of Hibernate With Java Persistence Api</strong></p>
<p> </p>
<p>&#13;</p>
<p>Before we start any discussion about Persistence technologies, we need to understand what exactly Persistence is in computer science. Persistence, in simple terms is the ability to retain data structures between various program executions. A perfect example of this  would be a word processor saving undo history. In practice, this is achieved by storing the data in non- volatile storage such as a  file system or a relational database or an object database.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The popularity of databases has increased manifold in the past few years. Java has become the preferred choice of developers for developing secure, flexible, and scalable database driven web applications. These web applications require objects to be associated with appropriate databases. Hibernate, along with other persistence technologies associate’s objects with the appropriate database in a simple, straight forward and natural way.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Hibernate is one such effort from the Java community to develop many object oriented solutions to data persistence. Any kind of Java persistence solution includes  two main elements i.e. ORM (Object Relational Mapping) and OOM (Object Oriented Modeling).</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Hibernate has become immensely popular  amongst the developer community as it is a free, powerful, high performance open source object &#8211; relational mapping persistence Java package that makes it easier to work with relational databases for Java Applications.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Apart from Hibernate, other popular open source Java persistence technologies include JDBC, abates, JDO, Top Link and CMP Entity Beans. These technologies  provide a standardized object-relational mapping mechanism.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Java persistence application programming Interface or JAVA Persistence API is the latest version of the Java Data Objects (JDO) technology which was the earlier persistent technology used by developers. JPA or the Java Persistence API is the latest Java Specification standard for java enterprise applications. The Java Persistence API is a java programming language framework that allows developers to manage relational data in Java standard edition and Enterprise Edition applications. Java Persistence API originated as part of the work of the JSR 220 expert group.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The java persistence API’s has been developed after drawing upon the best ideas from other prevalent persistence technologies like Top link, JDO, Hibernate etc. In simple words, Java Persistence API is a Plain Old Java Object API for object /relational mapping and supports a rich, SQL –like query language for both static and dynamic queries.Vendors involved in application development have found that the use of Hibernate technology with Java persistence API’s helps build flexible, database driven web applications that are highly scalable and involve complex business processes.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The Java Persistence API is the standard object/relational mapping and persistence management interface of the Java EE 5.0 platform and Java Web Services Development . As part of the EJB 3.0 specification effort, it is supported by all major vendors of the Java industry for improving Java Web Development in India and Globe.</p>
<div></div>
<p>More <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encryption Using Rsa Algorithm in Java</title>
		<link>http://utropicmedia.net/blog/encryption-using-rsa-algorithm-in-java</link>
		<comments>http://utropicmedia.net/blog/encryption-using-rsa-algorithm-in-java#comments</comments>
		<pubDate>Fri, 27 Aug 2010 01:39:56 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Using]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/encryption-using-rsa-algorithm-in-java</guid>
		<description><![CDATA[Encryption Using Rsa Algorithm in Java Encryption using RSA algorithm in java &#13;   &#13; Introduction &#13; In this article I will provide you an approach of using RSA algorithm for long String. As you know that RSA algorithm is limited 117 bytes, long strings can not be encrypted or decrypted. However it is possible [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Encryption Using Rsa Algorithm in Java</strong></p>
<p><strong>Encryption using RSA algorithm in java</strong></p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Introduction</p>
<p>&#13;</p>
<p>In this article I will provide you an approach of using RSA algorithm for long String. As you know that RSA algorithm is limited 117 bytes, long strings can not be encrypted or decrypted. However it is possible to break the bytes into several chunks and then to encrypt or decrypt the contents. This algorithm is used for asymmetric cryptography. For asymmetric cryptography, you can click this link.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Technicalities</p>
<p>&#13;</p>
<p>In this article I provide below the complete example for encryption and decryption of long strings. If you use the method of Cipher class ie.doFinal( byte[] bytesString), it will throw exception that it can be encrypted for more than 117 bytes for RSA.  But in the real application, you may not be sure about the length of the String you want to encrypt or decrypt. In this case you have to break the bytes and then to encrypt it. Please refer to the</p>
<p>&#13;</p>
<p>Following complete example.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Complete example</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Class name : SecurityUtil.java</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>package com.dds.core.security;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.security.KeyFactory;</p>
<p>&#13;</p>
<p>import java.security.KeyPair;</p>
<p>&#13;</p>
<p>import java.security.KeyPairGenerator;</p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p>import java.security.Security;</p>
<p>&#13;</p>
<p>import java.security.spec.EncodedKeySpec;</p>
<p>&#13;</p>
<p>import java.security.spec.PKCS8EncodedKeySpec;</p>
<p>&#13;</p>
<p>import java.security.spec.X509EncodedKeySpec;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import javax.crypto.Cipher;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import sun.misc.BASE64Decoder;</p>
<p>&#13;</p>
<p>import sun.misc.BASE64Encoder;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import com.sun.crypto.provider.SunJCE;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This is a utility class which provides</p>
<p>&#13;</p>
<p> * convenient method for security. This</p>
<p>&#13;</p>
<p> * class provides the way where you can</p>
<p>&#13;</p>
<p> * encrypt and decrypt the String having</p>
<p>&#13;</p>
<p> * more than 117 bytes for RSA algorithm</p>
<p>&#13;</p>
<p> * which is an asymmetric one.</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class SecurityUtil {</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Object of type {@link KeyPair}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private KeyPair keyPair;</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * String variable which denotes the algorithm</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private static final String ALGORITHM = &#8220;RSA&#8221;;</p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * varibale for the keysize</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private static final int KEYSIZE = 1024;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * Default constructor</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public SecurityUtil() {</p>
<p>&#13;</p>
<p>                        super();</p>
<p>&#13;</p>
<p>                        Security.addProvider(new SunJCE());</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * This method is used to generate</p>
<p>&#13;</p>
<p>             * the key pair.</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public void invokeKeys() {</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    KeyPairGenerator keypairGenerator = KeyPairGenerator</p>
<p>&#13;</p>
<p>                                    .getInstance(ALGORITHM);</p>
<p>&#13;</p>
<p>                                    keypairGenerator.initialize(KEYSIZE);</p>
<p>&#13;</p>
<p>                                    keyPair = keypairGenerator.generateKeyPair();</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain the String</p>
<p>&#13;</p>
<p>             * representation of the PublicKey.</p>
<p>&#13;</p>
<p>             * @param publicKey of type {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @return PublicKey as a String</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public String getPublicKeyString(PublicKey publicKey) {</p>
<p>&#13;</p>
<p>                        return new BASE64Encoder().encode(publicKey.getEncoded());</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain the String</p>
<p>&#13;</p>
<p>             * representation of the PrivateKey.</p>
<p>&#13;</p>
<p>             * @param privateKey of type {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @return PrivateKey as a String</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public String getPrivateKeyString(PrivateKey privateKey) {</p>
<p>&#13;</p>
<p>                        return new BASE64Encoder().encode(privateKey.getEncoded());</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain the</p>
<p>&#13;</p>
<p>             * {@link PrivateKey} object from the</p>
<p>&#13;</p>
<p>             * String representation.</p>
<p>&#13;</p>
<p>             * @param key of type String</p>
<p>&#13;</p>
<p>             * @return {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PrivateKey getPrivateKeyFromString(String key) throws Exception {</p>
<p>&#13;</p>
<p>                        PrivateKey privateKey = null;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM);</p>
<p>&#13;</p>
<p>                                    EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(</p>
<p>&#13;</p>
<p>                                                            new BASE64Decoder().decodeBuffer(key));</p>
<p>&#13;</p>
<p>                                    privateKey = keyFactory.generatePrivate(privateKeySpec);</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return privateKey;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain the {@link PublicKey}</p>
<p>&#13;</p>
<p>             * from the String representation of the Public Key.</p>
<p>&#13;</p>
<p>             * @param key of type String</p>
<p>&#13;</p>
<p>             * @return {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PublicKey getPublicKeyFromString(String key) throws Exception {</p>
<p>&#13;</p>
<p>                        PublicKey publicKey = null;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM);</p>
<p>&#13;</p>
<p>                                    EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(</p>
<p>&#13;</p>
<p>                                                            new BASE64Decoder().decodeBuffer(key));</p>
<p>&#13;</p>
<p>                                    publicKey = keyFactory.generatePublic(publicKeySpec);</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return publicKey;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain the</p>
<p>&#13;</p>
<p>             * encrypted contents from the original</p>
<p>&#13;</p>
<p>             * contents by passing the {@link PublicKey}.</p>
<p>&#13;</p>
<p>             * This method is useful when the byte is more</p>
<p>&#13;</p>
<p>             * than 117.</p>
<p>&#13;</p>
<p>             * @param text of type String</p>
<p>&#13;</p>
<p>             * @param key of type {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @return encrypted value as a String</p>
<p>&#13;</p>
<p>             * @throws Exception</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public String getEncryptedValue(String text, PublicKey key)</p>
<p>&#13;</p>
<p>            throws Exception {</p>
<p>&#13;</p>
<p>                        String encryptedText;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    byte[] textBytes = text.getBytes(&#8220;UTF8&#8243;);</p>
<p>&#13;</p>
<p>                                    Cipher cipher = Cipher.getInstance(&#8220;RSA/ECB/PKCS1Padding&#8221;);</p>
<p>&#13;</p>
<p>                                    cipher.init(Cipher.ENCRYPT_MODE, key);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    int textBytesChunkLen = 100;</p>
<p>&#13;</p>
<p>                                    int encryptedChunkNum = (textBytes.length &#8211; 1) / textBytesChunkLen</p>
<p>&#13;</p>
<p>                                    + 1;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    // RSA returns 128 bytes as output for 100 text bytes</p>
<p>&#13;</p>
<p>                                    int encryptedBytesChunkLen = 128;</p>
<p>&#13;</p>
<p>                                    int encryptedBytesLen = encryptedChunkNum * encryptedBytesChunkLen;</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;Encrypted bytes length&#8212;&#8212;-&#8221;</p>
<p>&#13;</p>
<p>                                                            + encryptedBytesChunkLen);</p>
<p>&#13;</p>
<p>                                    // Define the Output array.</p>
<p>&#13;</p>
<p>                                    byte[] encryptedBytes = new byte[encryptedBytesLen];</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    int textBytesChunkIndex = 0;</p>
<p>&#13;</p>
<p>                                    int encryptedBytesChunkIndex = 0;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    for (int i = 0; i &#13;
</p>
<p>                                                if (i &#13;
</p>
<p>                                                            encryptedBytesChunkIndex = encryptedBytesChunkIndex</p>
<p>&#13;</p>
<p>                                                            + cipher.doFinal(textBytes, textBytesChunkIndex,</p>
<p>&#13;</p>
<p>                                                                                    textBytesChunkLen, encryptedBytes,</p>
<p>&#13;</p>
<p>                                                                                    encryptedBytesChunkIndex);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                                            textBytesChunkIndex = textBytesChunkIndex</p>
<p>&#13;</p>
<p>                                                            + textBytesChunkLen;</p>
<p>&#13;</p>
<p>                                                } else {</p>
<p>&#13;</p>
<p>                                                            cipher.doFinal(textBytes, textBytesChunkIndex,</p>
<p>&#13;</p>
<p>                                                                                    textBytes.length &#8211; textBytesChunkIndex,</p>
<p>&#13;</p>
<p>                                                                                    encryptedBytes, encryptedBytesChunkIndex);</p>
<p>&#13;</p>
<p>                                                }</p>
<p>&#13;</p>
<p>                                    }</p>
<p>&#13;</p>
<p>                                    encryptedText = new BASE64Encoder().encode(encryptedBytes);</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    throw e;</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return encryptedText;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to decrypt the contents.</p>
<p>&#13;</p>
<p>             * This method is useful when the size of the</p>
<p>&#13;</p>
<p>             * bytes is more than 117.</p>
<p>&#13;</p>
<p>             * @param text of type String indicating the</p>
<p>&#13;</p>
<p>             * encrypted contents.</p>
<p>&#13;</p>
<p>             * @param key of type {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @return decrypted value as a String</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public String getDecryptedValue(String text, PrivateKey key) {</p>
<p>&#13;</p>
<p>                        String result = null;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    byte[] encryptedBytes = new BASE64Decoder().decodeBuffer(text);</p>
<p>&#13;</p>
<p>                                    Cipher cipher = Cipher.getInstance(&#8220;RSA/ECB/PKCS1Padding&#8221;);</p>
<p>&#13;</p>
<p>                                    cipher.init(Cipher.DECRYPT_MODE, key);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    int encryptedByteChunkLen = 128;</p>
<p>&#13;</p>
<p>                                    int encryptedChunkNum = encryptedBytes.length</p>
<p>&#13;</p>
<p>                                    / encryptedByteChunkLen;</p>
<p>&#13;</p>
<p>                                    int decryptedByteLen = encryptedChunkNum * encryptedByteChunkLen;</p>
<p>&#13;</p>
<p>                                    byte[] decryptedBytes = new byte[decryptedByteLen];</p>
<p>&#13;</p>
<p>                                    int decryptedIndex = 0;</p>
<p>&#13;</p>
<p>                                    int encryptedIndex = 0;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    for (int i = 0; i &#13;
</p>
<p>                                                if (i &#13;
</p>
<p>                                                            decryptedIndex = decryptedIndex</p>
<p>&#13;</p>
<p>                                                            + cipher.doFinal(encryptedBytes, encryptedIndex,</p>
<p>&#13;</p>
<p>                                                                                    encryptedByteChunkLen, decryptedBytes,</p>
<p>&#13;</p>
<p>                                                                                    decryptedIndex);</p>
<p>&#13;</p>
<p>                                                            encryptedIndex = encryptedIndex + encryptedByteChunkLen;</p>
<p>&#13;</p>
<p>                                                } else {</p>
<p>&#13;</p>
<p>                                                            decryptedIndex = decryptedIndex</p>
<p>&#13;</p>
<p>                                                            + cipher.doFinal(encryptedBytes, encryptedIndex,</p>
<p>&#13;</p>
<p>                                                                                    encryptedBytes.length &#8211; encryptedIndex,</p>
<p>&#13;</p>
<p>                                                                                    decryptedBytes, decryptedIndex);</p>
<p>&#13;</p>
<p>                                                }</p>
<p>&#13;</p>
<p>                                    }</p>
<p>&#13;</p>
<p>                                    result = new String(decryptedBytes).trim();</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return result;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used obtain the</p>
<p>&#13;</p>
<p>             * {@link PublicKey}</p>
<p>&#13;</p>
<p>             * @return {@link PublicKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PublicKey getPublicKey() {</p>
<p>&#13;</p>
<p>                        return keyPair.getPublic();</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain</p>
<p>&#13;</p>
<p>             * the {@link PrivateKey}</p>
<p>&#13;</p>
<p>             * @return {@link PrivateKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public PrivateKey getPrivateKey() {</p>
<p>&#13;</p>
<p>                        return keyPair.getPrivate();</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The above class provides several useful methods for generation of Private key , Public Key and encryption of String and decryption of String.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Please refer to the following subordinate classes for the above class.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Class name : KeyGenerator.java</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>package com.dds.core.security;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.io.File;</p>
<p>&#13;</p>
<p>import java.io.FileOutputStream;</p>
<p>&#13;</p>
<p>import java.io.OutputStream;</p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p>import java.util.Properties;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This class is used to generate the</p>
<p>&#13;</p>
<p> * Private and Public key and stores</p>
<p>&#13;</p>
<p> * them in files.</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class KeyGenerator {</p>
<p>&#13;</p>
<p>            /**This method is used to obtain the</p>
<p>&#13;</p>
<p>             * path of the keys directory where</p>
<p>&#13;</p>
<p>             * Private and Public key files are</p>
<p>&#13;</p>
<p>             * stored.</p>
<p>&#13;</p>
<p>             * @return path of the keys directory</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            private static String getKeyFilePath() {</p>
<p>&#13;</p>
<p>                        String keyDirPath = null;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    keyDirPath = System.getProperty(&#8220;user.dir&#8221;) + File.separator</p>
<p>&#13;</p>
<p>                                    + &#8220;keys&#8221;;</p>
<p>&#13;</p>
<p>                                    File keyDir = new File(keyDirPath);</p>
<p>&#13;</p>
<p>                                    if (!keyDir.exists())</p>
<p>&#13;</p>
<p>                                                keyDir.mkdirs();</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return keyDirPath;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**</p>
<p>&#13;</p>
<p>             * This method is used to generate the</p>
<p>&#13;</p>
<p>             * Private and Public keys.</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public static void generateKeys() {</p>
<p>&#13;</p>
<p>                        Properties publicProp = new Properties();</p>
<p>&#13;</p>
<p>                        Properties privateProp = new Properties();</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    OutputStream pubOut = new FileOutputStream(getKeyFilePath()</p>
<p>&#13;</p>
<p>                                                            + File.separator + &#8220;public.key&#8221;);</p>
<p>&#13;</p>
<p>                                    OutputStream priOut = new FileOutputStream(getKeyFilePath()</p>
<p>&#13;</p>
<p>                                                            + File.separator + &#8220;private.key&#8221;);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    SecurityUtil secureUtil = new SecurityUtil();</p>
<p>&#13;</p>
<p>                                    secureUtil.invokeKeys();</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    PublicKey publicKey = secureUtil.getPublicKey();</p>
<p>&#13;</p>
<p>                                    PrivateKey privateKey = secureUtil.getPrivateKey();</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    String publicString = secureUtil.getPublicKeyString(publicKey);</p>
<p>&#13;</p>
<p>                                    String privateString = secureUtil.getPrivateKeyString(privateKey);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    publicProp.put(&#8220;key&#8221;, publicString);</p>
<p>&#13;</p>
<p>                                    publicProp.store(pubOut, &#8220;Public Key Info&#8221;);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    privateProp.put(&#8220;key&#8221;, privateString);</p>
<p>&#13;</p>
<p>                                    privateProp.store(priOut, &#8220;Private Key Info&#8221;);</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>The above class is used to generate the Public and Private keys. It generates and stores them in different files called Public.key and Private.key. Please refer the test harness class for the above class.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Class name: TestKeyGenerator</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p><strong>import</strong> com.dds.core.security.KeyGenerator;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This is a testharness class</p>
<p>&#13;</p>
<p> * for the KeyGenerator class.</p>
<p>&#13;</p>
<p> * <strong>@author</strong> Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p><strong>public</strong> <strong>class</strong> TestKeyGenerator {</p>
<p>&#13;</p>
<p>      <strong>public</strong> <strong>static</strong> <strong>void</strong> main(String[] args) {</p>
<p>&#13;</p>
<p>            KeyGenerator.generateKeys();</p>
<p>&#13;</p>
<p>      }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>}</p>
<p>&#13;</p>
<p>If you run the above class, you will find a directory called keys in your root path of your application folder. In this folder you will find two files one is for Private Key information and another is for Public Key.</p>
<p>&#13;</p>
<p>There is another class which is used to obtain the Private key and Public key information stored in the files.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Class name: KeyReader.java</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>package com.dds.core.security;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.io.File;</p>
<p>&#13;</p>
<p>import java.io.FileInputStream;</p>
<p>&#13;</p>
<p>import java.io.InputStream;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p>import java.util.Properties;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**This class is used to read the</p>
<p>&#13;</p>
<p> * keys from the file.</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class KeyReader {</p>
<p>&#13;</p>
<p>            /**This method is used to obtain the</p>
<p>&#13;</p>
<p>             * string value of the Public Key</p>
<p>&#13;</p>
<p>             * from the file.</p>
<p>&#13;</p>
<p>             * @return String of {@link PublicKey}</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public static String getPublicKeyString() {</p>
<p>&#13;</p>
<p>                        String publicString = null;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    Properties prop = new Properties();</p>
<p>&#13;</p>
<p>                                    String publicKeyPath = System.getProperty(&#8220;user.dir&#8221;)</p>
<p>&#13;</p>
<p>                                    + File.separator + &#8220;keys&#8221; + File.separator + &#8220;public.key&#8221;;</p>
<p>&#13;</p>
<p>                                    InputStream in = new FileInputStream(publicKeyPath);</p>
<p>&#13;</p>
<p>                                    prop.load(in);</p>
<p>&#13;</p>
<p>                                    publicString = prop.getProperty(&#8220;key&#8221;);</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return publicString;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            /**This method is used to obtain the</p>
<p>&#13;</p>
<p>             * String of Private Key from the file.</p>
<p>&#13;</p>
<p>             * @return String of private key</p>
<p>&#13;</p>
<p>             */</p>
<p>&#13;</p>
<p>            public static String getPrivateKeyString() {</p>
<p>&#13;</p>
<p>                        String publicString = null;</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    Properties prop = new Properties();</p>
<p>&#13;</p>
<p>                                    String publicKeyPath = System.getProperty(&#8220;user.dir&#8221;)</p>
<p>&#13;</p>
<p>                                    + File.separator + &#8220;keys&#8221; + File.separator + &#8220;private.key&#8221;;</p>
<p>&#13;</p>
<p>                                    InputStream in = new FileInputStream(publicKeyPath);</p>
<p>&#13;</p>
<p>                                    prop.load(in);</p>
<p>&#13;</p>
<p>                                    publicString = prop.getProperty(&#8220;key&#8221;);</p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>                        return publicString;</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p>}</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>This is a utility class to read the Public and Private keys from the files.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Now refer to the test harness class which makes encryption and decryption of String.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import java.security.PrivateKey;</p>
<p>&#13;</p>
<p>import java.security.PublicKey;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>import com.dds.core.security.KeyReader;</p>
<p>&#13;</p>
<p>import com.dds.core.security.SecurityUtil;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>/**</p>
<p>&#13;</p>
<p> * This is a test harness class for encryption and decryption.</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> * @author Debadatta Mishra(PIKU)</p>
<p>&#13;</p>
<p> *</p>
<p>&#13;</p>
<p> */</p>
<p>&#13;</p>
<p>public class TestEncryption {</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>            public static void main(String[] args) {</p>
<p>&#13;</p>
<p>                        String privateKeyString = KeyReader.getPrivateKeyString();</p>
<p>&#13;</p>
<p>                        SecurityUtil securityUtil = new SecurityUtil();</p>
<p>&#13;</p>
<p>                        String publicKeyString = KeyReader.getPublicKeyString();</p>
<p>&#13;</p>
<p>                        try {</p>
<p>&#13;</p>
<p>                                    PublicKey publicKey = securityUtil</p>
<p>&#13;</p>
<p>                                    .getPublicKeyFromString(publicKeyString);</p>
<p>&#13;</p>
<p>                                    PrivateKey privateKey = securityUtil</p>
<p>&#13;</p>
<p>                                    .getPrivateKeyFromString(privateKeyString);</p>
<p>&#13;</p>
<p>                                    String originalValue = &#8220;provide some very long string&#8221;;</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                                    String encryptedValue = securityUtil.getEncryptedValue(</p>
<p>&#13;</p>
<p>                                                            originalValue, publicKey);</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;EncryptedValue&#8212;&#8211;&#8221; + encryptedValue);</p>
<p>&#13;</p>
<p>                                    String decryptedValue = securityUtil.getDecryptedValue(</p>
<p>&#13;</p>
<p>                                                            encryptedValue, privateKey);</p>
<p>&#13;</p>
<p>                                    System.out.println(&#8220;Original Value&#8212;&#8212;&#8221; + decryptedValue);</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>                        } catch (Exception e) {</p>
<p>&#13;</p>
<p>                                    e.printStackTrace();</p>
<p>&#13;</p>
<p>                        }</p>
<p>&#13;</p>
<p>            }</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>}</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>This test harness class is used to encrypt and decrypt the long string contents. You can also use the same method for file encryption and decryption. First you have to read the contents of a file as String and then you can apply method to encrypt it.</p>
<p>&#13;</p>
<p> </p>
<p>&#13;</p>
<p>Conclusion</p>
<p>&#13;</p>
<p>I hope that you will enjoy my article for this asymmetric cryptography for RSA. For asymmetric cryptography please refer to the link http://www.articlesbase.com/information-technology-articles/asymmetric-cryptography-in-java-438155.html. If you find any problems or errors, please feel free to send me a mail in the address debadattamishra@aol.com . This article is only meant for those who are new to java development. This article does not bear any commercial significance. Please provide me the feedback about this article</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/encryption-using-rsa-algorithm-in-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use of Hibernate With Java Persistence Api</title>
		<link>http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api-2</link>
		<comments>http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api-2#comments</comments>
		<pubDate>Sat, 21 Aug 2010 13:31:29 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Persistence]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api-2</guid>
		<description><![CDATA[Use of Hibernate With Java Persistence Api Before we start any discussion about Persistence technologies, we need to understand what exactly Persistence is in computer science. Persistence, in simple terms is the ability to retain data structures between various program executions. A perfect example of this would be a word processor saving undo history. In [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Use of Hibernate With Java Persistence Api</strong></p>
<p>Before we start any discussion about Persistence technologies, we need to understand what exactly Persistence is in computer science. Persistence, in simple terms is the ability to retain data structures between various program executions. A perfect example of this  would be a word processor saving undo history. In practice, this is achieved by storing the data in non- volatile storage such as a   file system or a relational database or an object database.</p>
<p>&#13;</p>
<p>The popularity of databases has increased manifold in the past few years. Java has become the preferred choice of developers for developing secure, flexible, and scalable database driven web applications. These web applications require objects to be associated with appropriate databases. Hibernate, along with other persistence technologies associate’s objects with the appropriate database in a simple, straight forward and natural way.</p>
<p>&#13;</p>
<p>Hibernate is one such effort from the Java community to develop many object oriented solutions to data persistence. Any kind of Java persistence  solution includes two main elements i.e. ORM (Object Relational Mapping) and OOM (Object Oriented Modeling).</p>
<p>&#13;</p>
<p>Hibernate has become immensely popular  amongst the developer community as it is a free, powerful, high performance open source object &#8211; relational mapping persistence Java package that makes it easier to work with relational databases for Java Applications.</p>
<p>&#13;</p>
<p>Apart from Hibernate, other popular open source Java persistence technologies include JDBC, abates, JDO, Top Link and CMP Entity Beans. These technologies  provide a standardized object-relational mapping mechanism.</p>
<p>&#13;</p>
<p>Java persistence application programming Interface or JAVA Persistence API is the latest version of the Java Data Objects (JDO) technology which was the earlier persistent technology used by developers. JPA or the Java Persistence API is the latest Java Specification standard for java enterprise applications. The Java Persistence API is a java programming language framework that allows developers to manage relational data in Java standard edition and Enterprise Edition applications. Java Persistence API originated as part of the work of the JSR 220 expert group.</p>
<p>&#13;</p>
<p>The java persistence API’s has been developed after drawing upon the best ideas from other prevalent persistence technologies like Top link, JDO, Hibernate etc. In simple words, Java Persistence API is a Plain Old Java Object API for object /relational mapping and supports a rich, SQL –like query language for both static and dynamic queries.</p>
<p>&#13;</p>
<p>Vendors involved in application development have found that the use of Hibernate technology with Java persistence API’s helps build flexible, database driven web applications that are highly scalable and involve complex business processes.</p>
<p>&#13;</p>
<p>The Java Persistence API is the standard object/relational mapping and persistence management interface of the Java EE 5.0 platform and Java Web Services Development . As part of the EJB 3.0 specification effort, it is supported by all major vendors of the Java industry for improving Java Web Development in India and Globe.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/use-of-hibernate-with-java-persistence-api-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hot Or Not? Developing Applications With Java Programming</title>
		<link>http://utropicmedia.net/blog/hot-or-not-developing-applications-with-java-programming-3</link>
		<comments>http://utropicmedia.net/blog/hot-or-not-developing-applications-with-java-programming-3#comments</comments>
		<pubDate>Wed, 18 Aug 2010 20:17:33 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[developing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/hot-or-not-developing-applications-with-java-programming-3</guid>
		<description><![CDATA[Hot Or Not? Developing Applications With Java Programming Java is a general purpose programming language similar to C++ and was developed by Sun Microsystems to take advantage of the flourishing World Wide Web. Java programming language is well designed to develop effective web based applications and offers many advantages over other languages like C++. Technically, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Hot Or Not? Developing Applications With Java Programming</strong></p>
<p>Java is a general purpose programming language similar to C++ and was developed by Sun Microsystems to take advantage of the flourishing World Wide Web. Java programming language is well designed to develop effective web based applications and offers many advantages over other languages like C++. Technically, Java source code files (.java files) are compiled into bytecode (.class files). This complied java code is then executed by a Java interpreter. Since Java interpreters and Runtime environments called Java Virtual Machines exist for most operating systems (Windows OS, UNIX and Macintosh), you can run java based applications on almost every computer! </p>
<p>&#13;<br />
Portability</p>
<p>&#13;<br />
As explained Java is platform independent language which means you can write your application on one computer and can run that application on all computers. Java support is built into all major OS and popular web browsers, making it available on virtually every Internet-connected computer worldwide. Even electronic devices like mobile phones, set-top boxes and PDAs nowadays come with inbuilt Java applications. </p>
<p>&#13;<br />
Efficient Programming and Timeliness</p>
<p>&#13;<br />
Java is designed to remove common programming errors and comes with excellent set of APIs making it easier for programmers to write bug free code than in other languages. This in turn reduces development time and cost of any application.</p>
<p>&#13;<br />
Dynamic Characteristic of Programs</p>
<p>&#13;<br />
Java is object oriented language and the source code is organized in small units called classes. Programs written with Java code automatically call and load these classes whenever it is required to run the application. This means applications written in Java can dynamically expand their functionality by loading these classes anytime from the Java interpreter.</p>
<p>&#13;<br />
Security</p>
<p>&#13;<br />
Fortunately, Java programming and platform community is prompt enough in fixing security related bugs. Any new security bug on Java platform immediately catches eye of media because of the promises given by Java community for security! </p>
<p>&#13;<br />
Like any other programming language, Java is not spared of snags and hitches. Java is an interpreted language and hence programs written in Java language runs comparatively slow. But with availability of faster processors at competitive prices, this barrier should be only a temporary one.</p>
<p>&#13;<br />
In India, there are many Java web development companies having experienced team of Java programmers to develop quality Java applications with best feasible solutions. They are capable of developing highly interactive web solutions for your business with effective project management support. If you want expert programmers to create competitive Java web applications at affordable rates then India is the best destination. You just need to find right offshore development partner that best suit your business needs and budget. Outsourcing your Java web development projects can save you significant amount of time and money.</p>
<div></div>
<p>Related <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/hot-or-not-developing-applications-with-java-programming-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improve your programming knowledge through Java Training courses</title>
		<link>http://utropicmedia.net/blog/improve-your-programming-knowledge-through-java-training-courses</link>
		<comments>http://utropicmedia.net/blog/improve-your-programming-knowledge-through-java-training-courses#comments</comments>
		<pubDate>Mon, 16 Aug 2010 18:33:55 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[courses]]></category>
		<category><![CDATA[Improve]]></category>
		<category><![CDATA[Knowledge]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Through]]></category>
		<category><![CDATA[Training]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/improve-your-programming-knowledge-through-java-training-courses</guid>
		<description><![CDATA[Improve your programming knowledge through Java Training courses Java Training Importance of java Java is an object-oriented programming language developed by Sun Microsoft.It is one of the development programming language. Java was chosen as the programming language for network computers. It can be trianed by good Java Training center.Java has distributed, secure, architecture, robust, multi [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Improve your programming knowledge through Java Training courses</strong></p>
<p><strong><br /></strong></p>
<p><strong>Java Training</strong></p>
<p>Importance of java</p>
<p>Java is an object-oriented programming language developed by Sun Microsoft.It is one of the development programming language. Java was chosen as the programming language for network computers. It can be trianed by good <strong><a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.fresherlab.com/">Java Training</a></strong> center.Java has distributed, secure, architecture, robust, multi threaded and dynamic language. The program can be written once, and run anywhere&#8221;. One of the most significant advantages of Java is that, it has the ability to move easily from one computer to another. It also has the ability to run the same program on many different operating systems.</p>
<p><strong><a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.fresherlab.com/">Java Training</a> </strong>applications are designed to be compiled and then interpreted at runtime, unlike the conventional programming languages, which can either compile source code to native code or interpret the source code. The language itself has borrowed the syntax from C and C++. Java considers security as a part of its design. The Java language, its compiler, interpreter, and runtime environment are all developed with security. Writing network programs in Java is similar to sending and receiving data to and from a file.</p>
<p>The <strong>Java Training </strong>programming language was developed and re-designed for use on the Internet. In the internet domain, Java&#8217;s popularity has increased tremendously, especially on the server side of the Internet. Nowadays, there are a large number of Java experts who strive for the enhancement and improvement of Java development. For beginners who are interested in learning Java, the numerous Java tutorials or <strong>Java Training </strong>available online are good to start with. Java tutorials or <strong>Java Training </strong>and Java tips are the best resources for learning and improvising in Java.</p>
<p><strong>Java Training </strong>Development experts are trying to enhance their programming skills for writing secure Java applications. In order to write a secure code in Java you need to be aware of various things such as data handling techniques, user authentication rules, access controls etc. JavaScript is a scripting language which shares a similar name and has the same syntax, but is in no way related to the core Java language..</p>
<p><strong>Java Training</strong></p>
<p>Improve your programming knowledge through <strong>Java Training</strong> courses</p>
<p><strong>Java Training</strong></p>
<p>Java is an object-oriented programming language developed by Sun Microsoft.It is one of the development programming language. Java was chosen as the programming language for network computers. It can be trianed by good <strong>Java Training</strong> center.Java has distributed, secure, architecture, robust, multi threaded and dynamic language.The <strong>Java Training </strong>programming language was developed and re-designed for use on the Internet. In the internet domain, Java&#8217;s popularity has increased tremendously, especially on the server side of the Internet. Nowadays, there are a large number of Java experts who strive for the enhancement and improvement of Java development. For beginners who are interested in learning Java, the numerous</p>
<p><a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.fresherlab.com/"><strong>Fresherlab.com</strong></a> is a young organization, based at India&#8217;s IT hub, Bangalore. <br /> It&#8217;s a dynamic and competitive world with full of ups and downs in IT sector and therefore; the fresh engineers require just more than theoretical knowledge to get themselves ready for the industry. Academic institutions across the world provide the basic and conceptual fundamentals covering multiple areas in computer science. With increasing number of graduating engineers, but with constant number of companies, it becomes difficult for fresh engineers to compete with their unpolished skills because they need more effective and specialized quality training.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/improve-your-programming-knowledge-through-java-training-courses/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java 2 Platform Enterprise Edition (j2ee) Three-tier Model</title>
		<link>http://utropicmedia.net/blog/java-2-platform-enterprise-edition-j2ee-three-tier-model</link>
		<comments>http://utropicmedia.net/blog/java-2-platform-enterprise-edition-j2ee-three-tier-model#comments</comments>
		<pubDate>Fri, 13 Aug 2010 06:31:40 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Edition]]></category>
		<category><![CDATA[Enterprise]]></category>
		<category><![CDATA[j2ee]]></category>
		<category><![CDATA[Model]]></category>
		<category><![CDATA[Platform]]></category>
		<category><![CDATA[Threetier]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/java-2-platform-enterprise-edition-j2ee-three-tier-model</guid>
		<description><![CDATA[Java 2 Platform Enterprise Edition (j2ee) Three-tier Model Enterprise edition of J2EE is used for developing modular enterprise request. It can be easily used on J2EE are distributed over 3 different locations, namely, J2EE server &#38; database server, client machine, and at legacy system. The main advantages of using J2EE platform are: * High Performance [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Java 2 Platform Enterprise Edition (j2ee) Three-tier Model</strong></p>
<p>
<p>Enterprise edition of J2EE is used for developing modular enterprise request. It can be easily used on J2EE are distributed over 3 different locations, namely, J2EE server &amp; database server, client machine, and at legacy system. The main advantages of using J2EE platform are:</p>
<p>* High Performance</p>
<p>* Lightweight Constant objects</p>
<p>* High amount of flexibility in operation platform and configuration</p>
<p><strong>* </strong>Extensibility and maintainability</p>
<p>* Interoperability</p>
<p><strong>* </strong>Focus on implementing business logic</p>
<p>* It should be easy to add and maintain new functionality.</p>
<p>Application logic used in Java 2 Platform Enterprise Edition us divided into different components depending on the function. They are differently installed on various machines totally depending on application it belongs to. For instance in Client machine, J2 EE server is divided into 2 main categories: Web Based Clients &amp; application clients. Web based clients executes on a standard web browser. They do not typically execute intricate business rules, and database query. Usually heavy weights are offloaded to Enterprise java beans that help in controlling security, reliability and speed of J2EE server side technology. Whereas application clients run on Java Virtual machines that help in handling the richer user interface conveniently. Further they have the facility to access EJB on business tier as well. Similarly for other tier locations, there are assorted components.</p>
<p>If you like to take the advantages of J2EE Three-Tier Model then contact a software development company now. They will give you the necessary information (including both advantages and disadvantages of this technology).</p>
<p>
<p>&lt;a rel=&#8221;nofollow&#8221; onclick=&#8221;javascript:pageTracker._trackPageview(&#8216;/outgoing/article_exit_link&#8217;);&#8221; href=&#8221;”http://www.icreonglobal.com/java-development.shtml”&#8221;&gt; Java Web Services India&lt;/a&gt;</p>
<p>&lt;a rel=&#8221;nofollow&#8221; onclick=&#8221;javascript:pageTracker._trackPageview(&#8216;/outgoing/article_exit_link&#8217;);&#8221; href=&#8221;”http://www.icreonglobal.com/java-development.shtml”&#8221;&gt; 2 Platform Enterprise Edition&lt;/a&gt;</p>
<p> </p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/java-2-platform-enterprise-edition-j2ee-three-tier-model/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All about &#8220;JAVA&#8221;</title>
		<link>http://utropicmedia.net/blog/all-about-java</link>
		<comments>http://utropicmedia.net/blog/all-about-java#comments</comments>
		<pubDate>Fri, 06 Aug 2010 06:31:00 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[About]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/all-about-java</guid>
		<description><![CDATA[All about &#8220;JAVA&#8221; Java is basically a programming language,which was originally developed by James Gosling (best known as the father of the Java programming language) at Sun microsystems which is now a subsidiary of Oracle Corporation. It was first released by Sun in 1995. In short, it is the underlying technology that powers state-of-the-art programs including utilities, games, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>All about &#8220;JAVA&#8221;</strong></p>
<p>Java is basically a programming language,which was originally developed by James Gosling (best known as the father of the Java programming language) at Sun microsystems which is now a subsidiary of Oracle Corporation. It was first released by Sun in 1995. In short, it is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.</p>
<p><strong>Why do people need JAVA? </strong></p>
<p>There are lots of applications and websites that won&#8217;t work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!</p>
<p><strong>Characteristics of JAVA</strong></p>
<p>The programs you create are portable in a network<br />
The code is robust, here meaning that, unlike programs written in C++ and perhaps some other languages, the Java objects can contain no references to data external to themselves or other known objects.<br />
Java is object-oriented, which means that, among other characteristics, an object can take advantage of being part of a class of objects and inherit code that is common to the class.<br />
In addition to being executed at the client rather than the server, a Java applet has other characteristics designed to make it run fast.<br />
Relative to C++, Java is easier to learn. (However, it is not a language you&#8217;ll pick up in an evening!)</p>
<p><strong>Difference between JAVA and JAVASCRIPT</strong></p>
<p>JavaScript should not be confused with Java. JavaScript, which originated at Netscape, is interpreted at a higher level and is easier to learn than Java, but lacks some of the portability of Java and the speed of bytecode. Because Java applets will run on almost any operating system without requiring recompilation and because Java has no operating system-unique extensions or variations, Java is generally regarded as the most strategic language in which to develop applications for the Web. (However, JavaScript can be useful for very small applications that run on the Web client or server.)<strong></p>
<p></strong></p>
<p><strong>Editions</strong></p>
<p>Sun has defined and supports four editions of Java targeting different application environments and segmented many of its APIs so that they belong to one of the platforms. The platforms are:</p>
<p>Java Card for smartcards.<br />
Java Platform, Micro Edition (Java ME) — targeting environments with limited resources.<br />
Java Platform, Standard Edition (Java SE) — targeting workstation environments.<br />
Java Platform, Enterprise Edition (Java EE) — targeting large distributed enterprise or Internet environments.</p>
<p><strong>Download</strong></p>
<p>Java is free to download. You can get the latest version at <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.java.com/">http://java.com</a>.</p>
<p>If you are building an embedded or consumer device and would like to include Java, please contact Oracle for more information on <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.oracle.com/corporate/contact/global.html">including Java in your device</a>.</p>
<p><strong>Why must you stay updated?</strong></p>
<p>The latest Java version contains important enhancements to improve performance, stability and security of the Java applications that run on your machine. Installing this free update will ensure that your Java applications continue to run safely and efficiently.</p>
<p><strong>Overall JAVA is a must for internet users to ensure a rich and wonderful experience on the web !</strong></p>
<p><strong><br /></strong></p>
<p> </p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/all-about-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Java Virtual Machine</title>
		<link>http://utropicmedia.net/blog/the-java-virtual-machine</link>
		<comments>http://utropicmedia.net/blog/the-java-virtual-machine#comments</comments>
		<pubDate>Thu, 05 Aug 2010 09:30:24 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Machine]]></category>
		<category><![CDATA[Virtual]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/the-java-virtual-machine</guid>
		<description><![CDATA[The Java Virtual Machine The Java Virtual Machine The Java virtual machine is called &#8220;virtual&#8221; because it is an abstract computer defined by a specification. To run a Java program,you need a concrete implementation of the abstract specification. This chapter describes primarily the abstract specification of the Java virtual machine.To illustrate the abstract definition of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Java Virtual Machine</strong></p>
<p><strong>The Java Virtual Machine</strong></p>
<p>The Java virtual machine is called &#8220;virtual&#8221; because it is an abstract computer defined by a specification. To run a Java program,<br />you need a concrete implementation of the abstract specification. This chapter describes primarily the abstract specification of the Java virtual machine.<br />To illustrate the abstract definition of certain features, however, this chapter also discusses various ways in which those features could be implemented.</p>
<p><strong>What &#8216;s the Java Virtual Machine?</strong></p>
<p>To understand the Java virtual machine you must first be aware that you may be talking about any of three different things <br />when you say &#8220;Java virtual machine.&#8221; You may be speaking of the abstract specification, a concrete implementation, or a runtime instance. </p>
<p>The abstract specification is a concept, described in detail in the book: The Java Virtual Machine Specification, by Tim Lindholm and Frank Yellin.<br />Concrete implementations, which exist on many platforms and come from many vendors, are either all software or a combination of hardware and software.<br />A runtime instance hosts a single running Java application.<br />Each Java application runs inside a runtime instance of some concrete implementation of the abstract specification of the Java virtual machine. <br />In this book, the term &#8220;Java virtual machine&#8221; is used in all three of these senses. Where the intended sense is not clear from the context,<br />one of the terms &#8220;specification,&#8221; &#8220;implementation,&#8221; or &#8220;instance&#8221; is added to the term &#8220;Java virtual machine&#8221;. </p>
<p><strong>The lifetime of a Java Virtual Machine</strong></p>
<p>A runtime instance of the Java virtual machine has a clear mission in life: to run one Java application. <br />When a Java application starts, a runtime instance is born. When the application completes, the instance dies. <br />If you start three Java applications at the same time, on the same computer, using the same concrete implementation,<br />you&#8217;ll get three Java virtual machine instances. Each Java application runs inside its own Java virtual machine.<br />A Java virtual machine instance starts running its solitary application by invoking the method of some initial class.<br />The method must be public, static, return , and accept one parameter. <br />Any class with such a method can be used as the starting point for a Java application.</p>
<p>For example, consider an application that prints out its command line arguments:</p>
<p>// On CD-ROM in file jvm/ex1/Echo.javaclass Echo <br />{ public static void main(String[] args) <br /> { <br /> int len = args.length; <br /> for (int i = 0; i  { <br /> System.out.print(args[i] + &#8221; &#8220;);<br /> }<br /> System.out.println();<br /> }<br />}</p>
<p>You must in some implementation-dependent way give a Java virtual machine the name of the initial class that has the method that<br />will start the entire application. One real world example of a Java virtual machine implementation is the program from Sun&#8217;s Java 2 SDK.<br />If you wanted to run the application using Sun&#8217;s on Window98, for example, you would type in a command such as:<br />java Echo Greetings, Planet.</p>
<p>The first word in the command, indicates that the Java virtual machine from Sun&#8217;s Java 2 SDK should be run by the operating system.<br />The second word, is the name of the initial class.must have a public static method named that returns and takes a array as its only parameter. <br />The subsequent words, are the command line arguments for the application. <br />These are passed to the method in the array in the order in which they appear on the command line. <br />So, for the previous example, the contents of the array passed to main,<br />The method of an application&#8217;s initial class serves as the starting point for that application&#8217;s initial thread.<br />The initial thread can in turn fire off other threads.<br />Inside the Java virtual machine, threads come in two flavors: daemon and non- daemon.<br />A daemon thread is ordinarily a thread used by the virtual machine itself, such as a thread that performs garbage collection. <br />The application, however, can mark any threads it creates as daemon threads. <br />The initial thread of an application&#8211;the one that begins at &#8211;is a non- daemon thread.<br />A Java application continues to execute (the virtual machine instance continues to live) as long as any non-daemon threads are still running.<br />When all non-daemon threads of a Java application terminate, the virtual machine instance will exit. <br />If permitted by the security manager, the application can also cause its own demise by invoking the method of class or .<br />In the application previous, the method doesn&#8217;t invoke any other threads. After it prints out the command line arguments, returns. <br />This terminates the application&#8217;s only non-daemon thread, which causes the virtual machine instance to exit.</p>
<p><strong>The Architecture of the Java Virtual Machine</strong></p>
<p>In the Java virtual machine specification, the behavior of a virtual machine instance is described in terms of subsystems, memory areas, data types, <br />and instructions. These components describe an abstract inner architecture for the abstract Java virtual machine. <br />The purpose of these components is not so much to dictate an inner architecture for implementations.<br />It is more to provide a way to strictly define the external behavior of implementations. <br />The specification defines the required behavior of any Java virtual machine implementation in terms of these abstract components and their interactions.<br />When a Java virtual machine runs a program, it needs memory to store many things, including bytecodes and other information <br />it extracts from loaded class files, objects the program instantiates, parameters to methods, return values, local variables,<br />and intermediate results of computations. The Java virtual machine organizes the memory it needs to execute a program into several runtime data areas.<br />Although the same runtime data areas exist in some form in every Java virtual machine implementation, <br />their specification is quite abstract. Many decisions about the structural details of the runtime data areas are left to the<br />designers of individual implementations.<br />Different implementations of the virtual machine can have very different memory constraints. <br />Some implementations may have a lot of memory in which to work, others may have very little. <br />Some implementations may be able to take advantage of virtual memory, others may not. <br />The abstract nature of the specification of the runtime data areas helps make it easier to implement the Java virtual machine on a wide <br />variety of computers and devices.<br />Some runtime data areas are shared among all of an application&#8217;s threads and others are unique to individual threads.<br />Each instance of the Java virtual machine has one method area and one heap. These areas are shared by all threads running inside the virtual machine.<br />When the virtual machine loads a class file, it parses information about a type from the binary data contained in the class file.<br />It places this type information into the method area. As the program runs, the virtual machine places all objects the program instantiates onto the heap.<br />As each new thread comes into existence, it gets its own pc register (program counter) and Java stack. <br />If the thread is executing a Java method (not a native method), the value of the pc register indicates the next instruction to execute.<br />A thread&#8217;s Java stack stores the state of Java (not native) method invocations for the thread. <br />The state of a Java method invocation includes its local variables, the parameters with which it was invoked, <br />its return value (if any), and intermediate calculations. The state of native method invocations is stored in an implementation-dependent way<br />in native method stacks, as well as possibly in registers or other implementation-dependent memory areas.<br />The Java stack is composed of stack frames (or frames). A stack frame contains the state of one Java method invocation. When a thread invokes a method,<br />the Java virtual machine pushes a new frame onto that thread&#8217;s Java stack. When the method completes, the virtual machine pops and discards<br />the frame for that method.<br />The Java virtual machine has no registers to hold intermediate data values. The instruction set uses the Java stack for storage of intermediate data values. This approach was taken by Java&#8217;s designers to keep the Java virtual machine&#8217;s instruction set compact and to facilitate implementation on architectures with few or irregular general purpose registers. In addition, the stack-based architecture of the Java virtual machine&#8217;s instruction set facilitates the code optimization work done by just-in-time and dynamic compilers that operate at run-time in some virtual machine implementations.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/the-java-virtual-machine/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aghreni Technologies Educational Services &#8211; Trainings on Open Source Technologies ( Perl, Php, Java, Ruby, Linux, Mysql)</title>
		<link>http://utropicmedia.net/blog/aghreni-technologies-educational-services-trainings-on-open-source-technologies-perl-php-java-ruby-linux-mysql</link>
		<comments>http://utropicmedia.net/blog/aghreni-technologies-educational-services-trainings-on-open-source-technologies-perl-php-java-ruby-linux-mysql#comments</comments>
		<pubDate>Wed, 04 Aug 2010 12:29:14 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Aghreni]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Open]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Trainings]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/aghreni-technologies-educational-services-trainings-on-open-source-technologies-perl-php-java-ruby-linux-mysql</guid>
		<description><![CDATA[Aghreni Technologies Educational Services &#8211; Trainings on Open Source Technologies ( Perl, Php, Java, Ruby, Linux, Mysql)  Aghreni offers skill enhancement courses in  · PErL, PHP, Ruby &#38; java/J2ee · Unix/linux · Mysql · Web development · User interface design ·  Veritas · Usability engineering · Project management · Leadership · Software development techniques · Software testing techniques]]></description>
			<content:encoded><![CDATA[<p><strong>Aghreni Technologies Educational Services &#8211; Trainings on Open Source Technologies ( Perl, Php, Java, Ruby, Linux, Mysql)</strong></p>
<p> Aghreni offers skill enhancement courses in </p>
<p>
<p>· PErL, PHP, Ruby &amp; java/J2ee</p>
<p>
<p>· Unix/linux</p>
<p>
<p>· Mysql</p>
<p>
<p>· Web development</p>
<p>
<p>· User interface design</p>
<p>
<p>·  Veritas</p>
<p>
<p>· Usability engineering</p>
<p>
<p>· Project management</p>
<p>
<p>· Leadership</p>
<p>
<p>· Software development techniques</p>
<p>
<p>· Software testing techniques</p>
<p> </p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/aghreni-technologies-educational-services-trainings-on-open-source-technologies-perl-php-java-ruby-linux-mysql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing Ms Access Using Java</title>
		<link>http://utropicmedia.net/blog/accessing-ms-access-using-java</link>
		<comments>http://utropicmedia.net/blog/accessing-ms-access-using-java#comments</comments>
		<pubDate>Tue, 03 Aug 2010 15:29:44 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[accessing]]></category>
		<category><![CDATA[Using]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/accessing-ms-access-using-java</guid>
		<description><![CDATA[Accessing Ms Access Using Java Step by step guide: &#13; 1.Create a database in ms access and add a table &#13; 2.Add columns to the table.&#13; 3.Go to control panel-&#62;Administrative Tools&#13; -&#62;JDBC-&#62; System DSN &#13; 4.In System DSN tab click on add ,choose &#13; Microsoft access driver ,then you will get a &#13; dialog box [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Accessing Ms Access Using Java</strong></p>
<p>Step by step guide:</p>
<p>&#13;</p>
<p>1.Create a database in ms access and add a table <br />&#13;</p>
<p>2.Add columns to the table.<br />&#13;</p>
<p>3.Go to  control  panel-&gt;Administrative Tools<br />&#13;</p>
<p>  -&gt;JDBC-&gt; System DSN <br />&#13;</p>
<p>4.In System DSN tab click on add ,choose  <br />&#13;</p>
<p>  Microsoft access driver ,then you will get a <br />&#13;</p>
<p>  dialog box opened ODBC Microsoft access setup  <br />&#13;</p>
<p>  mention the data source name in it and in <br />&#13;</p>
<p>  databases click on select button and choose <br />&#13;</p>
<p>  your .mdb file that is created in step1.</p>
<p>&#13;</p>
<p>5.Register the driver using </p>
<p>&#13;</p>
<p>  Class.forName(&#8220;sun.jdbc.odbc.JdbcOdbcDriver&#8221;);</p>
<p>&#13;</p>
<p>6.Connect to the database </p>
<p>&#13;</p>
<p>Connection con = DriverManager.getConnection <br />&#13;</p>
<p>                 (URL,userid,password);<br />&#13;</p>
<p>url=” Jdbc:Odbc:”</p>
<p>&#13;</p>
<p>userid and password are empty in case of MS access.if it oracle default userid is “scott”  password is “tiger”.</p>
<p>&#13;</p>
<p>Ex: Connection  con = DriverManager.getConnection<br />&#13;</p>
<p>                      ( &#8220;Jdbc:Odbc:msac&#8221;, &#8220;&#8221;,&#8221;");</p>
<p><b>Source Code </b></p>
<p>&#13;</p>
<p>import java.sql.*;<br />&#13;</p>
<p>import java.io.*;</p>
<p>&#13;</p>
<p>class  JdbcDemo1<br />&#13;</p>
<p>{<br />&#13;</p>
<p>  Connection con;<br />&#13;</p>
<p>  Statement stmt;<br />&#13;</p>
<p>  ResultSet rs;<br />&#13;</p>
<p>  JdbcDemo1(){<br />&#13;</p>
<p>	   try{<br />&#13;</p>
<p>		Class.forName(&#8220;sun.jdbc.odbc.JdbcOdbcDriver&#8221;);<br />&#13;</p>
<p>		     con = DriverManager.getConnection( &#8220;Jdbc:Odbc:msac&#8221;, &#8220;&#8221;,&#8221;");<br />&#13;</p>
<p>			 stmt = con.createStatement();<br />&#13;</p>
<p>             rs = stmt.executeQuery(&#8220;SELECT * FROM Table1&#8243;);<br />&#13;</p>
<p>             while (rs.next()) {<br />&#13;</p>
<p>				 String x = rs.getString(&#8220;name&#8221;);<br />&#13;</p>
<p>				 int s = rs.getInt(&#8220;age&#8221;);<br />&#13;</p>
<p>				 System.out.println(&#8220;x:&#8221;+x+&#8221;s&#8221;+s);<br />&#13;</p>
<p>	         }<br />&#13;</p>
<p>    	  }catch(SQLException e){<br />&#13;</p>
<p>				System.out.println(&#8220;Hello World!&#8221;+e);<br />&#13;</p>
<p>		  }catch(ClassNotFoundException e){<br />&#13;</p>
<p>				System.out.println(&#8220;purni&#8221;+e);<br />&#13;</p>
<p>          }<br />&#13;</p>
<p>   }<br />&#13;</p>
<p>}</p>
<p>&#13;</p>
<p>class JdbcDemo<br />&#13;</p>
<p>{</p>
<p>&#13;</p>
<p>    public static void main(String args[]){</p>
<p>&#13;</p>
<p>	new JdbcDemo1();<br />&#13;</p>
<p>	}<br />&#13;</p>
<p>}</p>
<div></div>
<p>Related <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/accessing-ms-access-using-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Mobile Phone Games: Best of 2006!</title>
		<link>http://utropicmedia.net/blog/java-mobile-phone-games-best-of-2006</link>
		<comments>http://utropicmedia.net/blog/java-mobile-phone-games-best-of-2006#comments</comments>
		<pubDate>Mon, 02 Aug 2010 18:29:18 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[2006]]></category>
		<category><![CDATA[Best]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Phone]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/java-mobile-phone-games-best-of-2006</guid>
		<description><![CDATA[Java Mobile Phone Games: Best of 2006! The year 2006 was an amazing year for mobile gaming fanatics as the gaming industry came up with few amazing games that had a heady mix of action-adventures to puzzlers to racers to just about everything! These latest mobile phone games developed by companies like Player One, Real, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Java Mobile Phone Games: Best of 2006!</strong></p>
<p>The year 2006 was an amazing year for mobile gaming fanatics as the gaming industry came up with few amazing games that had a heady mix of action-adventures to puzzlers to racers to just about everything! These latest mobile phone games developed by companies like Player One, Real, Gameloft, Glu, Digital Chocolate, THQ Wireless amongst others are selling like hotcakes in the market! People used to download free Java games till few years back but nowadays <b>Mobile Games</b> are mainly sold through Network Carriers/Operators portals.</p>
<p>&#13;</p>
<p>With <b>Java games</b> going out of vogue these high octane games have started tempting the gaming community to come out and enjoy thrills dished out by them! These latest <b>mobile phone games</b> use platforms and technologies like Windows Mobile, Palm OS, Symbian OS, Macromedia&#8217;s Flash Lite, DoCoMo&#8217;s DoJa, Sun&#8217;s J2ME that have limited these exciting games to high end handsets only. </p>
<p>&#13;</p>
<p>Few of the best games that won over people in UK are Tornado Mania, Stranded, NFS Carbon and host of other games. The original concept Tornado Mania of controlling a Tornado to wreck havoc on the city made it instant success with all of us, the slowly unfolding plot of Stranded, inspired from Channel 4’s Lost, kept us all hanging on the tenterhooks of excitement unparalleled. NFS Carbon is a hardcore urban racing game with full of ‘twists’ and turns with steep ravines adding an extra bit of excitement for the gamer!</p>
<p>&#13;</p>
<p>These are just to name a few of the <b>mobile games</b> who finished the year on the pinnacle but there were others like Asphalt 3: Street Rules, 2006 Real Football, Mafia Wars Yakuza, Turbo Camels: Circus Extreme were few other games that enthralled us during the year that just went by. With games like Voodoo Kart, Age of Heroes III – Orc&#8217;s Retribution, America&#8217;s Army: Special Operations, Rodland and many others set to invade our mobile phones, the year 2007 is looking good!</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/java-mobile-phone-games-best-of-2006/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Mosaic Tiles © &#8211; Tips for Getting the Best Results!</title>
		<link>http://utropicmedia.net/blog/java-mosaic-tiles-%c2%a9-tips-for-getting-the-best-results</link>
		<comments>http://utropicmedia.net/blog/java-mosaic-tiles-%c2%a9-tips-for-getting-the-best-results#comments</comments>
		<pubDate>Sun, 01 Aug 2010 21:31:03 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Best]]></category>
		<category><![CDATA[Getting]]></category>
		<category><![CDATA[Mosaic]]></category>
		<category><![CDATA[Results]]></category>
		<category><![CDATA[Tiles]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/java-mosaic-tiles-%c2%a9-tips-for-getting-the-best-results</guid>
		<description><![CDATA[Java Mosaic Tiles © &#8211; Tips for Getting the Best Results! It isn&#8217;t just about simple redecoration; Java Mosaic Tiles remodeling is about bringing a different style and natural atmosphere into your home design. If you wish to bring the contemporary, yet natural look into your home&#8217;s interior and exterior design, you should explore the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Java Mosaic Tiles © &#8211; Tips for Getting the Best Results!</strong></p>
<p><a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.homepebbletiles.com/?cd=S132&amp;hl=Java+Mosaic+Tiles" target="_self"><strong></strong></a></p>
<p>
<p>It isn&#8217;t just about simple redecoration; <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.homepebbletiles.com/?cd=S132&amp;hl=Java+Mosaic+Tiles"><strong>Java Mosaic Tiles</strong></a> remodeling is about bringing a different style and natural atmosphere into your home design. If you wish to bring the contemporary, yet natural look into your home&#8217;s interior and exterior design, you should explore the countless opportunities provided by these unique panels. The following review will show you how you can easily remodel any room setting by using one of the most popular tiling techniques.<strong></strong> </p>
<p><strong>Basic introduction</strong> </p>
<p>The difference between this tiling method and other methods is the fact that Java Mosaic Tiles redecoration is actually based on a collection of unified smooth stones carefully sorted and then mounted onto a seamless mesh backed tile. Among thousands of seashores around the globe it seems like the South East Asian beaches provide the largest variety natural rock panels. Where can you use it? Practically anywhere inside and outside your home: Bathroom surfaces, kitchens, backsplash covering, patio floors, decks, pools, and even wine cellars. </p>
<p><strong>What are the main benefits?</strong> </p>
<p>Let&#8217;s quickly examine what is in it for us: </p>
<p>* Durable to most common home detergents.<br />* Can be used for virtually unlimited applications at home, in the office, in restaurants, hotels, etc.<br />* Easy to be replaced if needed.</p>
<p><strong>Useful advices!</strong> </p>
<p>* Order a small sample of the desired tiles prior to making a complete order &#8211; just to make sure it answers your expectations.</p>
<p>* Most recommended grout is sanded grout &#8211; it is suitable for both internal and external use.</p>
<p>* Upon completion, it is important to wait the adhesive&#8217;s recommended drying time before you begin on grouting.</p>
<p>There are probably many other benefits provided by this trendy redesigning technique simply because most people find it extremely easy to install and maintain. </p>
<p><strong>On the bottom line</strong> </p>
<p>Many home-makers find this <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.homepebbletiles.com/?cd=S132&amp;hl=Java+Mosaic+Tiles"><strong>Java Mosaic Tiles</strong></a> technique quite effective due to the fact that it provides numerous opportunities and applications that easily enable you to transform any room setting modern and appealing. It is advised to keep the above advices before you begin with installation.</p>
<div></div>
<p>More <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/java-mosaic-tiles-%c2%a9-tips-for-getting-the-best-results/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Pebble Tiles © &#8211; Surprising Remodeling Solution!</title>
		<link>http://utropicmedia.net/blog/java-pebble-tiles-%c2%a9-surprising-remodeling-solution</link>
		<comments>http://utropicmedia.net/blog/java-pebble-tiles-%c2%a9-surprising-remodeling-solution#comments</comments>
		<pubDate>Sun, 01 Aug 2010 00:29:23 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Pebble]]></category>
		<category><![CDATA[Remodeling]]></category>
		<category><![CDATA[Solution]]></category>
		<category><![CDATA[Surprising]]></category>
		<category><![CDATA[Tiles]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/java-pebble-tiles-%c2%a9-surprising-remodeling-solution</guid>
		<description><![CDATA[Java Pebble Tiles © &#8211; Surprising Remodeling Solution! Did you ever consider remodeling home surfaces by yourself? Have you already tried using do-it-yourself Java Pebble Tiles remodeling? It seems like no other tiling technique can be used for so many applications as provided by these stone panels. Find out how to quickly and easily decorate [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Java Pebble Tiles © &#8211; Surprising Remodeling Solution!</strong></p>
<p><a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.homepebbletiles.com/?cd=S133&amp;hl=Java+Pebble+Tiles" target="_self"><strong></strong></a></p>
<p>
<p>Did you ever consider remodeling home surfaces by yourself? Have you already tried using do-it-yourself <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.homepebbletiles.com/?cd=S133&amp;hl=Java+Pebble+Tiles"><strong>Java Pebble Tiles</strong></a> remodeling? It seems like no other tiling technique can be used for so many applications as provided by these stone panels. Find out how to quickly and easily decorate any surface.<strong></strong> </p>
<p><strong>Getting some basics</strong> </p>
<p>This unique Java Pebble Tiles redecoration method is made of a set of identical beach-stones manually and carefully attached onto a mesh backing of 12&#8242; by 12&#8242; size. Among thousands of seashores around the globe it seems like the South East Asian beaches provide the largest variety natural rock panels. You can practically tile anywhere and for any purpose: a) Bathrooms b) Kitchens c) Internal and external flooring (patios for example) d) all types of backsplashes etc. </p>
<p><strong>Benefits</strong> </p>
<p>Let&#8217;s quickly summarize the main advantages and benefits of this unique technique: </p>
<p>* Can be used inside as well as in the outside.<br />* Impervious to water and other liquids.<br />* Durable to any extreme temperatures such as around fireplaces and stoves for example.</p>
<p><strong>Free valuable tips!</strong> </p>
<p>* Upon completion, it is important to wait the adhesive&#8217;s recommended drying time before you begin on grouting.</p>
<p>* When you prepare the grout avoid adding too much water in the initial mix &#8211; that additional water can result in weak grout that can flake.</p>
<p>* Order a small sample of the desired tiles prior to making a complete order &#8211; just to make sure it answers your expectations.</p>
<p>There are probably many other great benefits provided by this fashionable home redesigning technique simply because any home-maker can use it at minimal effort. </p>
<p><strong>Quick summary</strong> </p>
<p>This affordable <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.homepebbletiles.com/?cd=S133&amp;hl=Java+Pebble+Tiles"><strong>Java Pebble Tiles</strong></a> technique is probably one of the easiest and most effective coating choices available today. Should it be your first time installation, it is recommended to go over the above tips before installation.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/java-pebble-tiles-%c2%a9-surprising-remodeling-solution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount Bromo East Java Indonesia</title>
		<link>http://utropicmedia.net/blog/mount-bromo-east-java-indonesia</link>
		<comments>http://utropicmedia.net/blog/mount-bromo-east-java-indonesia#comments</comments>
		<pubDate>Sat, 31 Jul 2010 03:30:52 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Bromo]]></category>
		<category><![CDATA[East]]></category>
		<category><![CDATA[Indonesia]]></category>
		<category><![CDATA[mount]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/mount-bromo-east-java-indonesia</guid>
		<description><![CDATA[Mount Bromo East Java Indonesia There were 30 bikers from HTML Jakarta and 10 bikers from HTML Jogja who joined with HTML Honda Tiger Mailing List in order to participated “Tour d’Bromo”. One of the touring purposes is the endurance from Jakarta to Bromo East Java (vice versa) but this event called as “Road to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Mount Bromo East Java Indonesia</strong></p>
<p>There were 30 bikers from HTML Jakarta and 10 bikers from HTML Jogja who joined with HTML Honda Tiger Mailing List in order to participated <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.dephut.go.id/INFORMASI/TN INDO-ENGLISH/tn_bromo.htm" target="_blank">“</a>Tour d’Bromo”.</p>
<p>One of the touring purposes is the endurance from Jakarta to Bromo East Java (vice versa) but this event called as “Road to Unity for Tiger Community” with long distance at least 2,050 km.</p>
<p><a></a></p>
<p>Mount Bromo 3392 M and Mount Semeru 3676 M (photographer bro Dondee) </p>
<p>Saturday 8 April 2006 at 07.00 AM all bikers from Jakarta should stand-by in the meeting point in Jl. Sabang Jakarta Pusat where this place also known as the central meeting point of all HTML members on weekly basis.</p>
<p>This program said as a part of recreation touring but it was also included endurance test the engine oil of “Pertamina Enduro 4T”.</p>
<p>On the other hand, “Safety Riding Campaign” as the major program and prior should be practiced into HTML member. The campaigns as the commitment between HTML and Pertamina were supported safety riding on the national program.</p>
<p>&#8220;Pertamina Enduro 4T&#8221; also provides a free jacket, pin and T’shirt which to be used for all HTML Bikers and we wore a same uniform.</p>
<p>As usual before start all motorbike in physically and gear apparel bikers should be checked and screened in details following to the HTML Standard Operating Procedures (SOP). It was very details, professionally screening where all riders could not avoid this procedure in order to make sure everything warranted must safe, and participants are ready to go.</p>
<p>Following to HTML rules that each group should be divided into 3 groups maximum 8 riders. This small group a part of new rule from HSRT (HTML Safety Riding Team).</p>
<p>All bikers who start from Jakarta would met friends with HTML Jogja in Semarang City Central Java and thereafter the journey continued to Batu, Malang East Java.</p>
<p>Due to the a long distance journey, there were a good opportunity for all bikers who wants to develop his riding skill, especially to perform the individual skills, for instance how to become the Road Captain, VO, Sweeper, Technical Officer and Group Leader. Here everybody can enjoy with the replacement position after their finish at least for one or two sections trip.</p>
<p>It was 7 (seven) days spent the journey and it was really very tight schedule.</p>
<p>Day 1: Jakarta &#8211; Pamanukan – Cirebon &#8211; Tegal &#8211; Semarang.</p>
<p>Day 2: Semarang &#8211; Salatiga &#8211; Suruh &#8211; Gemolong &#8211; Sragen &#8211; Ngawi &#8211; Caruban &#8211; Nganjuk &#8211; Kertosono – Pare &#8211; Kandangan &#8211; Pujon – Batu – Malang.</p>
<p>Day 3: Malang &#8211; Lawang &#8211; Pasuruan – Probolinggo and Bromo.</p>
<p>Day 4: Bromo – Pasuruan – Madiun – Magetan – Karanganyar – Solo – Jogja.</p>
<p>Day 5: Jogja stay for one day.</p>
<p>Day 6: Jogja – Magelang – Weleri – Pemalang.</p>
<p>Day 7: Pemalang – Cirebon – Subang – Cikampek – Karawang – Bekasi – Jakarta.</p>
<p>Photos are exclusive taken by Bro Dondee and Fajar Is:  Bro Dondee <a></a></p>
<p>Around Bromo</p>
<p><a></a></p>
<p>An early morning waiting Sunrise in Bromo</p>
<p><a></a></p>
<p>Sunrise coming in Bromo</p>
<p><a></a></p>
<p>Background the Mount Semeru (3676 M)</p>
<p><a></a></p>
<p>Photo with tourist from UK with background the Mount Semeru (3676 M)</p>
<p><a></a></p>
<p>Photo with the group of HTML Member who joined touring to Bromo</p>
<p><a></a></p>
<p>The HTML Bikers</p>
<p><a></a></p>
<p>In Top of Mount Bromo (3392 M)</p>
<p><a></a></p>
<p>In Top of Mount Bromo (3392 M)</p>
<p><a></a></p>
<p>Stairs to reach the Top of Mount Bromo (3392 M)</p>
<p><a></a></p>
<p>Group HTML Member</p>
<p><a></a></p>
<p>HTML Bikers Action in Bromo sand</p>
<p><a></a></p>
<p>My style with Honda Tiger 200cc in Bromo sand</p>
<p> Bro Dondee <a></a></p>
<p>Return To Jakarta</p>
<p><strong>The End.</strong></p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/mount-bromo-east-java-indonesia/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Techniques For Integrating Hibernate Into Legacy Java Code &#8211; Part 1</title>
		<link>http://utropicmedia.net/blog/techniques-for-integrating-hibernate-into-legacy-java-code-part-1</link>
		<comments>http://utropicmedia.net/blog/techniques-for-integrating-hibernate-into-legacy-java-code-part-1#comments</comments>
		<pubDate>Fri, 30 Jul 2010 06:29:19 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Integrating]]></category>
		<category><![CDATA[into]]></category>
		<category><![CDATA[Legacy]]></category>
		<category><![CDATA[Part]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/techniques-for-integrating-hibernate-into-legacy-java-code-part-1</guid>
		<description><![CDATA[Techniques For Integrating Hibernate Into Legacy Java Code &#8211; Part 1 If you&#8217;re like me, you spend a lot of time dealing with legacy code that, for whatever reason, does not take advantage of modern methodologies and libraries. I&#8217;ve taken over Java projects that contain hundreds of thousands of lines of code and not a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Techniques For Integrating Hibernate Into Legacy Java Code &#8211; Part 1</strong></p>
<p>If you&#8217;re like me, you spend a lot of time dealing with legacy code that, for whatever reason, does not take advantage of modern methodologies and libraries. I&#8217;ve taken over Java projects that contain hundreds of thousands of lines of code and not a single third-party jar other than a JDBC driver! One of the most common examples of this is the implementation of the data access layer. These days, the de facto methodology involves Hibernate and DAOs, usually managed by Spring.</p>
<p>&#13;This article will detail the steps I recently took to covert a large application from custom-written data access to Hibernate and Spring using the refactoring facilities in Eclipse. The key with this refactorization is to get the existing business logic code (Struts Actions, JSPs, Delegate classes, Business Service classes, etc.) to access the datastore using Hibernate, managed by Spring, without manually changing any of that code directly. Part 1 will include creating the Hibernate data object classes, DAOs, and refactoring the existing code to work with these newly created types. Part 2 will conclude the project with integration of the Hibernate DAOs and wiring everything up with Spring.</p>
<p>&#13;First of all, we need to create our Hibernate model and DAO classes. Obviously, since we&#8217;re dealing with a legacy application and data structure, we will want to use a bottom-up approach to building our data access layer. This just means that we&#8217;re going to generate the Java code and appropriate Hibernate config files from the existing database. There are many tools freely available to make this process very painless. I recommend an Eclipse Plugin for creating and maintaining the Hibernate artifacts (Google &#8220;Hibernate Eclipse Plugin&#8221; to get started). The structure and requirements for creating Hibernate classes and config files are well documented elsewhere, so I won&#8217;t go into detail here. However, in this particular project, the Hibernate DAO lifecycles are managed by Spring, so the DAO classes should all extend HibernateDAOSupport.</p>
<p>&#13;Now we have java classes (POJOs) which map to our database tables, but none of the existing code uses these new data object classes. This is where the refactoring tools of Eclipse comes in really handy. For example, say we have a legacy class called AccountInfo which corresponds to the ACCOUNT database table. Right-click the class and select Refactor -&gt; Extract Interface. On the dialogue box, call the new interface IAccount and make sure you select &#8220;Use the extracted interface type where possible.&#8221; Choose the other options according to your preferences. Click OK and kick back while Eclipse changes every occurence of AccountInfo references to IAccount references and recompiles. Of course, do this with each object model class.</p>
<p>&#13;If you never realized why OOP languages are so great, you&#8217;re about to. Now we&#8217;re going to refactor the code so that all of the existing legacy can be hooked into the new Hibernate model classes instead of the legacy ones. Continuing with the AccountInfo example, create a new class &#8211; you&#8217;ll probably want to create a new package for this step &#8211; called Account that extends the Hibernate POJO for Account and implements the new IAccount interface.</p>
<p>&#13;This next part is the most time-consuming, but really isn&#8217;t that bad. At this point, the newly created class will probably contain a bunch of empty methods containing only TODO comments. This is because the IAccount interface most likely defies a bunch of methods that are not implemented in the Hibernate Account POJO. To deal with these, we basically want the new Account class to delegate to its generated superclass whenever necessary to satisfy its contract as an IAccount type. As a real world example from the application I was working on, the legacy AccountInfo class defined a getter/setter pair for a property called username, whereas the corresponding column in the ACCOUNT table was actually LOGIN_NAME. To deal with this, you would simply implement the get/setUsername methods in Account to delegate to get/setLoginName (from its superclass). I also had to translate between various data types quite a bit. For example, the legacy code would define many properties as Strings even though the corresponding piece of data in the database was defined as an INT or TIMESTAMP. Again, do this with each object model class.</p>
<p>&#13;To finish up the data model layer, edit the appropriate Hibernate and Spring configuration files to refer to these new object model classes. The application now has the ability to map database records to Java objects via Hibernate, and the legacy code which refers to these classes has not required any editing by hand. To finish up this refactorization project, we need to hook in the Spring-supported Hibernate DAOs in a similar way. In Part 2 of this article, I will discuss refactoring the legacy code to read, write, and update data using Hibernate and Spring.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/techniques-for-integrating-hibernate-into-legacy-java-code-part-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build Powerful Java Applications Using Soa With New Book From Packt</title>
		<link>http://utropicmedia.net/blog/build-powerful-java-applications-using-soa-with-new-book-from-packt</link>
		<comments>http://utropicmedia.net/blog/build-powerful-java-applications-using-soa-with-new-book-from-packt#comments</comments>
		<pubDate>Thu, 29 Jul 2010 09:32:43 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[From]]></category>
		<category><![CDATA[Packt]]></category>
		<category><![CDATA[powerful]]></category>
		<category><![CDATA[Using]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/build-powerful-java-applications-using-soa-with-new-book-from-packt</guid>
		<description><![CDATA[Build Powerful Java Applications Using Soa With New Book From Packt This book shows how to use SOA and web services to build powerful applications in Java. It teaches the concepts and the implementation with best-practice real-world examples. You will learn to design a sound architecture for successful implementation of any business solution, the different [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Build Powerful Java Applications Using Soa With New Book From Packt</strong></p>
<p>This book shows how to use SOA and web services to build powerful applications in Java. It teaches the concepts and the implementation with best-practice real-world examples. You will learn to design a sound architecture for successful implementation of any business solution, the different types of architecture, and various tenets of SOA. The book explains the fundamentals and the advantages of using the Service Oriented Architecture in designing your business solution.</p>
<p>&#13;</p>
<p>In Detail: Service Oriented Architecture provides a way for applications to work together over the Internet. Usually, SOA applications are exposed through web services.</p>
<p>Web services have been around for a while, but complex adoption processes and poor standardization hampered their use at first. However, with the adoption of new, simpler protocols such as REST, and major companies supporting SOA, the time is now right to adopt these standards.</p>
<p>This book will show you how to build SOA, web services-based applications using Java. You will find out when SOA is the best choice for your application, how to design a sound architecture, and then implement your design using Java.</p>
<p>The book covers the important web services protocols: XML-over-HTTP, REST, and SOAP. You will learn how to develop web services at all levels of complexity and for all kinds of business situations.</p>
<p>&#13;</p>
<p>Approach:This book is an overview of how to implement SOA using Java with the help of real-world examples. It briefly introduces the theory behind SOA and all the case studies are described from scratch.</p>
<p>&#13;</p>
<p>The book is out now and is available from Packt. For more information, please visit: <a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.packtpub.com/service-oriented-architecture-for-java-applications/book">http://www.packtpub.com/service-oriented-architecture-for-java-applications/book</a></p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/build-powerful-java-applications-using-soa-with-new-book-from-packt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Sockets &#8211; You Just Got to Plug Them in</title>
		<link>http://utropicmedia.net/blog/java-sockets-you-just-got-to-plug-them-in</link>
		<comments>http://utropicmedia.net/blog/java-sockets-you-just-got-to-plug-them-in#comments</comments>
		<pubDate>Wed, 28 Jul 2010 12:30:51 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Just]]></category>
		<category><![CDATA[Plug]]></category>
		<category><![CDATA[Sockets]]></category>
		<category><![CDATA[Them]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/java-sockets-you-just-got-to-plug-them-in</guid>
		<description><![CDATA[Java Sockets &#8211; You Just Got to Plug Them in I realised that programming in Java is quite a fun only after doing it myself. You will be amazed to know that it&#8217;s like putting different pieces of puzzle together. You put them relatively in an integrated and coherent manner. The Beauty of it is, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Java Sockets &#8211; You Just Got to Plug Them in</strong></p>
<p>I realised that programming in Java is quite a fun only after doing it myself. You will be amazed to know that it&#8217;s like putting different pieces of puzzle together. You put them relatively in an integrated and coherent manner. The Beauty of it is, that most of the times you dont have to create these pieces yourself. You just customize them according to your need after you get them from an already defined java class or package. It was about programming, now lets talk sumthing about sockets.</p>
<p>Socket is used to establish a point-to-point, bidirectional connection between two entities in a network. Just like a real world socket, it is used to plugin a connection from another source. The connection can be incoming or outgoing or both. Similar is the case at the other end. To understand these sockets  properly, you need to learn a bit about Operating System and its Networking Protocols. Sockets are basically of three types: 1)<strong>UNIX Domain Sockets</strong>; 2) <strong>Internet Domain Sockets</strong>; 3) <strong>NS</strong> <strong>domain Sockets.</strong></p>
<p>Java being platform independent Programming language, supports only Internet Domain Sockets as only they are platform independent out of three. These internet domain sockets are distinguished on the basis of Internet protocol they work on&#8230;</p>
<p>1) <strong>TCP/IP(Transfer Control Protocol)</strong>: The data transfer is reliable, in-order,connection oriented, so takes connection establishment time before the actual data transfer takes place. Sockets based on TCP/IP are known as <strong>Stream Sockets.</strong></p>
<p>2) <strong>UDP(User Datagram Protocol)</strong>: It is connectionless,unrealiable and unordered data transfer protocol. Each packet in it has a destination address associated with it and is realeased into the network to make its own way. The sockets based on UDP are called<strong> Datagram Sockets.</strong></p>
<p>3)<strong> Raw IP</strong>: It is a non-formatted protocol. Unlike TCP/IP, UDP protocols, Raw IP is not a core protocol of IP Suite. It&#8217;s different from them as its used to receive header information of the packet along with data, which is not the case in TCP/IP, UDP, they just receive data.</p>
<p>In Java Sockets are mainly implemented from already defined classes and pakages. These are:</p>
<p>1) <strong>Java.net.package</strong>: It contains all the classes that a user require to create a network based application. The below mentioned classes namely ServerSocket and Socket are also its part. This package also contain classes to create Secure Sockets and to connect a Web Server.</p>
<p>2) <strong>ServerSocket Class:</strong> It Provides sockets for the Server side.These sockets monitor network for requests or simply waits for them. When such request arrives, a server socket performs assigned task based on the request.</p>
<p>3) <strong>Socket Class</strong>: This class provides the Client side sockets. These sockets connect to the server, send and receive data for the client.</p>
<p>Remember, no socket can work without a port which is identified by a port no. Port is a gateway to a socket connectivity which is on the both sides of network. A socket is mainly identified as per its ports.</p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/java-sockets-you-just-got-to-plug-them-in/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beta Records Bridges the Gap Between Php and Java</title>
		<link>http://utropicmedia.net/blog/beta-records-bridges-the-gap-between-php-and-java</link>
		<comments>http://utropicmedia.net/blog/beta-records-bridges-the-gap-between-php-and-java#comments</comments>
		<pubDate>Tue, 27 Jul 2010 15:30:02 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[Between]]></category>
		<category><![CDATA[Bridges]]></category>
		<category><![CDATA[Records]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/beta-records-bridges-the-gap-between-php-and-java</guid>
		<description><![CDATA[Beta Records Bridges the Gap Between Php and Java BETA Records, in anticipation of their upcoming release of Version 3 (V3) of their online music social community, has created a technological innovation that could ultimately allow websites to become more dynamic, creative and sophisticated while enabling companies to cut costs and reduce loads on servers [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Beta Records Bridges the Gap Between Php and Java</strong></p>
<p><a rel="nofollow" onclick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="http://www.betarecords.com" target="_blank">BETA Records</a>, in anticipation of their upcoming release of Version 3 (V3) of their online music social community, has created a technological innovation that could ultimately allow websites to become more dynamic, creative and sophisticated while enabling companies to cut costs and reduce loads on servers needed in large-scale clusters.</p>
<p>&#13;</p>
<p>Called &#8220;BETACache,&#8221; the new technology resulted from BETA’s PHP developers Rock Mutchler, Paul-Anton van Handel, Jon Bauer, Bernhard Schenkenfelder, and Eric Hollander.</p>
<p>&#13;</p>
<p>&#8220;These guys may have devised the ultimate scalability breakthrough for large-scale communities around the world – it&#8217;s like taking the performance of a Volkswagen and turning it into a Bentley overnight,&#8221; says Chris Honetschlaeger, BETA Records president. &#8220;From Facebook down to the world&#8217;s 20 million PHP websites, we at BETA are hopeful to finally give back to the PHP community we so admire.&#8221;</p>
<p>&#13;</p>
<p>PHP applications require a means of caching data from remote services, expensive database queries and other performance-killing operations. These problems are greatly magnified by Web 2.0&#8242;s heavy reliance on numerous AJAX requests to the web application, and frequent web service calls to partners.</p>
<p>&#13;</p>
<p>&#8220;BETACache could offer a superior alternative to the widely-used memcached, as well as opening up a tremendous amount of other features to PHP application engineers through JCS,&#8221; says Rock Mutchler, BETA VP of Technology. &#8220;With the BETACache process in place, we can now use the leading technologies to solve the performance issues that developers face. At BETA we have modified Zend Cache in the Zend Framework, by adding our own custom object that makes use of the Zend Platform Java Bridge.&#8221; </p>
<p>&#13;</p>
<p>The Zend Platform PHP/Java Bridge is a PHP module which provides stable and high-performance access to a Java Virtual Machine. &#8220;Through this we&#8217;re able to use the JCS package to provide an enterprise-class, pluggable and tunable distributed caching system written in Java,&#8221; Mutchler states.</p>
<p>&#13;</p>
<p>BETACache offers a clustered, distributed cache system which automatically caches objects in local memory, local disk, or on remote servers. The Zend Java Bridge allows high-performance enterprise-class integration between the PHP environment and JCS. &#8220;We are excited about future enhancements of BETACache to leverage Enterprise Java persistence systems in our clustered PHP application,&#8221; Hollander said.</p>
<div></div>
<p>More <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/beta-records-bridges-the-gap-between-php-and-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Make Java Script Search Engine Friendly</title>
		<link>http://utropicmedia.net/blog/how-to-make-java-script-search-engine-friendly</link>
		<comments>http://utropicmedia.net/blog/how-to-make-java-script-search-engine-friendly#comments</comments>
		<pubDate>Mon, 26 Jul 2010 18:31:12 +0000</pubDate>
		<dc:creator>Utropicmedia</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Engine]]></category>
		<category><![CDATA[Friendly]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://utropicmedia.net/blog/how-to-make-java-script-search-engine-friendly</guid>
		<description><![CDATA[How to Make Java Script Search Engine Friendly Think of the search engines like a child with a short attention span. If they have to crawl through tons of messy code before they get to the body content on your page, there is a chance they will &#8220;lose interest&#8221; and not continue spidering the page. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>How to Make Java Script Search Engine Friendly</strong></p>
<p>              Think of the search engines like a child with a short attention span.  If they have to crawl through tons of messy code before they get to the body content on your page, there is a chance they will &#8220;lose interest&#8221; and not continue spidering the page.</p>
<p>Since you want the engines to be able to spider all of your content pages, you should minimize the amount of extraneous code that is on your page. You worked hard to create your content and get your site optimized, so the last thing you want to do is take a chance that the engines won&#8217;t want to spider your pages.</p>
<p>One way to clean up the code is to take java script that is on-page and put it in an external .js file.</p>
<p>Java script on your page usually takes up anywhere from 3 &#8211; 8+ lines of code.  That is all just creates extra code that the spiders have to crawl through before they get to your body text.  You are better off calling your java script in from a .js file.  This takes what used to be many lines of code on your page and reduces it to one line where you just call the script in.</p>
<p>To create an External JavaScript file:</p>
<p>Copy your script and paste it into Notepad.</p>
<p>Remove the beginning and end script commands. They are:</p>
<p> and </p>
<p>Next, do a SAVE AS command and save the file as &#8220;text only&#8221; with an extension of .js</p>
<p>Example: java.js</p>
<p>Upload the file to a folder on your server that you name Java. (Or whatever name you wish.)</p>
<p>To call your Java file into your web page, enter into the same place where the script originally was:</p>
<p>Lastly, if you wish to hide the text from JavaScript impaired browsers to avoid error codes, surround the JavaScript with  in your java.js file.</p>
<p>This will make for cleaner code, and the functionality will still be the same.</p>
<p>You could also move your script to the bottom of the page &#8211; but remember if the page doesn&#8217;t fully load then your script may not load, so it could impact the functionality of your page.</p>
<p>Whatever solution you choose to implement &#8211; make sure you test it to ensure it works.  Once the engines pick up your pages and the traffic to your site increases, you want to be sure the site is fully functional and in tip top shape. </p>
<div></div>
<p>Find More <a href="http://utropicmedia.net/blog/category/development/java">Java Articles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://utropicmedia.net/blog/how-to-make-java-script-search-engine-friendly/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
