<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8059857681818615677</id><updated>2011-09-20T02:51:43.048+05:30</updated><category term='inconImage'/><title type='text'>Java</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-1994847948000252610</id><published>2010-08-10T09:12:00.001+05:30</published><updated>2011-09-18T20:07:37.905+05:30</updated><title type='text'>Trade mark at title in jframe</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;your&gt;.setTitle("Hello \u2122");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;            e.g. this.setTitle(“Title \u2122”);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-1994847948000252610?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/1994847948000252610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=1994847948000252610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1994847948000252610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1994847948000252610'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/08/trate-mark-at-title-in-jframe.html' title='Trade mark at title in jframe'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-1331606930782069713</id><published>2010-08-09T14:21:00.000+05:30</published><updated>2010-08-09T14:22:15.399+05:30</updated><title type='text'>mysqldump</title><content type='html'>mysqldump --host=10.1.23.224 --user=root --password=password  frameworkdb&gt; tests.sql&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-1331606930782069713?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/1331606930782069713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=1331606930782069713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1331606930782069713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1331606930782069713'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/08/mysqldump.html' title='mysqldump'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-1514645356783055405</id><published>2010-08-09T14:09:00.002+05:30</published><updated>2010-08-09T15:35:39.081+05:30</updated><title type='text'>php to java webservice</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Source: http://coding.derkeiler.com/Archive/PHP/alt.php/2006−09/msg00127.html&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;· From: tayze@xxxxxxxxx&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;· Date: 9 Sep 2006 08:43:35 −0700&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;I've been struggling with this for a while and am finally resorting to&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;asking for help.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Below is the code that works in java:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import java.net.URL;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import java.util.Vector;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import org.apache.soap.Constants;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import org.apache.soap.Fault;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import org.apache.soap.SOAPException;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import org.apache.soap.rpc.Call;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import org.apache.soap.rpc.Parameter;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import org.apache.soap.rpc.Response;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import java.io.*;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;import java.util.*;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;public class TopXCall {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;public static void main(String argv[]) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;String endpoint =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;"http://infao5501.ag5.mpi−sb.mpg.de:8080/soap/servlet/rpcrouter;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;// Initialize the method parameters&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Vector params = new Vector();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;// Create the call.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Call call = new Call();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;call.setTargetObjectURI("TopXService");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;call.setMethodName("processQuery");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;call.setParams(params);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;// Invoke the call.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Response response = null;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP 1page &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;try {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;response = call.invoke(new URL(endpoint), "");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;if (response.generatedFault()) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Fault fault = response.getFault();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;System.err.println("Generated fault: " + fault);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;} else {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;System.out.println(response.getReturnValue().getValue());&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;} catch (SOAPException e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;System.err.println("Caught SOAPException (" +&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;e.getFaultCode() + "): " + e.getMessage());&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;catch(Exception e) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;System.err.println("Exception caught: " + e.getMessage());&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Now I'm trying to get it to work in PHP. I believe I need to create a&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;WSDL file since there was not one provided.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Below is my PHP code and attempt at a WSDL file. I coppied a sample&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;file and modified the parts to suit my needs ... obviously I have made&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;some errors.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Any help or advice would be greatly appreciated.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Tayze&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;require_once('nusoap.php');&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;$wsdl="http://www.myserver.com/soap/TopXService.wsdl;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;$client=new soapclient($wsdl, 'wsdl');&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;$param=array(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'query'=&gt;'//article[about(., java)]',&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'collectionIndex'=&gt;0,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'mode'=&gt;0,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'k'=&gt;10,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'page'=&gt;0,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'conjunctive'=&gt;false&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP 2page &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;echo $client−&gt;call('processQuery', $param);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;echo 'Request: &lt;/span&gt;&lt;xmp&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'.$client−&gt;request.'&lt;/span&gt;&lt;/xmp&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;echo 'Response: &lt;/span&gt;&lt;xmp&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'.$client−&gt;response.'&lt;/span&gt;&lt;/xmp&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;echo 'Debug log: &lt;/span&gt;&lt;pre&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;'.$client−&gt;debug_str.'&lt;/span&gt;&lt;/pre&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;?&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;definitions name="TopXService"&gt;&lt;/definitions&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;targetNamespace="http://www.tayze.com/soap/TopXService.wsdl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;xmlns:tns="http://www.tayze.com/soap/TopXService.wsdl&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;xmlns:xsd="http://www.w3.org/2001/XMLSchema&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;xmlns="http://schemas.xmlsoap.org/wsdl/&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;message name="processQueryRequest"&gt;&lt;/message&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="query" type="xsd:string"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="collectionIndex" type="xsd:integer"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="mode" type="xsd:integer"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="k" type="xsd:integer"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="page" type="xsd:integer"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="conjunctive" type="xsd:boolean"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;message name="processQueryResponse"&gt;&lt;/message&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;part name="return" type="xsd:string"&gt;&lt;/part&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;porttype name="TopXPortType"&gt;&lt;/porttype&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;operation name="processQuery"&gt;&lt;/operation&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;input message="tns:processQueryRequest"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;output message="tns:processQueryResponse"&gt;&lt;/output&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;binding name="TopXBinding" type="tns:TopXPortType"&gt;&lt;/binding&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;soap:binding&gt;&lt;/soap:binding&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;transport="http://schemas.xmlsoap.org/soap/http"/&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;operation name="processQuery"&gt;&lt;/operation&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;soap:operation soapaction=""&gt;&lt;/soap:operation&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;input&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;soap:body use="encoded" namespace="TopXService"&gt;&lt;/soap:body&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;output&gt;&lt;/output&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;soap:body use="encoded" namespace="TopXService"&gt;&lt;/soap:body&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;service name="TopXService"&gt;&lt;/service&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP 3page&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;documentation&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Returns search results&lt;/span&gt;&lt;/documentation&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;port name="TopXPort" binding="tns:TopXBinding"&gt;&lt;/port&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;soap:address&gt;&lt;/soap:address&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;location="http://infao5501.ag5.mpi−sb.mpg.de:8080/soap/servlet/rpcrouter"/&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;SOAP connection to Java Web Service from PHP 4page&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-1514645356783055405?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/1514645356783055405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=1514645356783055405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1514645356783055405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1514645356783055405'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/08/php-to-java-webservice.html' title='php to java webservice'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-5044888968611732938</id><published>2010-07-17T04:14:00.002+05:30</published><updated>2010-07-17T04:18:10.362+05:30</updated><title type='text'>configuration mysql-JDBC in weblogic 8.1</title><content type='html'>step 1: copy your mysql connectivity jar into weblogic_home/server/lib&lt;div&gt;step2: edit the env in the weblogic_home/common/bin/commenv.cmd/sh&lt;/div&gt;&lt;div&gt;step3: append your connectivity jar path&lt;/div&gt;&lt;div&gt;step4: edit configDB.cmd/sh if needed&lt;/div&gt;&lt;div&gt;step5: create the Datasource for your database and create JNDI for your DataSource.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-5044888968611732938?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/5044888968611732938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=5044888968611732938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5044888968611732938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5044888968611732938'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/07/configuration-mysql-jdbc-in-weblogic-81.html' title='configuration mysql-JDBC in weblogic 8.1'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-9164423027511954930</id><published>2010-07-16T11:30:00.001+05:30</published><updated>2010-07-16T11:35:09.735+05:30</updated><title type='text'>Stored procedure to parse long string into tokens by using delimiter</title><content type='html'>&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;DELIMITER $$&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DROP PROCEDURE IF EXISTS `datawarehouse`.`aggregateStudent`$$&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CREATE DEFINER=`root`@`%` PROCEDURE `aggregateStudent`(IN adata LONGTEXT)&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt; DECLARE tempData LONGTEXT;&lt;/div&gt;&lt;div&gt; DECLARE fulldata LONGTEXT;&lt;/div&gt;&lt;div&gt; DECLARE st1 LONGTEXT;&lt;/div&gt;&lt;div&gt; DECLARE sValue LONGTEXT ;&lt;/div&gt;&lt;div&gt; DECLARE rFulldata LONGTEXT;&lt;/div&gt;&lt;div&gt; DECLARE firstrecord LONGTEXT ;&lt;/div&gt;&lt;div&gt; DECLARE len INT ;&lt;/div&gt;&lt;div&gt; DECLARE recordsize INT ;&lt;/div&gt;&lt;div&gt; DECLARE studentid VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE subjectid VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE chapterID VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE formLevel VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE classlevel VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE schoolid VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE tempSchool VARCHAR(50);&lt;/div&gt;&lt;div&gt; DECLARE score DOUBLE(12,2);&lt;/div&gt;&lt;div&gt; DECLARE nomore_data INT DEFAULT 0;&lt;/div&gt;&lt;div&gt; DECLARE flen INT ;&lt;/div&gt;&lt;div&gt; DECLARE ids INT ;&lt;/div&gt;&lt;div&gt; DECLARE no_schoolinfo INT DEFAULT 0;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET fulldata=adata;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET firstrecord= SUBSTRING(fulldata,1,INSTR(fulldata,'**')-1);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET rFulldata= SUBSTRING(fulldata,LENGTH(firstrecord)+3,LENGTH(fulldata));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET tempData=firstrecord;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET recordsize=LENGTH(firstrecord);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CREATE TABLE IF NOT EXISTS tempstore1 (v1 VARCHAR(50));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;firstLoop: WHILE (recordsize &gt; 1) DO&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SET sValue= SUBSTRING(tempData,1,INSTR(tempData,',')-1);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SET st1= SUBSTRING(tempData,LENGTH(sValue)+2,LENGTH(tempData));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SET tempData=st1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SET len = LENGTH(sValue);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;WHILE ( len &gt; 1) DO &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;INSERT INTO tempstore1 VALUES(sValue);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;SET sValue= SUBSTRING(tempData,1,INSTR(tempData,',')-1);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;SET st1= SUBSTRING(tempData,LENGTH(sValue)+2,LENGTH(tempData));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;SET tempData=st1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;SET len = LENGTH(sValue);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;END WHILE ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SELECT v1 INTO studentid FROM tempstore1 LIMIT 0,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SELECT v1 INTO subjectid FROM tempstore1 LIMIT 1,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SELECT v1 INTO chapterID FROM tempstore1 LIMIT 2,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SELECT v1 INTO score FROM tempstore1 LIMIT 3,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;DELETE FROM tempstore1 ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;BEGIN &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;DECLARE schoolInfo CURSOR FOR &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SELECT s.code,s.form_id,s.school_id FROM school_ilms.classroom s WHERE s.id IN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;(SELECT a.classroom_id FROM school_ilms.classroom_student a WHERE a.students_id IN &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;( SELECT u.id FROM school_ilms.user_ilms u WHERE u.registrationNo=studentid))AND  s.term_id IN (SELECT YEAR(CURDATE()));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;DECLARE CONTINUE HANDLER FOR NOT FOUND SET no_schoolinfo=1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;OPEN schoolInfo ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;SET no_schoolinfo =0 ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;WHILE (no_schoolinfo &lt;&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;FETCH schoolInfo INTO classlevel,formLevel,tempSchool ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;SELECT CODE INTO schoolid FROM school_ilms.school WHERE id= tempSchool ; &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;END WHILE ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;CLOSE schoolInfo;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;INSERT INTO tempstore1 VALUES(classlevel);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;INSERT INTO tempstore1 VALUES(formLevel);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;INSERT INTO tempstore1 VALUES(schoolid);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SELECT v1 INTO classlevel FROM tempstore1 LIMIT 0,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SELECT v1 INTO formLevel FROM tempstore1 LIMIT 1,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SELECT v1 INTO schoolid FROM tempstore1 LIMIT 2,1;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CALL getSchoolDetails(studentid,subjectid,chapterID,formLevel,classlevel,score,schoolid);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;DELETE FROM tempstore1 ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET firstrecord= SUBSTRING(rFulldata,1,INSTR(rFulldata,'**')-1);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET rFulldata= SUBSTRING(rFulldata,LENGTH(firstrecord)+3,LENGTH(rFulldata));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET tempData=firstrecord;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET recordsize = LENGTH(firstrecord);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END WHILE firstLoop;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; CALL update_classroom_level_assessment();&lt;/div&gt;&lt;div&gt; CALL update_subject_assessment();&lt;/div&gt;&lt;div&gt; CALL update_chapter_assessment();&lt;/div&gt;&lt;div&gt; CALL update_classlevel_assessment();&lt;/div&gt;&lt;div&gt; CALL update_district_assessment();&lt;/div&gt;&lt;div&gt; CALL update_state_assessment();&lt;/div&gt;&lt;div&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;DROP TABLE IF EXISTS tempstore1;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; END$$&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DELIMITER ;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;sample data for the above code:&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span class="Apple-style-span"   style="font-family:'Times New Roman', serif;color:#E36C0A;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"   style="font-family:'Times New Roman', serif;color:#E36C0A;"&gt;&lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;aggregateStudent('ST810317015813,SK00002Form4B,Form4,SUB0002044,T0002044010100,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;90,SK00002,**ST810317015813,SK00002Form4B,Form4,SUB0001044,T0001044010100,86,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;SK00002,**ST810831083223,SK00003Form4C,Form4,SUB0001044,T0001044030700,30,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;SK00003,**ST810818083223,SK00001Form4A,Form4,SUB0001044,T0001044030700,30,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;SK00001,**');&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class="MsoNormal" style="text-align: justify;margin-bottom: 0.0001pt; line-height: normal; "&gt;&lt;span style="font-family: 'Times New Roman', serif; color: rgb(227, 108, 10); "&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-9164423027511954930?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/9164423027511954930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=9164423027511954930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/9164423027511954930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/9164423027511954930'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/07/stored-procedure-to-parse-long-string.html' title='Stored procedure to parse long string into tokens by using delimiter'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-6601648213202460320</id><published>2010-07-14T15:38:00.002+05:30</published><updated>2010-07-14T15:54:03.786+05:30</updated><title type='text'>some utilities for swing</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;public class GraphicLocation {&lt;/div&gt;&lt;div&gt;      static       Toolkit toolkit = Toolkit.getDefaultToolkit();&lt;/div&gt;&lt;div&gt;      static      Dimension screenSize = toolkit.getScreenSize();&lt;/div&gt;&lt;div&gt;      public static int windowWidth(int x)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;           return (screenSize.width - x) / 2;&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;      public static int windowHeight(int x)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;            return (screenSize.height-x)/2;&lt;/div&gt;&lt;div&gt;        }        &lt;/div&gt;&lt;div&gt;       public static  int mainwindowWidth(int x)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;           return (screenSize.width - x) /3;&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;      public static  int mainwindowHeight(int x)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;            return (screenSize.height-x)/3;&lt;/div&gt;&lt;div&gt;        }        &lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;//to sort the vector/arraylist&lt;/div&gt;&lt;div&gt;&lt;div&gt;public class Sorter implements Comparator&lt;object&gt; {&lt;/object&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public int compare(Object arg0, Object arg1) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return arg0.toString().toUpperCase().compareTo(arg1.toString().toUpperCase());&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// to assign custom image to the tree node&lt;/div&gt;&lt;div&gt;&lt;div&gt;UIManager.put("Tree.leafIcon", getImage(TreeProperties.getProperty("leafIcon").toString()));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;    UIManager.put("Tree.openIcon", getImage(TreeProperties.getProperty("openIcon").toString()));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;    UIManager.put("Tree.closedIcon",getImage(TreeProperties.getProperty("closeIcon").toString()));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;    UIManager.put("Tree.expandedIcon", getImage(TreeProperties.getProperty("expandIcon").toString()));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;    UIManager.put("Tree.collapsedIcon",getImage(TreeProperties.getProperty("collapseIcon").toString()));&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DefaultTreeCellRenderer render;&lt;/div&gt;&lt;div&gt;render.setTextNonSelectionColor(color);&lt;/div&gt;&lt;div&gt;render.setBackgroundSelectionColor(color);&lt;/div&gt;&lt;div&gt;render.setTextSelectionColor(color);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt;     * returns the given image path into ImageIcon.&lt;/div&gt;&lt;div&gt;     * @param path&lt;/div&gt;&lt;div&gt;     * @return&lt;/div&gt;&lt;div&gt;     */&lt;/div&gt;&lt;div&gt;    public ImageIcon getImage(String path) {&lt;/div&gt;&lt;div&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;if (path.isEmpty()) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} else {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return new ImageIcon(path);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * Creates an ImageIcon from an image file&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param path&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            - The directory path of the image file&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param description&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            - The description of the ImageIcon to be returned&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @return ImageIcon - null if failed&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static ImageIcon createImageIcon(String path, String description) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;java.net.URL imageURL = DisplayNodes.class.getClassLoader()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;.getResource(path);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (imageURL == null) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} else {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return new ImageIcon(imageURL, description);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * Creates an ImageIcon from an image file&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param path&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            - The directory path of the image file&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param description&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            - The description of the ImageIcon to be returned&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @return ImageIcon - null if failed&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;protected static BufferedImage createImageIconFromFile(String path,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;String description) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;BufferedImage img = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;img = javax.imageio.ImageIO.read(new File(path));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return img;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;public class TransferFiles {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    File srcDir, destDir;&lt;/div&gt;&lt;div&gt;    final static Logger log=Logger.getLogger(TransferFiles.class);&lt;/div&gt;&lt;div&gt;    /**&lt;/div&gt;&lt;div&gt;     * transfer the fileList to the destination path.&lt;/div&gt;&lt;div&gt;     *&lt;/div&gt;&lt;div&gt;     * @param fileList&lt;/div&gt;&lt;div&gt;     * @param outFile&lt;/div&gt;&lt;div&gt;     * @param srcpath&lt;/div&gt;&lt;div&gt;     * @return&lt;/div&gt;&lt;div&gt;     */&lt;/div&gt;&lt;div&gt;    public static boolean writeToFile(String file, String outFile, String srcpath) {&lt;/div&gt;&lt;div&gt;        String line;&lt;/div&gt;&lt;div&gt;        BufferedReader in;&lt;/div&gt;&lt;div&gt;        BufferedWriter out;&lt;/div&gt;&lt;div&gt;        File fileName;&lt;/div&gt;&lt;div&gt;        try {&lt;/div&gt;&lt;div&gt;//            for (String file : fileList) {&lt;/div&gt;&lt;div&gt;                fileName = new File(file);&lt;/div&gt;&lt;div&gt;                in = new BufferedReader(new FileReader(srcpath + "\\" + fileName));&lt;/div&gt;&lt;div&gt;                out = new BufferedWriter(new FileWriter(outFile + "\\" + fileName));&lt;/div&gt;&lt;div&gt;                if (!in.ready()) {&lt;/div&gt;&lt;div&gt;                    throw new IOException();&lt;/div&gt;&lt;div&gt;                }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                while ((line = in.readLine()) != null) {&lt;/div&gt;&lt;div&gt;                   out.append(line);&lt;/div&gt;&lt;div&gt;                    out.newLine();&lt;/div&gt;&lt;div&gt;                   &lt;/div&gt;&lt;div&gt;                }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                in.close();&lt;/div&gt;&lt;div&gt;                out.close();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;//            }&lt;/div&gt;&lt;div&gt;            return true;&lt;/div&gt;&lt;div&gt;        } catch (Exception ex) {&lt;/div&gt;&lt;div&gt;              log.error(ex.getMessage(), ex);&lt;/div&gt;&lt;div&gt;              return false;&lt;/div&gt;&lt;div&gt;        } &lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    public static void uploadFiles(String fileList[], String destpath, String srcPath) {&lt;/div&gt;&lt;div&gt;        File fileName;&lt;/div&gt;&lt;div&gt;        FileOutputStream fileOut;&lt;/div&gt;&lt;div&gt;        FileInputStream fileIn;&lt;/div&gt;&lt;div&gt;        try {&lt;/div&gt;&lt;div&gt;            for (String file : fileList) {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                fileName = new File(file);&lt;/div&gt;&lt;div&gt;                fileIn = new FileInputStream(srcPath + "\\" + fileName);&lt;/div&gt;&lt;div&gt;              &lt;/div&gt;&lt;div&gt;                fileOut = new FileOutputStream(new File(destpath + "\\" + file));&lt;/div&gt;&lt;div&gt;                int c = 0;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                while ((c = fileIn.read()) != -1) {&lt;/div&gt;&lt;div&gt;                    fileOut.write((byte) c);&lt;/div&gt;&lt;div&gt;                }&lt;/div&gt;&lt;div&gt;                fileIn.close();&lt;/div&gt;&lt;div&gt;                fileOut.close();&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        } catch (Exception e) {&lt;/div&gt;&lt;div&gt;            System.out.println("error @ uploadFiles method : " + e.getMessage());&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * This method is to verify the string is in HHMM formate&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param s&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @return boolean&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static boolean validTimeHHMM(String s) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (s.length() &gt; 4) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return false;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;Pattern p = Pattern.compile("^([0-1][0-9]|2[0-3])[0-5][0-9]$");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;Matcher m = p.matcher(s);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;if (!m.matches()) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;return false;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return true;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static  String getCurrentDate() {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;  DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;        Date date = new Date();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return dateFormat.format(date);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static String getCurrentTime() {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;DateFormat dateFormat = new SimpleDateFormat("HH-mm-ss");&lt;/div&gt;&lt;div&gt;      Date date = new Date();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return dateFormat.format(date);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * it converts the utf format string into natural language.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param inputStr&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @return&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; public static String parse(String inputStr)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;    {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;    if (inputStr.contains("\\u")) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;       inputStr = inputStr.replace("\\u", "#@");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;       StringBuffer sb = new StringBuffer();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;       Pattern p = Pattern.compile("[a-fA-F0-9]+{4}");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;        Matcher m = p.matcher(inputStr);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;       int iCurrent = 0;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;       while (m.find()) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;        sb.append(inputStr.substring(iCurrent, m.start()));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;        sb.append((char)Integer.parseInt(m.group(), 16));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;          iCurrent = m.end();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;        }&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;        sb.append(inputStr.substring(iCurrent));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;       return sb.toString().replaceAll("#@", "");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;      }&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;    return inputStr;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;   }&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-6601648213202460320?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/6601648213202460320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=6601648213202460320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6601648213202460320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6601648213202460320'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/07/some-utilities-for-swing.html' title='some utilities for swing'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-7855198523263619166</id><published>2010-07-14T15:36:00.002+05:30</published><updated>2010-07-14T15:38:37.236+05:30</updated><title type='text'>get key and value from properties file in different location, rather than current source directory</title><content type='html'>&lt;div&gt;/**&lt;/div&gt;&lt;div&gt; * it receive the property value for the tree view preference.&lt;/div&gt;&lt;div&gt; * @param key&lt;/div&gt;&lt;div&gt; * @return&lt;/div&gt;&lt;div&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static String getPluginProperty(String key, String file) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;String str = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;FileInputStream fis=null; &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Properties p = new Properties();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if(file.isEmpty()) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;fis = new FileInputStream(PLUGIN_NAME);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}else {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;fis = new FileInputStream(file);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;p.load(fis);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;str = p.getProperty(key);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} catch (Exception s) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return str;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt; /**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;  * gives all property keys from the properties file&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;  */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public static  void getPreferenceValues() {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;ResourceBundle preferenceBundle = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;FileInputStream fis;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;File filename=new File(System.getProperty("user.home")+ "\\mmsb\\mmsb_preference.properties");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if(filename.exists()) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;fis = new FileInputStream(filename);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}else {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;return ;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;preferenceBundle = new PropertyResourceBundle(fis);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;Set&lt;string&gt; keys=preferenceBundle.keySet();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;preferenceMap=new HashMap&lt;string,&gt;();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;for(String key:keys) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;String value=preferenceBundle.getString(key);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if(value==null) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;value="";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;preferenceMap.put(key,value);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}catch(Exception e) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;System.err.println("error at reading preference file.");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-7855198523263619166?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/7855198523263619166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=7855198523263619166' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/7855198523263619166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/7855198523263619166'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/07/get-key-and-value-from-properties-file.html' title='get key and value from properties file in different location, rather than current source directory'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-6888537109716899434</id><published>2010-07-14T15:34:00.000+05:30</published><updated>2010-07-14T15:35:48.509+05:30</updated><title type='text'>add image on panel as background</title><content type='html'>&lt;div&gt;import java.awt.Dimension;&lt;/div&gt;&lt;div&gt;import java.awt.GridBagConstraints;&lt;/div&gt;&lt;div&gt;import java.awt.GridBagLayout;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import javax.swing.Icon;&lt;/div&gt;&lt;div&gt;import javax.swing.JComponent;&lt;/div&gt;&lt;div&gt;import javax.swing.JLabel;&lt;/div&gt;&lt;div&gt;import javax.swing.JPanel;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class BackgroundImagePanel&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    /**&lt;/div&gt;&lt;div&gt;     * Set up contraints so that the user supplied component and the background&lt;/div&gt;&lt;div&gt;     * image label overlap and resize identically&lt;/div&gt;&lt;div&gt;     */&lt;/div&gt;&lt;div&gt;    private static final GridBagConstraints gbc;&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    static&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;        gbc = new GridBagConstraints();&lt;/div&gt;&lt;div&gt;        gbc.gridx = 0;&lt;/div&gt;&lt;div&gt;        gbc.gridy = 0;&lt;/div&gt;&lt;div&gt;        gbc.weightx = 1.0;&lt;/div&gt;&lt;div&gt;        gbc.weighty = 1.0;&lt;/div&gt;&lt;div&gt;        gbc.fill = GridBagConstraints.BOTH;&lt;/div&gt;&lt;div&gt;        gbc.anchor = GridBagConstraints.NORTHWEST;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    /**&lt;/div&gt;&lt;div&gt;     * Wraps a Swing JComponent in a background image. Simply invokes the&lt;/div&gt;&lt;div&gt;     * overloded variant with Top/Leading alignment for background image.&lt;/div&gt;&lt;div&gt;     * &lt;/div&gt;&lt;div&gt;     * @param component - to wrap in the a background image&lt;/div&gt;&lt;div&gt;     * @param backgroundIcon - the background image (Icon)&lt;/div&gt;&lt;div&gt;     * @return the wrapping JPanel&lt;/div&gt;&lt;div&gt;     */&lt;/div&gt;&lt;div&gt;    public static JPanel wrapInBackgroundImage(JComponent component,&lt;/div&gt;&lt;div&gt;            Icon backgroundIcon)&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;        return wrapInBackgroundImage(component, backgroundIcon, JLabel.TOP,&lt;/div&gt;&lt;div&gt;                JLabel.LEADING);&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    /**&lt;/div&gt;&lt;div&gt;     * Wraps a Swing JComponent in a background image. The vertical and&lt;/div&gt;&lt;div&gt;     * horizontal alignment of background image can be specified using the&lt;/div&gt;&lt;div&gt;     * alignment contants from JLabel.&lt;/div&gt;&lt;div&gt;     * &lt;/div&gt;&lt;div&gt;     * @param component - to wrap in the a background image&lt;/div&gt;&lt;div&gt;     * @param backgroundIcon - the background image (Icon)&lt;/div&gt;&lt;div&gt;     * @param verticalAlignment - vertical alignment. See contants in JLabel.&lt;/div&gt;&lt;div&gt;     * @param horizontalAlignment - horizontal alignment. See contants in&lt;/div&gt;&lt;div&gt;     *            JLabel.&lt;/div&gt;&lt;div&gt;     * @return the wrapping JPanel&lt;/div&gt;&lt;div&gt;     */&lt;/div&gt;&lt;div&gt;    public static JPanel wrapInBackgroundImage(JComponent component,&lt;/div&gt;&lt;div&gt;            Icon backgroundIcon, int verticalAlignment, int horizontalAlignment)&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // make the passed in swing component transparent&lt;/div&gt;&lt;div&gt;        component.setOpaque(false);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // create wrapper JPanel&lt;/div&gt;&lt;div&gt;        JPanel backgroundPanel = new JPanel(new GridBagLayout());&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // add the passed in swing component first to ensure that it is in front&lt;/div&gt;&lt;div&gt;        backgroundPanel.add(component, gbc);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // create a label to paint the background image&lt;/div&gt;&lt;div&gt;        JLabel backgroundImage = new JLabel(backgroundIcon);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // set minimum and preferred sizes so that the size of the image&lt;/div&gt;&lt;div&gt;        // does not affect the layout size&lt;/div&gt;&lt;div&gt;        backgroundImage.setPreferredSize(new Dimension(1, 1));&lt;/div&gt;&lt;div&gt;        backgroundImage.setMinimumSize(new Dimension(1, 1));&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // align the image as specified.&lt;/div&gt;&lt;div&gt;        backgroundImage.setVerticalAlignment(verticalAlignment);&lt;/div&gt;&lt;div&gt;        backgroundImage.setHorizontalAlignment(horizontalAlignment);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // add the background label&lt;/div&gt;&lt;div&gt;        backgroundPanel.add(backgroundImage, gbc);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        // return the wrapper&lt;/div&gt;&lt;div&gt;        return backgroundPanel;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-6888537109716899434?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/6888537109716899434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=6888537109716899434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6888537109716899434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6888537109716899434'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/07/add-image-on-panel-as-background.html' title='add image on panel as background'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-3821704831721146843</id><published>2010-05-05T12:30:00.001+05:30</published><updated>2010-05-05T12:30:28.470+05:30</updated><title type='text'>firefox port issues</title><content type='html'>The built in webserver in Visual Studio 2005, formerly known as Casini, uses a dynamic or static port on the localhost machine (e.g. http://localhost:2049/default.aspx). &lt;br /&gt;&lt;br /&gt;It is dynamic by default, but you can make it static if you choose. That works very well except when you try it in Firefox. It simply gives you this response: &lt;br /&gt;&lt;br /&gt;This address uses a network port which is normally used for purposes other than Web browsing. Firefox has cancelled the request for your protection. &lt;br /&gt;&lt;br /&gt;It does that by default whenever you use a port other than port 80 - the default website port. It took me a lot of digging to find the solution and here it is.&lt;br /&gt;- Open Firefox &lt;br /&gt;&lt;br /&gt;- Type about:config in the address field &lt;br /&gt;&lt;br /&gt;- Right click anywhere on the screen &lt;br /&gt;&lt;br /&gt;- Click new &gt; string &lt;br /&gt;&lt;br /&gt;- Enter preference name as: network.security.ports.banned.override &lt;br /&gt;&lt;br /&gt;- Enter string value as: 2049 (or whatever port number you want)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-3821704831721146843?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/3821704831721146843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=3821704831721146843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3821704831721146843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3821704831721146843'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/05/firefox-port-issues.html' title='firefox port issues'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-3886634212199648029</id><published>2010-04-28T12:10:00.001+05:30</published><updated>2010-04-28T12:10:35.625+05:30</updated><title type='text'>jboss port change</title><content type='html'>Jboss port changes :&lt;br /&gt;1. Goto the deploy folder of the server instance you use.&lt;br /&gt;2. Goto the jbossweb-tomcat55.sar inside that deploy folder.&lt;br /&gt;3. Find the file named server.xml inside that folder. (tomcat service file).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-3886634212199648029?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/3886634212199648029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=3886634212199648029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3886634212199648029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3886634212199648029'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/04/jboss-port-change.html' title='jboss port change'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-5769869148643285307</id><published>2010-04-26T08:27:00.001+05:30</published><updated>2010-04-26T08:27:53.529+05:30</updated><title type='text'>mysql max connection</title><content type='html'>SET @@global.max_connections = 1250;&lt;br /&gt; &lt;br /&gt; SELECT @@global.max_connections;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-5769869148643285307?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/5769869148643285307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=5769869148643285307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5769869148643285307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5769869148643285307'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/04/mysql-max-connection.html' title='mysql max connection'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-8030261998960815644</id><published>2010-04-21T12:51:00.006+05:30</published><updated>2010-04-21T13:00:12.318+05:30</updated><title type='text'>create dynamic textboxes in html</title><content type='html'>&lt;textarea name="textarea" style="margin-top: 2px; margin-bottom: 2px; height: 388px; margin-left: 2px; margin-right: 2px; width: 362px; "&gt; &lt;html &gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;title&gt;Dynamic Textbox/title&gt;&lt;br /&gt;&lt;script type='text/javascript'&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function add_New_Element(val1) {&lt;br /&gt;var inival=0; &lt;br /&gt;inival=inival+1; // Increment element number by 1&lt;br /&gt;inival=val1;&lt;br /&gt;var ni = document.getElementById('area');&lt;br /&gt;var newdiv = document.createElement('div'); // Create dynamic element&lt;br /&gt;var divIdName = 'my'+inival+'Div';&lt;br /&gt;newdiv.setAttribute('id',divIdName);&lt;br /&gt;ni.appendChild(newdiv);&lt;br /&gt;return divIdName;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function addTextBox1(val)&lt;br /&gt;{&lt;br /&gt;	alert(val);&lt;br /&gt;	for(i=0;i&lt;val;i++){&lt;br /&gt;		var newArea = add_New_Element(i);&lt;br /&gt;		var htcontents = "&lt;input type='text'  name='textbx[]'/&gt; ";&lt;br /&gt;		document.getElementById(newArea).innerHTML = htcontents; // You can any other elements in place of 'htcontents'&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/script&gt; &lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;br /&gt;&lt;form &gt;&lt;br /&gt;&lt;!-- &lt;a onclick='addTextBox()' href='#'&gt;Add New Text Box &lt;/a&gt; --&gt;&lt;br /&gt;&lt;select onchange = "addTextBox1(this.value)"&gt;&lt;br /&gt;&lt;option value = "0"&gt;0&lt;/option&gt;&lt;br /&gt;&lt;option value = "1"&gt;1&lt;/option&gt;&lt;br /&gt;&lt;option value = "2"&gt;2&lt;/option&gt;&lt;br /&gt;&lt;option value = "3"&gt;3&lt;/option&gt;&lt;br /&gt;&lt;option value = "4"&gt;4&lt;/option&gt;&lt;br /&gt;&lt;option value = "5"&gt;5&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;!-- Textbox will be added in followng DIV --&gt;&lt;br /&gt;&lt;div id='area'&gt;&lt;/div&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt; &lt;/textarea&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-8030261998960815644?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/8030261998960815644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=8030261998960815644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8030261998960815644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8030261998960815644'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/04/create-dynamic-textboxes-in-html.html' title='create dynamic textboxes in html'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-62763728890564293</id><published>2010-04-21T12:49:00.000+05:30</published><updated>2010-04-21T12:50:38.772+05:30</updated><title type='text'>sample to create right join</title><content type='html'>SELECT s.total,temp.code ,s.subject_id,temp.academicRecord_id,temp.examDate,temp.TYPE,temp.educationLevel_id FROM school_ilms.subjectresult s &lt;div&gt;RIGHT JOIN (&lt;div&gt;(SELECT er.id,e.code,er.academicRecord_id,er.examDate,e.TYPE ,e.educationLevel_id FROM school_ilms.exam e RIGHT JOIN (school_ilms.examresult er ) &lt;/div&gt;&lt;div&gt;ON (e.id=er.exam_id)&lt;/div&gt;&lt;div&gt; WHERE e.TYPE='G' OR e.type='S') AS temp) ON(s.examResult_id=temp.id); &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-62763728890564293?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/62763728890564293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=62763728890564293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/62763728890564293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/62763728890564293'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/04/sample-to-create-right-join.html' title='sample to create right join'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-181242572222125370</id><published>2010-04-21T12:45:00.002+05:30</published><updated>2010-04-21T12:48:17.255+05:30</updated><title type='text'>create tomcat instance in linux using one tomcat as a base</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;b&gt;This is configuring the tomcats :&lt;/b&gt;&lt;/p&gt;  &lt;ol style="margin-top:0in" start="1" type="1"&gt;  &lt;li class="MsoNormal" style="mso-list:l0 level1 lfo1;tab-stops:.5in"&gt;making one      tomcat into base and run remaining instances&lt;/li&gt; &lt;/ol&gt;  &lt;p class="MsoNormal"&gt;CATALINA_BASE=/home/stp/tomcat8080 /usr/apache-tomcat-6.0.20/bin/catalina.sh start&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; tail -f tomcat8080/logs/catalina.out&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;b&gt; COPY FILE FROM CONF&lt;/b&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; cp /usr/apache-tomcat-6.0.20/conf/* tomcat8080/conf/&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;b&gt; TO EDIT THE SERVER.XML IN TOMCATS&lt;/b&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; for i in 1 2; do sed -e s/8080/808$i/g -e s/8005/$((8005+$i*100))/g -e s/8009/$((8009+$i*100))/g conf/server.xml &gt; tomcat808$i/conf/server.xml ; done&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;b&gt; CREATE TOMCAT INSTANCES&lt;/b&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; for i in 1 2; do cp -r tomcat8080 tomcat808$i; done&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;b&gt; TO COPY THE CONF FILE INTO TOMCATS&lt;/b&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; cp tomcat8080/conf/server.xml conf/&lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-181242572222125370?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/181242572222125370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=181242572222125370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/181242572222125370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/181242572222125370'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/04/create-tomcat-instance-in-linux-using.html' title='create tomcat instance in linux using one tomcat as a base'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-1522794093911073291</id><published>2010-04-09T14:58:00.000+05:30</published><updated>2010-04-09T14:59:27.604+05:30</updated><title type='text'>creating signed jar</title><content type='html'>&lt;div&gt;example&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jar -cvmf META-INF/MANIFEST.MF MMSB-APP.jar *.*&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jarsigner MMSB-APP.jar mimos.stp&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-1522794093911073291?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/1522794093911073291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=1522794093911073291' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1522794093911073291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1522794093911073291'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/04/creating-signed-jar.html' title='creating signed jar'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-4011575924302410234</id><published>2010-03-08T12:49:00.001+05:30</published><updated>2010-03-08T12:52:44.916+05:30</updated><title type='text'>script to get avg mem and avg cpu usage in linux</title><content type='html'>#!/bin/bash -x&lt;br /&gt;#for (( i = 0 ; i &lt;= 10; i++ ))&lt;br /&gt;while true&lt;br /&gt;do&lt;br /&gt;dt=`date`;&lt;br /&gt;#st1=`free -gos  awk 'NR==1{print $2}'`&lt;br /&gt;used="`free -g  awk 'NR==2{print $3}'`"&lt;br /&gt;total="`free -g  awk 'NR==3{print $4}'`"&lt;br /&gt;#echo "total : " $total "used : " $used `date`&lt;br /&gt;# calculate the average memory&lt;br /&gt;echo "total : " $total "used : " $used "avg-mem" `expr $used/$total*100  bc -l` "----------" `iostat -xtc` &gt;&gt; tt.txt&lt;br /&gt;# to wait for 2 seconds&lt;br /&gt;sleep 2&lt;br /&gt;done&lt;br /&gt;tested in centos 5 version&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-4011575924302410234?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/4011575924302410234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=4011575924302410234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/4011575924302410234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/4011575924302410234'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2010/03/script-to-get-avg-mem-and-avg-cpu-usage.html' title='script to get avg mem and avg cpu usage in linux'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-3822066923259912510</id><published>2009-12-04T14:40:00.002+05:30</published><updated>2009-12-04T14:43:58.019+05:30</updated><title type='text'>short cut for System.out.println configuration on myeclipse or eclipse</title><content type='html'>To customize the System.out.println() in to three letters word like "sop" as like sysout...&lt;br /&gt;go to window--&gt; prference--&gt; java-- &gt; editor-- &gt; template--&gt; add--&gt; give yourshortcut code and describe that value and code&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-3822066923259912510?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/3822066923259912510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=3822066923259912510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3822066923259912510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3822066923259912510'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/12/short-cut-for-systemoutprintln.html' title='short cut for System.out.println configuration on myeclipse or eclipse'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-412910778184778202</id><published>2009-11-20T12:48:00.004+05:30</published><updated>2009-12-04T09:03:01.100+05:30</updated><title type='text'>Hibernate</title><content type='html'>1. First create project in eclipse(either java project/webproject)&lt;br /&gt;2. configure the required jar for sql or mysql or any data base&lt;br /&gt;2. right click on project and Add hibernate capabilities&lt;br /&gt;3. then configure the hibenate configureation file&lt;br /&gt;&lt;textarea cols="61" rows="8" wrap="OFF" style="WIDTH: 575px; HEIGHT: 160px"&gt;  &lt;?xml version='1.0' encoding='UTF-8'?&gt;  &lt;!DOCTYPE hibernate-configuration PUBLIC           "-//Hibernate/Hibernate Configuration DTD 3.0//EN"           "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;  Generated by MyEclipse Hibernate Tools.                   --&gt;&lt;br /&gt;&lt;hibernate-configuration&gt;      &lt;br /&gt;&lt;session-factory&gt;        &lt;br /&gt;&lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;     &lt;br /&gt;&lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/frameworkdb&lt;/property&gt; &lt;property name="connection.username"&gt;root&lt;/property&gt;         &lt;br /&gt;&lt;property name="connection.password"&gt;12345678&lt;/property&gt;         &lt;br /&gt;&lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;                  &lt;br /&gt;&lt;property name="hibernate.show_sql "&gt;true&lt;/property&gt;         &lt;br /&gt;&lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;      &lt;br /&gt;&lt;mapping resource="authentication.hbm.xml"&gt;     &lt;br /&gt;&lt;/session-factory&gt;  &lt;br /&gt; &lt;/hibernate-configuration&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;4. create the POJO code that will map the table column names eg.&lt;br /&gt;&lt;br /&gt;&lt;textarea style="WIDTH: 548px; HEIGHT: 143px" rows="7" cols="60"&gt;/**   *    */  package com.hib.to;    /**   * @author kumar.ganapathy   *   */  public class Authenticate {      private long uid;    private String userName;    private String passWord;    /**     * @return the uid     */    public long getUid() {     return uid;    }    /**     * @param uid the uid to set     */    public void setUid(long uid) {     this.uid = uid;    }    /**     * @return the userName     */    public String getUserName() {     return userName;    }    /**     * @param userName the userName to set     */    public void setUserName(String userName) {     this.userName = userName;    }    /**     * @return the passWord     */    public String getPassWord() {     return passWord;    }    /**     * @param passWord the passWord to set     */    public void setPassWord(String passWord) {     this.passWord = passWord;    }          }   &lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. create the mapping xml called authenticate.hbm.xml&lt;br /&gt;&lt;br /&gt;&lt;textarea style="WIDTH: 557px; HEIGHT: 150px" rows="8" cols="61"&gt; &lt;?xml version="1.0"?&gt;  &lt;!DOCTYPE hibernate-mapping PUBLIC  "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;    &lt;hibernate-mapping&gt;    &lt;class name="com.hib.to.Authenticate" table="authentication"&gt;     &lt;id name="uid" type="long" column="userid"&gt;        &lt;/id&gt;      &lt;property name="userName"&gt;       &lt;column name="username"&gt;    &lt;/property&gt;    &lt;property name="passWord"&gt;      &lt;column name="password"&gt;    &lt;/property&gt;   &lt;/class&gt;  &lt;/hibernate-mapping&gt;  &lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;6. create main class to run hibernate as standalone&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;textarea style="WIDTH: 559px; HEIGHT: 159px" rows="8" cols="61"&gt; package com.hib.showcase;    import org.hibernate.Query;  import org.hibernate.Session;  import org.hibernate.SessionFactory;  import org.hibernate.Transaction;  import org.hibernate.cfg.Configuration;    import com.hib.to.Authenticate;    public class FirstHibernateprg {     /**    * @param args    */   public static void main(String[] args) {       Session session=null;     try{       SessionFactory sessionFactory = new          Configuration().configure().buildSessionFactory();              session =sessionFactory.openSession();             Transaction tr= session.beginTransaction();       Authenticate auth=new Authenticate();       String sql="delete from authentication where uid=6";       Query qq=session.createQuery(sql);       auth.setUid(6);       auth.setUserName("praveen");       auth.setPassWord("007");         //session.save(auth);       qq.executeUpdate();       tr.commit();           }catch(Exception e){      System.out.println("error : "+e.getMessage());      e.printStackTrace();     }finally{      session.flush();       session.close();           }   }    }  &lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. run the application as like normal standalone java class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-412910778184778202?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/412910778184778202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=412910778184778202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/412910778184778202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/412910778184778202'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/11/hibernate.html' title='Hibernate'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-3801516890590127721</id><published>2009-07-29T18:18:00.005+05:30</published><updated>2009-07-29T18:32:26.178+05:30</updated><title type='text'>struts 2 first configuration</title><content type='html'>roject structure :&lt;br /&gt;&lt;br /&gt;lib folders should have the following&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;commons-logging-1.0.4.jar&lt;/li&gt;&lt;li&gt;commons-logging-api-1.1.jar&lt;/li&gt;&lt;li&gt;freemaker-2.3.13.jar&lt;/li&gt;&lt;li&gt;ognl-2.6.11.jar&lt;/li&gt;&lt;li&gt;struts2-core-2.1.6.jar&lt;/li&gt;&lt;li&gt;xwork-2.1.2.jar&lt;/li&gt;&lt;li&gt;commons-fileload-1.2.1.jar&lt;/li&gt;&lt;li&gt;struts-core-1.3.10.jar&lt;/li&gt;&lt;/ol&gt;then remaining as per the developer needs.&lt;br /&gt;first write the Action class &lt;span style="font-weight: bold;"&gt;HelloAction.java&lt;/span&gt;&lt;br /&gt;eg&lt;br /&gt;&lt;br /&gt;&lt;textarea style="margin: 1px 0px; height: 157px; width: 385px;" rows="6" cols="35"&gt;package com.struts.sample.action;&lt;br /&gt;import com.opensymphony.xwork2.ActionSupport;&lt;br /&gt;&lt;br /&gt;public class HelloAction extends ActionSupport{&lt;br /&gt;&lt;br /&gt;String greetings = "test";&lt;br /&gt;&lt;br /&gt;public String execute() throws Exception {&lt;br /&gt;	if(greetings.equals("kumar")){&lt;br /&gt;		setGreetings("Hello World tested");&lt;br /&gt;		return SUCCESS;&lt;br /&gt;	}else {&lt;br /&gt;		setGreetings("Praveen");&lt;br /&gt;		return "Fail";&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* @return the greetings&lt;br /&gt;*/&lt;br /&gt;public String getGreetings() {&lt;br /&gt;return greetings;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* @param greetings the greetings to set&lt;br /&gt;*/&lt;br /&gt;public void setGreetings(String greetings) {&lt;br /&gt;this.greetings = greetings;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/textarea&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. create jsp files,&lt;br /&gt;2.1 index.jsp&lt;/span&gt;&lt;br /&gt;&lt;textarea style="margin: 1px 0px; height: 157px; width: 385px;" rows="6" cols="35"&gt; &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;&lt;br /&gt;&lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;&lt;br /&gt;&lt;title&gt;Struts 2 Example&lt;/title&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;s:action name="HelloAction" executeresult="true"&gt;&lt;/s:action&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.2 HelloAction.jsp&lt;/span&gt;&lt;br /&gt;&lt;textarea style="margin: 1px 0px; height: 157px; width: 385px;" rows="6" cols="35"&gt; &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt;&lt;br /&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;&lt;br /&gt;&lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;&lt;br /&gt;&lt;title&gt;Struts 2 Example&lt;/title&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;s:property value="greetings"&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;3. Now configure the &lt;span style="font-weight: bold;"&gt;struts.xml&lt;/span&gt;&lt;br /&gt;&lt;textarea style="margin: 1px 0px; height: 157px; width: 385px;" rows="6" cols="35"&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;&lt;br /&gt;&lt;struts&gt;&lt;br /&gt;&lt;package name="hello" extends="struts-default"&gt;&lt;br /&gt;&lt;action name="HelloAction" class="com.struts.sample.action.HelloAction"&gt;&lt;br /&gt;&lt;result name="SUCCESS"&gt;/jsp/HelloAction.jsp&lt;/result&gt;&lt;br /&gt;&lt;result name="Fail"&gt;/jsp/Test.jsp&lt;/result&gt;&lt;br /&gt;&lt;/action&gt;&lt;br /&gt;&lt;br /&gt;&lt;/package&gt;&lt;br /&gt;&lt;/struts&gt;&lt;/textarea&gt;&lt;br /&gt;4. configure the web container &lt;span style="font-weight: bold;"&gt;web.xml&lt;/span&gt;&lt;br /&gt;&lt;textarea style="margin: 1px 0px; height: 157px; width: 385px;" rows="6" cols="35"&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xsi="http://www.w3.org/2001/XMLSchema-instance" schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;&lt;br /&gt;&lt;filter&gt;&lt;br /&gt;&lt;filter-name&gt;struts2&lt;/filter-name&gt;&lt;br /&gt;&lt;filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher&lt;/filter-class&gt;&lt;br /&gt;&lt;/filter&gt;&lt;br /&gt;&lt;filter-mapping&gt;&lt;br /&gt;&lt;filter-name&gt;struts2&lt;/filter-name&gt;&lt;br /&gt;&lt;url-pattern&gt;/*&lt;/url-pattern&gt;&lt;br /&gt;&lt;/filter-mapping&gt;&lt;br /&gt;&lt;welcome-file-list&gt;&lt;br /&gt;&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;&lt;br /&gt;&lt;/welcome-file-list&gt;&lt;br /&gt;&lt;/web-app&gt;&lt;br /&gt; &lt;/textarea&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-3801516890590127721?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/3801516890590127721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=3801516890590127721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3801516890590127721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/3801516890590127721'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/07/struts-2-first-configuration.html' title='struts 2 first configuration'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-6677418351775934034</id><published>2009-06-17T09:50:00.002+05:30</published><updated>2009-06-17T10:41:32.829+05:30</updated><title type='text'>A List of JDBC Drivers</title><content type='html'>&lt;div class="" style="font-family: Arial,Helvetica,Sans-Serif; font-weight: bold; color: rgb(255, 102, 0); margin-left: 10px; margin-top: 10px;"&gt;A List of JDBC Drivers&lt;/div&gt; &lt;div class="" style="padding: 10px;"&gt;If you need to access a database with Java, you need a driver. This is a list of the drivers available, what database they can access, who makes it, and how to contact them. &lt;p&gt; &lt;span style="font-weight: bold;"&gt;IBM DB2&lt;/span&gt;&lt;br /&gt;jdbc:db2://&lt;host&gt;:&lt;port&gt;/&lt;db&gt;&lt;br /&gt;COM.ibm.db2.jdbc.app.DB2Driver&lt;br /&gt;&lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;JDBC-ODBC Bridge&lt;/span&gt;&lt;br /&gt;jdbc:odbc:&lt;db&gt;&lt;br /&gt;sun.jdbc.odbc.JdbcOdbcDriver &lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Microsoft SQL Server&lt;/span&gt;&lt;br /&gt;jdbc:weblogic:mssqlserver4:&lt;db&gt;@&lt;host&gt;:&lt;port&gt;&lt;br /&gt;weblogic.jdbc.mssqlserver4.Driver &lt;/port&gt;&lt;/host&gt;&lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Oracle Thin&lt;/span&gt;&lt;br /&gt;jdbc:oracle:thin:@&lt;host&gt;:&lt;port&gt;:&lt;sid&gt;&lt;br /&gt;oracle.jdbc.driver.OracleDriver &lt;/sid&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;PointBase Embedded Server&lt;/span&gt;&lt;br /&gt;jdbc:pointbase://embedded[:&lt;port&gt;]/&lt;db&gt;&lt;br /&gt;com.pointbase.jdbc.jdbcUniversalDriver &lt;/db&gt;&lt;/port&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Cloudscape&lt;/span&gt;&lt;br /&gt;jdbc:cloudscape:&lt;db&gt;&lt;br /&gt;COM.cloudscape.core.JDBCDriver &lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Cloudscape RMI&lt;/span&gt;&lt;br /&gt;jdbc:rmi://&lt;host&gt;:&lt;port&gt;/jdbc:cloudscape:&lt;db&gt;&lt;br /&gt;RmiJdbc.RJDriver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Firebird (JCA/JDBC Driver)&lt;/span&gt;&lt;br /&gt;jdbc:firebirdsql:[//&lt;host&gt;[:&lt;port&gt;]/]&lt;db&gt;&lt;br /&gt;org.firebirdsql.jdbc.FBDriver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;IDS Server&lt;/span&gt;&lt;br /&gt;jdbc:ids://&lt;host&gt;:&lt;port&gt;/conn?dsn='&lt;odbc_dsn_name&gt;'&lt;br /&gt;ids.sql.IDSDriver &lt;/odbc_dsn_name&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Informix Dynamic Server&lt;/span&gt;&lt;br /&gt;jdbc:informix-sqli://&lt;host&gt;:&lt;port&gt;/&lt;db&gt;:INFORMIXSERVER=&lt;server_name&gt;&lt;br /&gt;com.informix.jdbc.IfxDriver &lt;/server_name&gt;&lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;InstantDB (v3.13 and earlier)&lt;/span&gt;&lt;br /&gt;jdbc:idb:&lt;db&gt;&lt;br /&gt;jdbc.idbDriver &lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;InstantDB (v3.14 and later)&lt;/span&gt;&lt;br /&gt;jdbc:idb:&lt;db&gt;&lt;br /&gt;org.enhydra.instantdb.jdbc.idbDriver &lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Interbase (InterClient Driver)&lt;/span&gt;&lt;br /&gt;jdbc:interbase://&lt;host&gt;/&lt;db&gt;&lt;br /&gt;interbase.interclient.Driver &lt;/db&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Hypersonic SQL (v1.2 and earlier)&lt;/span&gt;&lt;br /&gt;jdbc:HypersonicSQL:&lt;db&gt;&lt;br /&gt;hSql.hDriver &lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Hypersonic SQL (v1.3 and later)&lt;/span&gt;&lt;br /&gt;jdbc:HypersonicSQL:&lt;db&gt;&lt;br /&gt;org.hsql.jdbcDriver &lt;/db&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Microsoft SQL Server (JTurbo Driver)&lt;/span&gt;&lt;br /&gt;jdbc:JTurbo://&lt;host&gt;:&lt;port&gt;/&lt;db&gt;&lt;br /&gt;com.ashna.jturbo.driver.Driver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Microsoft SQL Server (Sprinta Driver)&lt;/span&gt;&lt;br /&gt;jdbc:inetdae:&lt;host&gt;:&lt;port&gt;?database=&lt;db&gt;&lt;br /&gt;com.inet.tds.TdsDriver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Microsoft SQL Server 2000 (Microsoft Driver)&lt;/span&gt;&lt;br /&gt;jdbc:microsoft:sqlserver://&lt;host&gt;:&lt;port&gt;[;DatabaseName=&lt;db&gt;]&lt;br /&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt;  &lt;span style="font-weight: bold;"&gt;MySQL (MM.MySQL Driver)&lt;/span&gt;&lt;br /&gt;jdbc:mysql://&lt;host&gt;:&lt;port&gt;/&lt;db&gt;&lt;br /&gt;org.gjt.mm.mysql.Driver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Oracle OCI 8i&lt;/span&gt;&lt;br /&gt;jdbc:oracle:oci8:@&lt;sid&gt;&lt;br /&gt;oracle.jdbc.driver.OracleDriver &lt;/sid&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Oracle OCI 9i&lt;/span&gt;&lt;br /&gt;jdbc:oracle:oci:@&lt;sid&gt;&lt;br /&gt;oracle.jdbc.driver.OracleDriver &lt;/sid&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;PostgreSQL (v6.5 and earlier)&lt;/span&gt;&lt;br /&gt;jdbc:postgresql://&lt;host&gt;:&lt;port&gt;/&lt;db&gt;&lt;br /&gt;postgresql.Driver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;PostgreSQL (v7.0 and later)&lt;/span&gt;&lt;br /&gt;jdbc:postgresql://&lt;host&gt;:&lt;port&gt;/&lt;db&gt;&lt;br /&gt;org.postgresql.Driver &lt;/db&gt;&lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Sybase (jConnect 4.2 and earlier)&lt;/span&gt;&lt;br /&gt;jdbc:sybase:Tds:&lt;host&gt;:&lt;port&gt;&lt;br /&gt;com.sybase.jdbc.SybDriver &lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-weight: bold;"&gt;Sybase (jConnect 5.2)&lt;/span&gt;&lt;br /&gt;jdbc:sybase:Tds:&lt;host&gt;:&lt;port&gt;&lt;br /&gt;com.sybase.jdbc2.jdbc.SybDriver &lt;/port&gt;&lt;/host&gt;&lt;/p&gt;&lt;p&gt; To test your driver once it's installed, try the following code: &lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;{&lt;br /&gt;Class.forName("Driver name");&lt;br /&gt;Connection con = DriverManager.getConnenction("jdbcurl","username","password");&lt;br /&gt;//other manipulation using jdbc commands&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-6677418351775934034?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/6677418351775934034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=6677418351775934034' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6677418351775934034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6677418351775934034'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/06/list-of-jdbc-drivers.html' title='A List of JDBC Drivers'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-5937697816759956758</id><published>2009-05-07T08:56:00.000+05:30</published><updated>2009-05-07T08:58:02.537+05:30</updated><title type='text'>use full links for struts begineers</title><content type='html'>&lt;div&gt;not only struts... also has some usefull information abt xml, and others java api&lt;/div&gt;&lt;a href="http://www.allapplabs.com/struts/struts_internationalization.htm"&gt;http://www.allapplabs.com/struts/struts_internationalization.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-5937697816759956758?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/5937697816759956758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=5937697816759956758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5937697816759956758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5937697816759956758'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/05/use-full-links-for-struts-begineers.html' title='use full links for struts begineers'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-4947613489899352365</id><published>2009-04-16T07:38:00.002+05:30</published><updated>2009-04-16T07:42:28.200+05:30</updated><title type='text'>trouble shoot the fedora 9</title><content type='html'>if the fedora system got hanged , it mean, once the system got login, then after few min, it may got hang, if it hanged and it doesn't allow you to do any operation mean, &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;you have to reboot the system with by checking the kernal or root system files. to do that, &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;give the following command &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$ sudo touch forcefsck &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;or &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;$ sudo touch etc forcefsck&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then reboot you system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-4947613489899352365?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/4947613489899352365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=4947613489899352365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/4947613489899352365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/4947613489899352365'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/04/trouble-shoot-fedora-9.html' title='trouble shoot the fedora 9'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-8462702069756973169</id><published>2009-04-08T11:56:00.003+05:30</published><updated>2009-07-29T18:25:30.270+05:30</updated><title type='text'>java examples</title><content type='html'>use this link you will get samples for the concept you searching..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.exampledepot.com/egs/javax.swing.table/RemoveRow.html"&gt;http://www.exampledepot.com/egs/javax.swing.table/RemoveRow.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-8462702069756973169?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/8462702069756973169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=8462702069756973169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8462702069756973169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8462702069756973169'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/04/java-examples.html' title='java examples'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-2386163712919471138</id><published>2009-04-08T11:44:00.009+05:30</published><updated>2009-07-29T18:26:07.620+05:30</updated><title type='text'></title><content type='html'>if the table is create with DefaultTableModel, then the following code can be used. i have used and tested...&lt;br /&gt;&lt;br /&gt;&lt;textarea style="margin-top: 1px; margin-bottom: 1px; height: 157px; margin-left: 0px; margin-right: 0px; width: 385px; " rows="6" cols="35"&gt;  private void removeTable() {    if(reportModel.getRowCount()&lt;=0) {   ErrorResources.showError("NO Row available");         }   while (reportModel.getRowCount() &gt; 0) {      reportModel.removeRow(0); }    }&lt;/textarea&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-2386163712919471138?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/2386163712919471138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=2386163712919471138' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/2386163712919471138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/2386163712919471138'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/04/if-table-is-create-with.html' title=''/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-1885929317430264676</id><published>2009-03-30T09:15:00.003+05:30</published><updated>2009-03-30T09:31:23.765+05:30</updated><title type='text'>Struts Tutorial Page (Rose India)</title><content type='html'>&lt;div&gt;&lt;p style="margin:6.0pt"&gt;&lt;span style="mso-tab-count:1"&gt;          &lt;/span&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Difference between Model 1 and Model 2 architecture:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:6.0pt;line-height:normal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;;font-family:&amp;quot;;font-size:12.0pt;color:navy;"&gt;Features of MVC1:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;;font-family:&amp;quot;;font-size:12.0pt;color:navy;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l2 level1 lfo1;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;Html or jsp files are used to code the presentation. To      retrieve the data JavaBean can be used.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l2 level1 lfo1;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;In mvc1 archictecture all the view, control elements      are implemented using Servlets or Jsp.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l2 level1 lfo1;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;In MVC1 there is tight coupling between page and model      as data access is usually done using Custom tag or through java bean call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p class="MsoNormal" style="margin:6.0pt;line-height:normal"&gt;&lt;b&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;;font-family:&amp;quot;;font-size:12.0pt;color:navy;"&gt;Features of MVC2:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;;font-family:&amp;quot;;font-size:12.0pt;color:navy;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l1 level1 lfo2;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;The MVC2  architecture removes the page centric      property of MVC1 architecture by separating Presentation, control logic      and the application state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l1 level1 lfo2;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;In MVC2 architecture there is only one controller which      receives all the request for the application and is responsible for taking      appropriate action in response to each request.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p class="MsoNormal" style="margin:6.0pt;line-height:normal"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;;font-family:&amp;quot;;font-size:12.0pt;color:navy;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Struts framework provides three key components:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l0 level1 lfo3;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;A &lt;b&gt;request&lt;/b&gt; handler provided by the      application developer that is used to  mapped to a particular URI.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l0 level1 lfo3;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;A &lt;b&gt;response&lt;/b&gt; handler which is used to      transfer the control to another resource which will be responsible for      completing the response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;  &lt;li class="MsoNormal"  style="mso-margin-top-alt:auto;mso-margin-bottom-alt:      auto;line-height:normal;mso-list:l0 level1 lfo3;tab-stops:list .5incolor:navy;"&gt;&lt;span style="font-family:&amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-Times New Roman&amp;quot;font-family:&amp;quot;;font-size:12.0pt;"&gt;A &lt;b&gt;tag library&lt;/b&gt; which helps developers      to create the interactive form based applications with server &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;see the link given below, you will find the tutorial for the struts and it will help u to learn from the beginning&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://www.roseindia.net/struts/how-struts-works.shtml"&gt;http://www.roseindia.net/struts/how-struts-works.shtml&lt;/a&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-1885929317430264676?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/1885929317430264676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=1885929317430264676' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1885929317430264676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1885929317430264676'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/03/struts-tutorial-page-rose-india.html' title='Struts Tutorial Page (Rose India)'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-8871077216529988838</id><published>2009-02-17T11:26:00.013+05:30</published><updated>2009-04-08T11:44:10.296+05:30</updated><title type='text'></title><content type='html'>Connection pooling in JBOSS with MYSQL&lt;br /&gt;&lt;br /&gt;Step 1 : copy mysql-connector-java-5.0.7-bin.jar into jboss/server/default/lib or jboss/server/all/lib&lt;br /&gt;Step 2 : config the data sources with mysql-ds.xml and config the login-config.xml.&lt;br /&gt;Mysql-ds.xml&lt;br /&gt;&lt;textarea style="width: 308px; height: 115px;" rows="6" cols="35"&gt;&lt;datasources&gt;&lt;local-tx-datasource&gt;&lt;br /&gt;&lt;jndi-name&gt;TestSQL&lt;/JNDI-NAME&gt;&lt;br /&gt;&lt;connection-url&gt;jdbc:mysql://localhost:3306/frameworkdb&lt;/CONNECTION-URL&gt;&lt;br /&gt;&lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/DRIVER-CLASS&gt;&lt;br /&gt;&lt;user-name&gt;root&lt;/USER-NAME&gt;&lt;password&gt;password&lt;/password&gt;&lt;metadata&gt;&lt;type-mapping&gt;java/TestSQL&lt;/TYPE-MAPPING&gt;&lt;br /&gt;&lt;/metadata&gt;&lt;/LOCAL-TX-DATASOURCE&gt;&lt;/datasources&gt;&lt;/textarea&gt;&lt;br /&gt;Login-config.xml&lt;br /&gt;&lt;br /&gt;&lt;textarea style="width: 309px; height: 139px;" rows="7" cols="36"&gt;&lt;application-policy name="TestSQL"&gt;&lt;authentication&gt;&lt;login-module flag="required"&gt;&lt;module-option name="principal"&gt;root&lt;/MODULE-OPTION&gt;&lt;module-option name="userName"&gt;root&lt;/MODULE-OPTION&gt;&lt;module-option name="password"&gt;password&lt;/MODULE-OPTION&gt;&lt;module-option name="managedConnectionFactoryName"&gt;jboss.jca:service=LocalTxCM,name=TestSQL&lt;/MODULE-OPTION&gt;&lt;/LOGIN-MODULE&gt;&lt;/authentication&gt;&lt;/APPLICATION-POLICY&gt;&lt;/textarea&gt;&lt;br /&gt;Step 3: then create your connection pooling class in java&lt;br /&gt;&lt;textarea style="width: 313px; height: 193px;" rows="10" cols="36"&gt;public String dbConnection(String test) {String str = "";try {Context initContext = new InitialContext();DataSource ds = (DataSource) initContext.lookup("java:TestSQL");Connection con = ds.getConnection();Statement st = con.createStatement();ResultSet rs=st.executeQuery("Select * from authentication");while(rs.next()){str+= "--"+rs.getString(2);}catch (Exception e) {return e.getMessage();}return str;}&lt;/textarea&gt;&lt;br /&gt;Step 4 : create the remaining class and deploy it into jboss as war file, in jboss/server/default/deploy/ ______.war file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-8871077216529988838?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/8871077216529988838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=8871077216529988838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8871077216529988838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8871077216529988838'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/02/connection-pooling-in-jboss-with-mysql_17.html' title=''/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-9149361773755295780</id><published>2009-01-15T18:14:00.000+05:30</published><updated>2009-01-15T18:16:18.963+05:30</updated><title type='text'>JDK1.3 Documentation</title><content type='html'>this jdk document very useful for swt programs... becoz swt gadget is using the jdk version 3....&lt;br /&gt;&lt;br /&gt;http://java.sun.com/j2se/1.3/docs/api/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-9149361773755295780?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/9149361773755295780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=9149361773755295780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/9149361773755295780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/9149361773755295780'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/01/jdk13-documentation.html' title='JDK1.3 Documentation'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-5495873349803733308</id><published>2009-01-15T18:09:00.000+05:30</published><updated>2009-01-15T18:10:16.269+05:30</updated><title type='text'>Creating war file using Process and Runtime class........</title><content type='html'>import java.io.BufferedReader;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStreamReader;&lt;br /&gt;&lt;br /&gt;public class CreateWar {&lt;br /&gt;    &lt;br /&gt;    public static void main(String[]args) {&lt;br /&gt;        &lt;br /&gt;        String temp="c:/createbat.bat";// have command in batch file commands are cd:/ , c:/ , jar -cvf c:/test.war -C c:/lookup&lt;br /&gt;  // these lines are very important. jar-cvf is used to create the war file. &lt;br /&gt;        BufferedReader br = executeProgram(temp);&lt;br /&gt;&lt;br /&gt;        String line = new String();&lt;br /&gt;        try {&lt;br /&gt;            while ((line = br.readLine()) != null) {&lt;br /&gt;                System.out.println(line);&lt;br /&gt;            }&lt;br /&gt;        } catch (IOException e) {&lt;br /&gt;            &lt;br /&gt;            System.out.println("The Files are Failed");&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    private static BufferedReader executeProgram (String pgm)&lt;br /&gt;    {&lt;br /&gt;        System.out.println("pgm "+pgm);&lt;br /&gt;        // creating war file by using the runtime  and process class....&lt;br /&gt;        Runtime r = Runtime.getRuntime();&lt;br /&gt;        Process p = null;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;//            String[] envarray={"JAVA_HOME",System.getProperty("JAVA_HOME")};&lt;br /&gt;            p = r.exec(pgm);&lt;br /&gt;            &lt;br /&gt;            return (new BufferedReader(new InputStreamReader(p.getInputStream())));&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            System.out.println("The Files are Failed");&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;            return (null);&lt;br /&gt;        }&lt;br /&gt;     }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-5495873349803733308?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/5495873349803733308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=5495873349803733308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5495873349803733308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5495873349803733308'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/01/creating-war-file-using-process-and.html' title='Creating war file using Process and Runtime class........'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-2376616817429848832</id><published>2009-01-05T08:54:00.001+05:30</published><updated>2009-01-05T09:00:09.024+05:30</updated><title type='text'>jasper report tutorial</title><content type='html'>see this link for jasper report tutorial..... &lt;br /&gt;&lt;br /&gt;http://www.docstoc.com/docs/2139263/Jasper-Report-Tutorial&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.cise.ufl.edu/~otopsaka/CIS4301/ReportDemo/ReportFromJava.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-2376616817429848832?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/2376616817429848832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=2376616817429848832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/2376616817429848832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/2376616817429848832'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/01/jasper-report-tutorial.html' title='jasper report tutorial'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-9100177986047027305</id><published>2009-01-02T15:21:00.001+05:30</published><updated>2009-02-04T15:45:16.126+05:30</updated><title type='text'>animating progress bar--- creating according to the installation</title><content type='html'>the following code , which shows hot use the progressbar in the java swing... it uses the swing worker to animate its progress while installing or doing some updations....&lt;br /&gt;&lt;br /&gt;refer this link for further doubts...&lt;br /&gt;swingworker:http://java.sun.com/docs/books/tutorial/uiswing/concurrency/simple.html&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;this class progress is used to create to update the value by swing worker to the process method.&lt;br /&gt;this class type is mentioned in the swing worker it has two type of parameter, first shows the done method, and it should be overridden. the second parameter specifies the this call, and u should override the process method..&lt;br /&gt;*/&lt;br /&gt;private static class Progress {&lt;br /&gt;&lt;br /&gt;        private final double barValue;&lt;br /&gt;&lt;br /&gt;        Progress(double barValue) {&lt;br /&gt;            this.barValue = barValue;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private class processTask extends SwingWorker&lt;void,&gt; {&lt;br /&gt;&lt;br /&gt;        @Override&lt;br /&gt;        protected Void doInBackground() throws Exception {&lt;br /&gt;            progressBar.setIndeterminate(false);&lt;br /&gt;            double previousval = 0;&lt;br /&gt;            try {&lt;br /&gt;                completeStatus = false;&lt;br /&gt;                getClientComponents();&lt;br /&gt;                boolean status = false;&lt;br /&gt;                Set machineKey = machinesMap.keySet();&lt;br /&gt;                Iterator machineIterator = machineKey.iterator();&lt;br /&gt;                int noofMachine = machineKey.size();&lt;br /&gt;                double inc = 100 / (double) totalClients;&lt;br /&gt;                System.out.println("the inc value is_--------_____&gt;" + inc);&lt;br /&gt;                int count = 0;&lt;br /&gt;                while (machineIterator.hasNext()) {&lt;br /&gt;                    status = deployer.installClientComponent(machinesMap.get(machineIterator.next()));&lt;br /&gt;                    count++;&lt;br /&gt;                    double sum = 0;&lt;br /&gt;                    if (status) {&lt;br /&gt;                        progressval += inc;&lt;br /&gt;                        completeStatus = true;&lt;br /&gt;                        System.out.println("installed " + progressval);&lt;br /&gt;                        System.out.println("no of machine is " + count);&lt;br /&gt;                        while (previousval &lt; progressval) {&lt;br /&gt;&lt;br /&gt;                            Thread.sleep(1000);&lt;br /&gt;                            publish(new Progress(previousval++));&lt;br /&gt;                        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                    } else {&lt;br /&gt;                        progressval += inc;&lt;br /&gt;                    }&lt;br /&gt;                    previousval = progressval;&lt;br /&gt;                    Thread.sleep(2000);&lt;br /&gt;                }&lt;br /&gt;                if (completeStatus) {&lt;br /&gt;                    String str = "&lt;html&gt;" + "&lt;span style="color:\;"&gt;" + "&lt;b&gt;" + "Installation Process Copleted.........." + "&lt;/b&gt;" + "&lt;/span&gt;" + "&lt;/html&gt;";&lt;br /&gt;                    progressLabel.setText(str);&lt;br /&gt;                    next.setEnabled(true);&lt;br /&gt;                    installClientButton.setEnabled(false);&lt;br /&gt;                    stpInstallerToolView.finishInstallation(true);&lt;br /&gt;&lt;br /&gt;                } else {&lt;br /&gt;&lt;br /&gt;                    String str = "&lt;html&gt;" + "&lt;span style="color:\;"&gt;" + "&lt;b&gt;" + "Installation Process Failed......Please Select a Component for Install" + "&lt;/b&gt;" + "&lt;/span&gt;" + "&lt;/html&gt;";&lt;br /&gt;                    progressLabel.setText(str);&lt;br /&gt;                }&lt;br /&gt;            } catch (Exception e) {&lt;br /&gt;                System.out.println("error" + e.getMessage());&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            return null;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        @Override&lt;br /&gt;        protected void process(List&lt;progress&gt; val) {&lt;br /&gt;            super.process(val);&lt;br /&gt;            Progress pro = val.get(val.size() - 1);&lt;br /&gt;            progressBar.setValue((int) Math.round(pro.barValue));&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-9100177986047027305?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/9100177986047027305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=9100177986047027305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/9100177986047027305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/9100177986047027305'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2009/01/progress-bar-creating-according-to.html' title='animating progress bar--- creating according to the installation'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-8071909221773925628</id><published>2008-12-10T09:30:00.000+05:30</published><updated>2008-12-10T09:31:45.737+05:30</updated><title type='text'>fedora updations--</title><content type='html'>use the following link , which helps you to install or update the missing plugins in the linux....&lt;br /&gt;&lt;br /&gt;http://fedoraproject.org/wiki/YumUpgradeFaq&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-8071909221773925628?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/8071909221773925628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=8071909221773925628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8071909221773925628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/8071909221773925628'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/12/fedora-updations.html' title='fedora updations--'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-1376275385287016182</id><published>2008-12-10T07:26:00.000+05:30</published><updated>2008-12-10T07:27:58.963+05:30</updated><title type='text'>to stop the firewall in linux(fedora)</title><content type='html'>service iptables stop-------&gt; this is used to stop the firewall&lt;br /&gt;service iptables start-------&gt; this is used to start the firewall.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-1376275385287016182?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/1376275385287016182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=1376275385287016182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1376275385287016182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/1376275385287016182'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/12/to-stop-firewall-in-linuxfedora.html' title='to stop the firewall in linux(fedora)'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-5479553059224357415</id><published>2008-12-09T15:17:00.000+05:30</published><updated>2008-12-09T15:19:06.239+05:30</updated><title type='text'>java references</title><content type='html'>se the below link to get idea on the particular concept&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://www.cafeconleche.org/books/xmljava/chapters/ch10s03.html&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-5479553059224357415?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/5479553059224357415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=5479553059224357415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5479553059224357415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5479553059224357415'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/12/java-references.html' title='java references'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-7447714114945707306</id><published>2008-12-09T15:16:00.001+05:30</published><updated>2008-12-09T15:16:53.218+05:30</updated><title type='text'>mysqlCommands</title><content type='html'>&lt;div&gt;see this link for mysql basic commands.. which is used in the command prompt&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;http://www.pantz.org/software/mysql/mysqlcommands.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-7447714114945707306?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/7447714114945707306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=7447714114945707306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/7447714114945707306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/7447714114945707306'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/12/mysqlcommands.html' title='mysqlCommands'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-4845902496260139590</id><published>2008-10-13T15:23:00.000+05:30</published><updated>2008-10-13T15:26:35.596+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='inconImage'/><title type='text'>icon image in JDialog</title><content type='html'>this one line code is enough to load ur image and it displays at title bar of ur dialog.... it will changes the default coffee image in the dialog and place your own images there.....&lt;br /&gt;&lt;br /&gt;dialogObj.setIconImage(new ImageIcon(getClass().getResource("/baby.gif")).getImage());&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-4845902496260139590?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/4845902496260139590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=4845902496260139590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/4845902496260139590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/4845902496260139590'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/10/add-images-at-jdialog.html' title='icon image in JDialog'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-892545936296893011</id><published>2008-09-21T07:56:00.001+05:30</published><updated>2010-12-05T18:22:16.269+05:30</updated><title type='text'>ping CDC device in to Machine(our desktop or notebook)</title><content type='html'>step 1: config the device into system and vice versa&lt;div&gt;this configuration in linux machine&lt;/div&gt;&lt;div&gt;1. ifconfig usb0 ip1 netmask maskid (this at linux machine) - machine -1&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;eg:- ifconfig 10.100.100.101 usb0 netmask 255.255.255.0&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. ifconfig usb0 ip2 netmask maskid (this is at device machine) - machine 2&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;eg:- ifconfig 10.100.100.102 usb0 netmask 255.255.255.0&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Call webservice &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;private DataGenerator() throws Exception {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;ResourceBundle bundle = ResourceBundle.getBundle("configuration");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;URL url = new URL(bundle.getString("Delegator_Service_WSDL"));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;soapHandler = new SOAPMessageHandler(url);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * Constructor for SOAPMessageHandler. It takes the endpoint URL as a&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * parameter.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param endPoint -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            The service endpoint URL.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public SOAPMessageHandler(URL endPoint) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;this.endPoint = endPoint;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;StringBuffer sb = new StringBuffer("&lt;?xml version=\"1.0\" ?&gt;")&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;.append(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;"&lt;soapenv:envelope soapenv="\" xsd="\" ns1="\"&gt;")&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;.append("&lt;soapenv:body&gt;");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;soapEnvBegin = sb.toString();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;soapEnvEnd = "&lt;/soapenv:Body&gt;" + "&lt;/soapenv:Envelope&gt;";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * This method writes the XML section to call the authenticate method on&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * Delegator&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param username -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            The username to access Delegator.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param password -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            The password to access Delegator.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @return 0 if the username/password is invalid else will return the&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *         non-zero userid.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @throws DelegatorServiceException&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public String authenticate(String username, String password)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;throws DelegatorServiceException {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;String requestSOAPMessage = new StringBuffer(soapEnvBegin).append(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;"&lt;ns1:authenticate&gt;&lt;username&gt;").append(username).append(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;"&lt;/username&gt;&lt;password&gt;").append(password).append(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;"&lt;/password&gt;&lt;/ns1:authenticate&gt;").append(soapEnvEnd).toString();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;String result = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;result = callService(requestSOAPMessage, "");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;result = getBodyData(result);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;if (result != null) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;if (!result.startsWith("&lt;?xml version=\"1.0\" ?&gt;")) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;result = getBodyData(result);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;} else {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;GetResultSet getResult = new GetResultSet();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;result = getResult.getErrorCode(result);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;result = getCode(result);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} catch (Exception e) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;throw new DelegatorServiceException(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;Constants.APPLICATION_OUT_OF_ORDER);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return result;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * This method takes the soap request envelope and the soap action to be&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * called &amp;amp; returns the response from server&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param soapPacket -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            SOAP request envelope.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @param soapAction -&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; *            SOAPACTION to be used.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @return SOAP response envelope.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; * @throws IOException&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;private String callService(String soapPacket, String soapAction)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;throws Exception {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;String result = "";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;HttpURLConnection connection = (HttpURLConnection) endPoint&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;.openConnection();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;connection.setRequestMethod("POST");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// connection.setRequestProperty("SOAPACTION", soapAction);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;connection.setRequestProperty(soapPacket, "SOAPACTION");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;connection&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;.setRequestProperty("Content-Type", "text/xml; charset=utf-8");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;connection.setDoOutput(true);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;connection.setDoInput(true);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;OutputStreamWriter writer = new OutputStreamWriter(connection&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;.getOutputStream());&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;writer.write(soapPacket);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;writer.flush();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;InputStream is = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;is = connection.getInputStream();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} catch (Exception e) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;is = connection.getErrorStream();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;} finally {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;BufferedReader reader = new BufferedReader(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;new InputStreamReader(is));&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;String str = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;StringBuffer str2;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;str2 = new StringBuffer("");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;while ((str = reader.readLine()) != null) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;str2.append(str);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;result = str2.toString();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;// System.out.println("*^*^*^*^*^*^*^*^*^*^*^*"+result);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;reader.close();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;writer.close();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;connection.disconnect();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;return result;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-892545936296893011?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/892545936296893011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=892545936296893011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/892545936296893011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/892545936296893011'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/09/ping-cdc-device-in-to-machineour.html' title='ping CDC device in to Machine(our desktop or notebook)'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-6254202375263517387</id><published>2008-09-21T07:40:00.000+05:30</published><updated>2008-09-21T07:49:12.447+05:30</updated><title type='text'>creating webservice using wsgen</title><content type='html'>create your interface and implement your interface with your webservice class &lt;div&gt;and create your class&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;then open command prompt and select ur class... &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. to create jaxws--- wsgen -cp yourpackage.implementationclass &lt;/div&gt;&lt;div&gt;eg. wsgen - cp com.test.ws.Sampleimpl &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;it will create artifacts then create service name and then create the client class&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. wsimport -p package.implementationclass wsdl&lt;/div&gt;&lt;div&gt;eg. wsimport -p com.test.ws.Sampleimpl http://localhost:8080/SampleWs/SampleWsService?wsdl&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-6254202375263517387?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/6254202375263517387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=6254202375263517387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6254202375263517387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/6254202375263517387'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/09/creating-webservice-using-wsgen.html' title='creating webservice using wsgen'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8059857681818615677.post-5814191047271021835</id><published>2008-09-10T15:09:00.000+05:30</published><updated>2008-09-10T15:14:48.665+05:30</updated><title type='text'>SWT Sample</title><content type='html'>this sample code has some controls which has used in Devices,&lt;br /&gt;&lt;br /&gt;Swt controls are Text, Label,combobox,Slider,Scale,GridLayout,GridData,Composite,Shell...&lt;br /&gt;&lt;br /&gt;package pack;&lt;br /&gt;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.custom.ScrolledComposite;&lt;br /&gt;import org.eclipse.swt.events.SelectionAdapter;&lt;br /&gt;import org.eclipse.swt.events.SelectionEvent;&lt;br /&gt;import org.eclipse.swt.graphics.Rectangle;&lt;br /&gt;import org.eclipse.swt.layout.FillLayout;&lt;br /&gt;import org.eclipse.swt.layout.GridData;&lt;br /&gt;import org.eclipse.swt.layout.GridLayout;&lt;br /&gt;import org.eclipse.swt.widgets.Button;&lt;br /&gt;import org.eclipse.swt.widgets.Combo;&lt;br /&gt;import org.eclipse.swt.widgets.Composite;&lt;br /&gt;import org.eclipse.swt.widgets.Display;&lt;br /&gt;import org.eclipse.swt.widgets.Group;&lt;br /&gt;import org.eclipse.swt.widgets.Label;&lt;br /&gt;import org.eclipse.swt.widgets.List;&lt;br /&gt;import org.eclipse.swt.widgets.MessageBox;&lt;br /&gt;import org.eclipse.swt.widgets.Scale;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.swt.widgets.Slider;&lt;br /&gt;import org.eclipse.swt.widgets.Text;&lt;br /&gt;&lt;br /&gt;public class SWTSampleTest1 {&lt;br /&gt;    static Shell shell;&lt;br /&gt;    static Text t1,t2,t3;&lt;br /&gt;    static Label l1,l2,lbltest;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        Display display = new Display();&lt;br /&gt;         shell= new Shell(display);&lt;br /&gt;        shell.setText("Testing...");&lt;br /&gt;        shell.setLayout(new FillLayout());&lt;br /&gt;        final Combo combobox;&lt;br /&gt;        final List list;&lt;br /&gt;        //ScrolledComposite scrollComposite=new ScrolledComposite(shell,SWT.NONE|SWT.H_SCROLL|SWT.V_SCROLL);&lt;br /&gt;        //Composite composite=new Composite(scrollComposite,SWT.NONE);&lt;br /&gt;        //scrollComposite.setContent(composite);&lt;br /&gt;       &lt;br /&gt;        ScrolledComposite scomp=new ScrolledComposite(shell,SWT.H_SCROLL|SWT.V_SCROLL|SWT.NONE);&lt;br /&gt;       &lt;br /&gt;        Composite composite=new Composite(scomp,SWT.NONE);&lt;br /&gt;        scomp.setContent(composite);&lt;br /&gt;        GridLayout gridlayout=new GridLayout();&lt;br /&gt;        gridlayout.numColumns=3;&lt;br /&gt;        composite.setLayout(gridlayout);&lt;br /&gt;       &lt;br /&gt;        l1=new Label(composite,SWT.NULL|SWT.BOLD);&lt;br /&gt;        l1.setText("Name  :");&lt;br /&gt;       &lt;br /&gt;         t1=new Text(composite,SWT.BORDER);&lt;br /&gt;        GridData griddata=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;        griddata.horizontalSpan=2;&lt;br /&gt;        //griddata.horizontalIndent=1;&lt;br /&gt;        t1.setLayoutData(griddata);&lt;br /&gt;       &lt;br /&gt;        l2=new Label(composite,SWT.NULL|SWT.BOLD);&lt;br /&gt;        l2.setText("MobileNo  :");&lt;br /&gt;       &lt;br /&gt;         t2=new Text(composite,SWT.BORDER);&lt;br /&gt;        GridData griddata1=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;        griddata1.horizontalSpan=2;&lt;br /&gt;        t2.setLayoutData(griddata1);&lt;br /&gt;       &lt;br /&gt;        lbltest=new Label(composite,SWT.NULL);&lt;br /&gt;        lbltest.setText("AGE   :");&lt;br /&gt;       &lt;br /&gt;        t3=new Text(composite,SWT.BORDER);&lt;br /&gt;        griddata1=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;        griddata1.horizontalSpan=2;&lt;br /&gt;        t3.setLayoutData(griddata1);&lt;br /&gt;       &lt;br /&gt;        final Button button=new Button(composite,SWT.NORMAL);&lt;br /&gt;        button.setText("Test");&lt;br /&gt;        GridData data1=new GridData(GridData.HORIZONTAL_ALIGN_CENTER);&lt;br /&gt;        data1.horizontalSpan=2;&lt;br /&gt;        button.setLayoutData(data1);&lt;br /&gt;        button.addSelectionListener(new SelectionAdapter(){&lt;br /&gt;           &lt;br /&gt;            public void widgetSelected(SelectionEvent e){&lt;br /&gt;                System.out.println("Test ok ");&lt;br /&gt;                MessageBox messageBox =&lt;br /&gt;                      new MessageBox(shell,SWT.OK|SWT.CLOSE|SWT.ICON_INFORMATION);&lt;br /&gt;                messageBox.setText("Information");&lt;br /&gt;                messageBox.setMessage("OK.... BYE...... Thank U!!!!");&lt;br /&gt;               &lt;br /&gt;                if(messageBox.open()==SWT.OK){&lt;br /&gt;                    String str="\n\t Name: "+t1.getText()+"\n\t Mobile no: "+t2.getText()+"\n\tAge: "+t3.getText();&lt;br /&gt;                    System.out.println(str);&lt;br /&gt;                    System.out.println("you came out of the shell. Thank U");&lt;br /&gt;                    System.exit(0);&lt;br /&gt;                }&lt;br /&gt;                //System.exit(0);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        final Slider slider =&lt;br /&gt;               new Slider(composite,SWT.HORIZONTAL);&lt;br /&gt;             slider.setMinimum(0);&lt;br /&gt;             slider.setMaximum(100);&lt;br /&gt;             slider.setIncrement(5);&lt;br /&gt;             slider.setPageIncrement(10);&lt;br /&gt;             slider.setSelection(25);&lt;br /&gt;             griddata=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;             griddata.horizontalSpan=2;&lt;br /&gt;             slider.setLayoutData(griddata);&lt;br /&gt;             slider.addSelectionListener(&lt;br /&gt;              new SelectionAdapter()&lt;br /&gt;              {&lt;br /&gt;                public void widgetSelected(SelectionEvent e)&lt;br /&gt;                {&lt;br /&gt;                  System.out.println("Slider Selection:"+&lt;br /&gt;                                      slider.getSelection());&lt;br /&gt;                }&lt;br /&gt;              }&lt;br /&gt;             );&lt;br /&gt;        //&lt;br /&gt;             final Scale scale =&lt;br /&gt;                   new Scale(composite,SWT.HORIZONTAL);&lt;br /&gt;             scale.setMinimum(0);&lt;br /&gt;             scale.setMaximum(100);&lt;br /&gt;             scale.setIncrement(5);&lt;br /&gt;             scale.setPageIncrement(5);&lt;br /&gt;             scale.setSelection(25);&lt;br /&gt;             griddata=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;             griddata.horizontalSpan=3;&lt;br /&gt;             scale.setLayoutData(griddata);&lt;br /&gt;             scale.addSelectionListener(&lt;br /&gt;                  new SelectionAdapter()&lt;br /&gt;                  {&lt;br /&gt;                    public void widgetSelected(SelectionEvent e)&lt;br /&gt;                    {&lt;br /&gt;                      System.out.println("Scale Selection:"+&lt;br /&gt;                              scale.getSelection());&lt;br /&gt;                    &lt;br /&gt;                    }&lt;br /&gt;                  }&lt;br /&gt;                 );&lt;br /&gt;        Group grp=new Group(composite,SWT.NONE);&lt;br /&gt;        grp.setText("test");&lt;br /&gt;        gridlayout=new GridLayout(3,false);&lt;br /&gt;        grp.setLayout(gridlayout);&lt;br /&gt;        data1=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;        data1.horizontalSpan=2;&lt;br /&gt;        grp.setLayoutData(data1);&lt;br /&gt;       &lt;br /&gt;        Label tl1=new Label(grp,SWT.NULL);&lt;br /&gt;        tl1.setText("Test Group");&lt;br /&gt;       &lt;br /&gt;        Text tt2=new Text(grp,SWT.BORDER);&lt;br /&gt;        data1=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;        data1.horizontalSpan=2;&lt;br /&gt;        tt2.setLayoutData(data1);&lt;br /&gt;       &lt;br /&gt;        combobox=new Combo(grp,SWT.BORDER);&lt;br /&gt;        combobox.add("First");&lt;br /&gt;        combobox.add("Second");&lt;br /&gt;        combobox.add("Third");&lt;br /&gt;        combobox.add("Fourth");&lt;br /&gt;       &lt;br /&gt;        combobox.addSelectionListener(new SelectionAdapter(){&lt;br /&gt;            public void widgetSelected(SelectionEvent e){&lt;br /&gt;//                combobox&lt;br /&gt;                String str=combobox.getText();&lt;br /&gt;                System.out.println("the selected value is"+str);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;       &lt;br /&gt;        list=new List(grp,SWT.BORDER|SWT.SINGLE|SWT.V_SCROLL);&lt;br /&gt;        String listItems[]={"1","2","3","4","5","6","7","8","9","10","11","12"};&lt;br /&gt;        list.setItems(listItems);&lt;br /&gt;       &lt;br /&gt;         griddata=new GridData(GridData.HORIZONTAL_ALIGN_FILL);&lt;br /&gt;         griddata.horizontalSpan=2;&lt;br /&gt;         int listHeight = list.getItemHeight() * 5;&lt;br /&gt;            Rectangle trimHeight = list.computeTrim(0, 0, 0, listHeight);&lt;br /&gt;            griddata.heightHint = trimHeight.height;&lt;br /&gt;         list.setLayoutData(griddata);&lt;br /&gt;        list.addSelectionListener(new SelectionAdapter(){&lt;br /&gt;            public void widgetSelected(SelectionEvent e){&lt;br /&gt;               &lt;br /&gt;                System.out.println("the selected item is"+list.getItem(list.getSelectionIndex()));&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;        composite.pack();&lt;br /&gt;        shell.setSize(200, 250);&lt;br /&gt;        shell.pack();&lt;br /&gt;        shell.open();&lt;br /&gt;&lt;br /&gt;        while (!shell.isDisposed()) {&lt;br /&gt;            if (!display.readAndDispatch())&lt;br /&gt;                display.sleep();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8059857681818615677-5814191047271021835?l=jsgeeks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jsgeeks.blogspot.com/feeds/5814191047271021835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8059857681818615677&amp;postID=5814191047271021835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5814191047271021835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8059857681818615677/posts/default/5814191047271021835'/><link rel='alternate' type='text/html' href='http://jsgeeks.blogspot.com/2008/09/swt-sample.html' title='SWT Sample'/><author><name>praveekan</name><uri>http://www.blogger.com/profile/16218036701450648707</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
