tag:blogger.com,1999:blog-86835918955758276482024-03-04T20:31:07.080-08:00Error!!!Providers of Problem with their Solution :)Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.comBlogger57125tag:blogger.com,1999:blog-8683591895575827648.post-25254147919118238422020-08-13T22:41:00.000-07:002020-08-13T22:41:53.244-07:00shortcut to uppercase and lowercase in Oracle SQL Developer<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Problem:</b> I need a shortcut to convert text or script in lowercase and uppercase in Oracle SQL Developer.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Solution:</b> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Go to SQL Developer -> Tools -> Preferences -> Shortcut Keys
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">On the above path, you will find your shortcut commands or you can define for converting text to uppercase or lowercase. Please see the screenshot below for the reference.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVlhGjG7Vi8FEf0VXtn4fWVXJCxx-zEp7BkwInfi_B0Tdw0ensfWrIkUN8I54tFoISPZ1A1SM9MOawNporcDvpbPKMRO_F-eK6tg65u3z52BiSshcw_8ppdXbGF4SE6OHSz8VlNke_/s1600/shortcut-keys-lowercase-uppercase-in-oracle-sql-developer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="498" data-original-width="733" height="434" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVlhGjG7Vi8FEf0VXtn4fWVXJCxx-zEp7BkwInfi_B0Tdw0ensfWrIkUN8I54tFoISPZ1A1SM9MOawNporcDvpbPKMRO_F-eK6tg65u3z52BiSshcw_8ppdXbGF4SE6OHSz8VlNke_/s640/shortcut-keys-lowercase-uppercase-in-oracle-sql-developer.PNG" width="640" /></a></div>
</div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-70958338634904872082020-08-10T22:24:00.000-07:002020-08-10T22:36:39.082-07:00Exclude specific files, folders, directories and sub-directories from validation in eclipse STS<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem:</b> When I build my maven project, I have one XML file in my project that starts validation but it remains under the validation process. So I want to exclude it from validation.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution:</b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Go to Eclipse/STS -> Window -> Preference -> Validation </span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHttWUnAvqC476LUYGVkCJoz6i7dO_RxzEx3gUM5T6waXFMSPqbjwmXuVskkFo2zPb1_A_3uSRrIXx84OzP4iywUAvs2lvEWSeIt-aS5b01ViT2COZi5oy5gf2NfA0L1aUnoD1t7eO/s1600/eclipse-validation-settings.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><img border="0" data-original-height="695" data-original-width="817" height="543" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHttWUnAvqC476LUYGVkCJoz6i7dO_RxzEx3gUM5T6waXFMSPqbjwmXuVskkFo2zPb1_A_3uSRrIXx84OzP4iywUAvs2lvEWSeIt-aS5b01ViT2COZi5oy5gf2NfA0L1aUnoD1t7eO/s640/eclipse-validation-settings.PNG" width="640" /></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Click on the red marked button to go to a particular setting. The below window will pop up.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Click on "Exclude Group" and then click "Add Rule..."</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjilyZlF8Kn4Kb4Bm20GW3urGyaYgkUVayalVtoz382FXs-Gha3TlB7EiYURL6Owt5SdmAgwiLsb9XhzXKSs_um2JREmlswgV2ESfyiDa44Y9TFUO6AuDSODxQEnpcjSWkc3tNhJGbG/s1600/validation-filters-for-xml-validator-sts-eclipse-ide.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><img border="0" data-original-height="472" data-original-width="597" height="504" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjilyZlF8Kn4Kb4Bm20GW3urGyaYgkUVayalVtoz382FXs-Gha3TlB7EiYURL6Owt5SdmAgwiLsb9XhzXKSs_um2JREmlswgV2ESfyiDa44Y9TFUO6AuDSODxQEnpcjSWkc3tNhJGbG/s640/validation-filters-for-xml-validator-sts-eclipse-ide.PNG" width="640" /></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">After click on "Add Rule..." below the window of "New Filter Rule Wizard" will pop up.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Select "Folder or file name" from the below options and then click on the Next button.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCYqq9GkevGt-q9eccyKRM2oIFHma_-bwNKlCYA1JTmcw5OHPVbtAW4LRr0ERpWAnYxB7u8ThQ2yoIGqCwmaRTU3JzNimMSCpriuayTckxLqmDvGXOHNapYJFsAiKIN0dhUrniPeXm/s1600/new-filter-rule-wizard-eclipse-STS-ide.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><img border="0" data-original-height="338" data-original-width="605" height="356" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCYqq9GkevGt-q9eccyKRM2oIFHma_-bwNKlCYA1JTmcw5OHPVbtAW4LRr0ERpWAnYxB7u8ThQ2yoIGqCwmaRTU3JzNimMSCpriuayTckxLqmDvGXOHNapYJFsAiKIN0dhUrniPeXm/s640/new-filter-rule-wizard-eclipse-STS-ide.PNG" width="640" /></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">After Click on Next below window will be shown. Browse folder or file you want to exclude and click Finish.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhESK73KyyXjyFYt6Z2Hxis0CeA4cdAAURl9Un-3CDWU83HI0B06jXMEx6bXzD4b5REqNrren0x_evuHukm1D4cn4RWlr0BGbIskLDk0ef-COhUxvPeEVGbMOwmMuIYAcmLigVYxt2n/s1600/new-filter-rule-wizard-browse-file-folder-eclipse-STS-ide.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><img border="0" data-original-height="335" data-original-width="607" height="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhESK73KyyXjyFYt6Z2Hxis0CeA4cdAAURl9Un-3CDWU83HI0B06jXMEx6bXzD4b5REqNrren0x_evuHukm1D4cn4RWlr0BGbIskLDk0ef-COhUxvPeEVGbMOwmMuIYAcmLigVYxt2n/s640/new-filter-rule-wizard-browse-file-folder-eclipse-STS-ide.PNG" width="640" /></span></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Apply the above changes. I hope this information will be helpful.</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-35521839182608900062020-07-07T23:40:00.000-07:002020-07-07T23:40:54.926-07:00[Solved] Not able to connect my Android Mobile HotSpot to Windows Laptop<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem:</b> Previously my OnePlus Smartphone was connecting to my Dell laptop using Mobile HotSpot. But after some time when I updated my mobile OS updates. My Hotspot was not displaying under the wireless network connections list. </span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgI7l5wBj4BIOatC0AMIJsaOU_3bsJItBU3TINNE-i-BqIP0tPcCmeswHUnQUt1gFyY-aDKqW-aONzeNVy4aUI3SLLh9v9_wTqq7dBfSxKW3C0XfCTgop1kpAnTqGCzO7qqWMcpX8/s1600/android-5-0-lollipop.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="424" data-original-width="471" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgI7l5wBj4BIOatC0AMIJsaOU_3bsJItBU3TINNE-i-BqIP0tPcCmeswHUnQUt1gFyY-aDKqW-aONzeNVy4aUI3SLLh9v9_wTqq7dBfSxKW3C0XfCTgop1kpAnTqGCzO7qqWMcpX8/s200/android-5-0-lollipop.jpg" width="200" /></a><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution:</b> I found that under Wi-Fi hotspot setting there was one property named <b>AP Band, </b>it has two options <b>2.4 GHz Band</b> and <b>5.0 GHz Band</b>. I was not able to connect over 5.0 GHz. so I changed it to 2.4 GHz and applied the changes. It started showing again in the wireless network connections list and I was able to connect it.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Hope it will help.</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-23595131559205095822020-06-24T09:09:00.000-07:002020-06-24T09:09:00.161-07:00Ctrl + Space not working for content assist in eclipse<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem:</b> I am writing Java code in Eclipse IDE but the suggestion pop up window for java methods is not showing. Which generally pops up on the click of ctrl+space.</span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfp9jgtn5G-ZTfl420TA5vQBFmbnU6nMDUVK8GNJPvQg21h8bG7kIsNfouiCRPRJH8hoMr2wZk4Y6eNLknsw1inZTa0CysQvOj-iHqK4krzfSoODH16VxkO8iHAxxmQ6DCRaQYZcAR/s1600/eclipse-error.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="188" data-original-width="800" height="46" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfp9jgtn5G-ZTfl420TA5vQBFmbnU6nMDUVK8GNJPvQg21h8bG7kIsNfouiCRPRJH8hoMr2wZk4Y6eNLknsw1inZTa0CysQvOj-iHqK4krzfSoODH16VxkO8iHAxxmQ6DCRaQYZcAR/s200/eclipse-error.png" width="200" /></a><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution:</b> </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Follow the below steps:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Step 1:</b> Go to Windows -> Preferences -> Java -> Editor -> Content Assist -> Advanced -> select Java Proposals Checbox. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Step 2:</b> Click Apply -> OK </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Step 3:</b> If still not working then restart Eclipse IDE.
</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">(check screenshot for reference)</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgHMTmzN8UpdWptVuojFjlsnjU30AaznD4WBCTYE-zNQq7Q_zYfYiUxPdAIkTDKei8pb76drLBzw_gpeKUBOvpgi0iv25jCza9up6FhmpopXBGSOn3AZ0gyWnq2Ia0raedIaFWHYaH/s1600/Ctrl_Space_not_working_for_content_assist_in_eclipse.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="717" data-original-width="889" height="516" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgHMTmzN8UpdWptVuojFjlsnjU30AaznD4WBCTYE-zNQq7Q_zYfYiUxPdAIkTDKei8pb76drLBzw_gpeKUBOvpgi0iv25jCza9up6FhmpopXBGSOn3AZ0gyWnq2Ia0raedIaFWHYaH/s640/Ctrl_Space_not_working_for_content_assist_in_eclipse.PNG" width="640" /></a></div>
<br /></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-52559590954953326102020-06-22T11:07:00.001-07:002020-06-22T11:07:06.708-07:00[Solved] WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed.<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAZb5DHOt9G0IxS2XeiQKdMWN3a1QeZA0g_cdx3gHcl60gIXE4PVfxTaubMIrbgm45EdGGR7WX2U8Hk0VA8niAdHqnuqeTqQzVRYRmjYN9c2MrRQUXpdzLzBJz4qhX2LB0UcLOk4kb/s1600/Cannot-find-firefox-binary-in-PATH.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="99" data-original-width="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAZb5DHOt9G0IxS2XeiQKdMWN3a1QeZA0g_cdx3gHcl60gIXE4PVfxTaubMIrbgm45EdGGR7WX2U8Hk0VA8niAdHqnuqeTqQzVRYRmjYN9c2MrRQUXpdzLzBJz4qhX2LB0UcLOk4kb/s1600/Cannot-find-firefox-binary-in-PATH.jpg" /></a><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem: </b>During Selenium Automation testing, I tried to run my code script on the Mozilla Firefox browser and my code was not able to find the path of installed software/browser.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution: </b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">I used the below code snippet to set the path.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");
</span></b></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-48649146909224086472020-06-22T10:49:00.001-07:002020-06-22T10:49:55.161-07:00Kill process using shortcut in command prompt in windows OS<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSjfIckmy_AxJfAsITPIlZ3fr-LBEqaNWVMxAZXgTJOvL9cL2BT0xWSq3nhzRcU00j5U5iUtnsuAwgQ9xxns2cm6LenBrYI8sQuofofZrhzlavls_l-733uA1p_cLLz9HwmzaNVTkk/s1600/command-prompt.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="137" data-original-width="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSjfIckmy_AxJfAsITPIlZ3fr-LBEqaNWVMxAZXgTJOvL9cL2BT0xWSq3nhzRcU00j5U5iUtnsuAwgQ9xxns2cm6LenBrYI8sQuofofZrhzlavls_l-733uA1p_cLLz9HwmzaNVTkk/s1600/command-prompt.jpg" /></a><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem: </b>When we get a message that port 8080 already in use then it becomes very difficult to use the same port for different processes.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution: </b>Just run the below commands in command prompt and whoop! magic happens. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Follow the screenshot for the reference.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Sample commands:</span><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">netstat -ano | findstr :8080 (replace 8080 with your port)</span></b><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">taskkill /F /PID 11237 (replace 11237 with your pid)</span></b><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span></b>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">A sample screenshot is for port 8088</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-KxMDyqq_yMgLAMShfOMf8BxdUHxFmL_tLyh4zfkXWvWMo3TWytcfdw7OMNOkp8xUlJ13U30MZSZ8M8qUX1AMnsQz9ahGJJbgDp4BEUpY6wkiRYPYmbxAhX2OngGoYW_Od9nWa4ME/s1600/kill_process_8080_on_windows_os.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="154" data-original-width="634" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-KxMDyqq_yMgLAMShfOMf8BxdUHxFmL_tLyh4zfkXWvWMo3TWytcfdw7OMNOkp8xUlJ13U30MZSZ8M8qUX1AMnsQz9ahGJJbgDp4BEUpY6wkiRYPYmbxAhX2OngGoYW_Od9nWa4ME/s1600/kill_process_8080_on_windows_os.PNG" /></a></div>
</div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-63936942801019507512020-06-22T10:17:00.000-07:002020-06-22T10:19:48.509-07:00Run .sql file in Oracle SQL developer<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIda2Bh-abkYQJAXSwBAyF0ZVhITnqeB3PEbYCvMqhStKEF_ck-HTRPqKCYJBG9-pjHSB9hPj4IghPeJsz-qgwVkWNCwPm8AQyItyg8T9SAEZ8aN0NdZykZTspRJdD1Y_Q4tfAUkCy/s1600/sql_developer_logo.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="114" data-original-width="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIda2Bh-abkYQJAXSwBAyF0ZVhITnqeB3PEbYCvMqhStKEF_ck-HTRPqKCYJBG9-pjHSB9hPj4IghPeJsz-qgwVkWNCwPm8AQyItyg8T9SAEZ8aN0NdZykZTspRJdD1Y_Q4tfAUkCy/s1600/sql_developer_logo.jpg" /></a><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem:</b> Some times we have to execute insert queries of a table that we exported in .sql file. For multiple .sql files having huge data, it's not easy to execute those queries using copy and paste in SQL Developer tools.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution:</b> To execute .sql file you just need to write the path of your .sql file after @ and then file name with extension with delimiter ';' in the end. Select the complete command and press yellow highlighted green triangular button to execute sql script command. Just follow the below image for the reference.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Sample command:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>@F:\myData.sql</b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoiqCvwhwk3U6PMxcE-qgwyGacbN2NUEbu93QiDKoZhoAw0GDdFreT_AaFfwH7HDhEtinV0tG58qYKNsgfLqTjoVkFZnu9iTYXm-Dn_LFW0ZD5O9zU_YmoakKHfNUqy88kAcTvx6xU/s1600/sql_file_execute_on_oracle_sql_developer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="93" data-original-width="263" height="141" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoiqCvwhwk3U6PMxcE-qgwyGacbN2NUEbu93QiDKoZhoAw0GDdFreT_AaFfwH7HDhEtinV0tG58qYKNsgfLqTjoVkFZnu9iTYXm-Dn_LFW0ZD5O9zU_YmoakKHfNUqy88kAcTvx6xU/s400/sql_file_execute_on_oracle_sql_developer.PNG" width="400" /></a></div>
</div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-85874389081236756612019-11-30T11:17:00.001-08:002019-11-30T11:17:22.746-08:00Search text in a file using grep command on a PuTTY terminal<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSuAm9yak8NnBXOkE8cCpJ8wHF8QtXwWko6-tT_0tpUntJg9Z_G4PoqYFX-DY5E8gDGtfo0hqBM6pY_qnSY07Q6CMxEOHdS5jXS838ldx7-nOWYejv0VO8tKXaUMODdM_ptumf9Lsz/s1600/putty_software.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="192" data-original-width="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSuAm9yak8NnBXOkE8cCpJ8wHF8QtXwWko6-tT_0tpUntJg9Z_G4PoqYFX-DY5E8gDGtfo0hqBM6pY_qnSY07Q6CMxEOHdS5jXS838ldx7-nOWYejv0VO8tKXaUMODdM_ptumf9Lsz/s1600/putty_software.png" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">$ grep "somestring" filename.log</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">grep 'word' filename</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">grep 'word' file1 file2 file3</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">grep 'string1 string2' filename</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">cat otherfile | grep 'something'</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">command | grep 'something'</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">grep --color 'data' fileName</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-52386487101466966772019-08-11T13:54:00.000-07:002019-08-11T13:54:35.962-07:00FormData.delete() and FormData.set() do not support Internet Explorer<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJxO0Wmf_uYNIP-3EyJeJ2__L2UTefUPB3O77OkoEH4-7Nrg8mvntDP9rxMT01GFoP8SdRgJGbgb2lEHXWcEdkNQLzjJ50lTk0UWto3Dcy2qeKJj8avgsqBsdvQg3ck5SIJCz_5rXQ/s1600/internet_explorer_ie.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><img border="0" data-original-height="100" data-original-width="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJxO0Wmf_uYNIP-3EyJeJ2__L2UTefUPB3O77OkoEH4-7Nrg8mvntDP9rxMT01GFoP8SdRgJGbgb2lEHXWcEdkNQLzjJ50lTk0UWto3Dcy2qeKJj8avgsqBsdvQg3ck5SIJCz_5rXQ/s1600/internet_explorer_ie.png" /></span></a></div>
<b style="font-family: Arial, Helvetica, sans-serif; font-size: x-large;"><u>Problem:</u></b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"> A</span><span style="font-family: arial, helvetica, sans-serif; font-size: large;">ll methods of FormData do not </span><span style="font-family: arial, helvetica, sans-serif; font-size: large;">work/compatible with </span><span style="font-family: arial, helvetica, sans-serif; font-size: large;">Internet Explorer</span><span style="font-family: arial, helvetica, sans-serif; font-size: large;">. The only method that is successful is 'append'. but suppose you want to override values of specific keys but in that scenarios 'set' and 'delete' methods will not work on Internet Explorer.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><u style="font-weight: bold;">Solution:</u> You may use below code that will work on IE.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">var form = $('form')[0];</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">var formData = new FormData();</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">var inputs = form.<a href="https://www.w3schools.com/jsref/met_document_getelementsbytagname.asp" target="_blank">getElementsByTagName</a>('input'); <b>//for input box</b></span><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">var inputsList = <a href="https://stackoverflow.com/questions/7056925/how-does-array-prototype-slice-call-work" target="_blank">Array.prototype.slice.call</a>(inputs);</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">inputsList.forEach(</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"> function (i) {</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"> if (i.name !== 'excludedName') {</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"> formData.append(i.name, i.value);</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"> }</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"> }</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">);</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">formData.append('excludedName', 'value you want to set');</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b><u>Note:</u> for 'select' and 'textarea' use: </b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>var selects = form.getElementsByTagName('select');</b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>var textareas = form.getElementsByTagName('textarea');</b></span><br />
<br /></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-8388243852836939322018-04-16T07:03:00.002-07:002019-08-11T13:19:10.214-07:00org.hibernate.AnnotationException: No identifier specified for entity<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6W0BPS7Ow16YfOSj4GfXZ6PROZ_EO1-fzvsmrhiuOcUNhfdC815U1Tbmq7xI6DydIQEncfFSSPkisEAycNTCw5Upei19TU6of5nqSJSXKTZRJTIfJnfkHuIQYQ5kkjtmi0FHG7XMs/s1600/org.hibernate.AnnotationException+No+identifier+specified+for+entity.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><img border="0" data-original-height="213" data-original-width="220" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6W0BPS7Ow16YfOSj4GfXZ6PROZ_EO1-fzvsmrhiuOcUNhfdC815U1Tbmq7xI6DydIQEncfFSSPkisEAycNTCw5Upei19TU6of5nqSJSXKTZRJTIfJnfkHuIQYQ5kkjtmi0FHG7XMs/s200/org.hibernate.AnnotationException+No+identifier+specified+for+entity.png" width="200" /></span></a><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">When I was working with hibernate project. I got this exception. Actually, the issue was because of missing @Id from one of my entity class. @Id is used on the primary key field in the entity class. The field is a primary key in your database table.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">If you do not have any primary key in your database table then you can use rowId as the primary key for your entity class.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">@Id</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">@Column(name = "ROWID", insertable = false, updatable = false)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">private String rowId;</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-54115536333204320962018-02-04T10:23:00.000-08:002018-02-04T10:23:11.752-08:00error: possible loss of precision using Math.pow in java<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Problem : I compiled below code and got possible loss of precision error.</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>int a = Math.pow(3, 5);</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>System.out.println(a);</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Solution :</b> According to the <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#pow%28double,%20double%29" target="_blank">java documentation</a>, Math.pow() expects two doubles, and returns a double. When you pass two int values to this method, it converts an int to double. But when we assign the value to an int, it gives, possible loss of precision error while compiling the code. So you can cast method to an int or assign the returning value to double to resolve the error.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">int a = (int)Math.pow (3,5);</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">or</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">double a = Math.pow (3,5);</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-42087149522975431612017-07-31T09:15:00.001-07:002017-07-31T09:16:08.758-07:00Set or change default editor for JSP in Eclipse IDE<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Problem : I want to set JSP Editor as a default editor in Eclipse IDE.</span></b><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Solution :</b> Follow below steps to change default editor to open JSP files in Eclipse IDE.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Step 1 :</b> Start Eclipse IDE, click on Window then Preferences.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD1s8KAMOoLtoFSjumbdN9I4snOks-TRP93fGzXTZ2-Ac_naXWTpHRTTDsMtRDMDVWpvZ-81G4M2u8HG72l3T96jKPwgtoKfxkSgly324HY80Qk5qZH6n55Y_x6mioCgFa975PyRfK/s1600/preferences-eclipse-ide-luna-kepler.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><img border="0" data-original-height="371" data-original-width="350" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD1s8KAMOoLtoFSjumbdN9I4snOks-TRP93fGzXTZ2-Ac_naXWTpHRTTDsMtRDMDVWpvZ-81G4M2u8HG72l3T96jKPwgtoKfxkSgly324HY80Qk5qZH6n55Y_x6mioCgFa975PyRfK/s320/preferences-eclipse-ide-luna-kepler.png" width="301" /></span></a></div>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Step 2:</b> In the pop-up window, click on "File Associations" inside "Editors" then click on *.jsp in "File types".</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Step 3:</b> After that you can see "Associated editors" as shown in below screenshot. Just select JSP Editor and click on Default button and OK button.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ZxzkLGSXMEOE9TiX8xPzwusACO86n5ut8SfyDmSIBUxmmabQjVoO9-P0DChvsAlFIXtEjE9IBEc47Q1cMCooEny_uveis3ign_BrnIN7Kre-N9ogyyYpdKL7IaWOJ1mpPO3n-eM1/s1600/change-editor-for-jsp-eclipse-ide.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><img border="0" data-original-height="728" data-original-width="714" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ZxzkLGSXMEOE9TiX8xPzwusACO86n5ut8SfyDmSIBUxmmabQjVoO9-P0DChvsAlFIXtEjE9IBEc47Q1cMCooEny_uveis3ign_BrnIN7Kre-N9ogyyYpdKL7IaWOJ1mpPO3n-eM1/s640/change-editor-for-jsp-eclipse-ide.png" width="627" /></span></a></div>
<br /></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-32898822653374200492017-07-29T05:23:00.001-07:002017-07-29T05:26:28.562-07:00Error : Unable to acquire the state change lock for the module<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Problem :</b> Getting following error when starting eclipse IDE.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><br /></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZJohC9486FHCmZF8o41KYv5r_34EXfU8TDIkPohbWn3ztx1Ts-qcm0e4eGWjF1C-M7p3ZZSaQzTORBmL3801_ff_94VpOxeefHkaGQJix6as00Zq8QdqOBJ6OeMQ7mGZWnx0Mz1v0/s1600/Eclipse-luna-+Unable+to+acquire+the+state+change+lock+for+the+module.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="241" data-original-width="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZJohC9486FHCmZF8o41KYv5r_34EXfU8TDIkPohbWn3ztx1Ts-qcm0e4eGWjF1C-M7p3ZZSaQzTORBmL3801_ff_94VpOxeefHkaGQJix6as00Zq8QdqOBJ6OeMQ7mGZWnx0Mz1v0/s1600/Eclipse-luna-+Unable+to+acquire+the+state+change+lock+for+the+module.png" /></a><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity="org.eclipse.core.runtime"; type="osgi.bundle"; version:Version="3.10.0.v20140318-2214"; singleton:="true" [id=83] STARTED [STARTED]</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.Module.lockStateChange(Module.java:329)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.Module.start(Module.java:389)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b><br /></b></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Solution :</b> Go to your eclipse IDE directory. Delete the lock files whose names starting with .fileTable from following location:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">configuration/org.eclipse.osgi/.manager
</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;">Now restart the eclipse without rebooting the system.</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-4122741111769670072017-07-29T04:55:00.001-07:002017-07-29T04:55:44.160-07:00Error: not able to start eclipse IDE<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Problem :</b> I was starting eclipse and it said an error has occurred, see ...\workspace\.metadata\.log.</span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlts-kz2rUUBg8orZHdqmPz4wxRC-MqllwgpgFRGMN0aBXQw0gfPK9mbzkhGmbmBT-jTE2fszH_bD8qv5w_Oyht4eI7Kx5EGB7UXQZZ_5RCfvuGjDFMYmJ1Hb8Q9KsnJILfHbSKwGp/s1600/eclipse-error.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="188" data-original-width="800" height="75" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlts-kz2rUUBg8orZHdqmPz4wxRC-MqllwgpgFRGMN0aBXQw0gfPK9mbzkhGmbmBT-jTE2fszH_bD8qv5w_Oyht4eI7Kx5EGB7UXQZZ_5RCfvuGjDFMYmJ1Hb8Q9KsnJILfHbSKwGp/s320/eclipse-error.png" width="320" /></a><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">I opened the log file which had following error log.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.container.Module.doStart(Module.java:571)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.container.Module.start(Module.java:439)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Solution :</b> Delete the snap file from this location .metadata/.plugins/org.eclipse.core.resources/.snap in your eclipse workspace.</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-73671998583388153172017-05-24T10:38:00.003-07:002017-05-24T10:39:29.833-07:00Oracle Database : System error 5 has occurred. Access is denied<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Problem :</b> I have installed Oracle 10g XE on Windows 8. When I try to start using the "Start Database" button, the command window pops up with the error : </span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">C:\oraclexe\app\oracle\product\10.2.0\server\BIN>net start OracleXETNSListener</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">System error 5 has occurred.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Access is denied.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqXsuFF046s5uD5BpjAmMC-d4pYQZ8ZETLwuuBtvZh-XfHV6njVFVAckVDckTpDX9rvK4M9Aps2n5kKoNh3Q5wPEZ6lxu6sIZXwnTUI2-z2WmWF-dq6C8ikYGTL8bnYU7qeMI1UWI0/s1600/Oracle+Database+System+error+5+has+occurred.+Access+is+denied.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><img border="0" data-original-height="343" data-original-width="677" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqXsuFF046s5uD5BpjAmMC-d4pYQZ8ZETLwuuBtvZh-XfHV6njVFVAckVDckTpDX9rvK4M9Aps2n5kKoNh3Q5wPEZ6lxu6sIZXwnTUI2-z2WmWF-dq6C8ikYGTL8bnYU7qeMI1UWI0/s640/Oracle+Database+System+error+5+has+occurred.+Access+is+denied.png" width="640" /></span></a></div>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Solution :</b> Right click on Start Database icon and Run as Administrator.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgstFUDBfMrKogXQ0AkN1SAi-mH_EIgbXnSwtOB791Xy2z6w0Cpp9-I3E3Wj5xqNVXTkvxTlDWaJvXehSI2JZQKBghJ1jvY8icnMUvyeEz7KIV4aa9XW-iClo_GI9HqRNB4JuxGOqNz/s1600/Start+Database+icon+and+Run+as+Administrator.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><img border="0" data-original-height="405" data-original-width="763" height="338" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgstFUDBfMrKogXQ0AkN1SAi-mH_EIgbXnSwtOB791Xy2z6w0Cpp9-I3E3Wj5xqNVXTkvxTlDWaJvXehSI2JZQKBghJ1jvY8icnMUvyeEz7KIV4aa9XW-iClo_GI9HqRNB4JuxGOqNz/s640/Start+Database+icon+and+Run+as+Administrator.png" width="640" /></span></a></div>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ9M-IlyalF2ARR405iJrU9-KHCGwZgAMB0iIYgbfVrqshRXZGT7N2q1IY01MXW0yl1woRv0uW4Za7qn3VG7pWTWBcMqxC5AYpIcVKNfRoDevHdr3AKaCM3SmykNYmpHHqtG7aL7EG/s1600/oracleXETNSListener+service+started+successfully.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><img border="0" data-original-height="343" data-original-width="677" height="324" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ9M-IlyalF2ARR405iJrU9-KHCGwZgAMB0iIYgbfVrqshRXZGT7N2q1IY01MXW0yl1woRv0uW4Za7qn3VG7pWTWBcMqxC5AYpIcVKNfRoDevHdr3AKaCM3SmykNYmpHHqtG7aL7EG/s640/oracleXETNSListener+service+started+successfully.png" width="640" /></span></a></div>
<br /></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-26698568254482325222016-05-21T09:26:00.000-07:002016-05-21T09:31:02.820-07:00Bootstrap : Prevent or disable Modal pop up disappearing while outside click or pressing escape<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE_RU6H3pKz_GUL7ZPBrOxWHWH_GWfJ47dDFbOla1JeJPMkFQjQ77Sk9gRziJe07G__pPvWowZbQpmTpc0vSHj-nf9v9cCUEtYWJPmLxxcDcPC1zVgf5zEKAc1ixhaTmuQn6XVvP71/s1600/bootstrap.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE_RU6H3pKz_GUL7ZPBrOxWHWH_GWfJ47dDFbOla1JeJPMkFQjQ77Sk9gRziJe07G__pPvWowZbQpmTpc0vSHj-nf9v9cCUEtYWJPmLxxcDcPC1zVgf5zEKAc1ixhaTmuQn6XVvP71/s200/bootstrap.png" width="200" /></a><b>Problem :</b> I am working with Bootstrap Modal to display pop up window but whenever i click outside the modal or press escape button it goes disappear but i want to manually close it by clicking close button on modal pop up.</span></span><br />
<b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></b>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Solution : </b>To disable on click set <b><i>backdrop</i></b> option as <i><b>static</b></i> and to prevent closing of the modal by esc button set <i><b>keyboard</b></i> option as <i><b>false</b></i> as shown in below given code.</span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>1.</b> If you are using javascript for displaying Modal.</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">$('#myModal').modal({backdrop: 'static', keyboard: false})
</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>2.</b> If you are using data attributes on html or jsp.</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><button data-backdrop="static" data-keyboard="false" data-target="#myModal"
data-toggle="modal">
Click Here for Modal
</button>`
</span></span></pre>
</div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-15186206365246457042016-05-03T07:00:00.002-07:002016-05-03T07:24:44.446-07:00Flush DNS cache - solved server not found Error<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">If you know that your internet is working fine and still you are facing this error on visiting website's URL. Then below given solution can solve your problem.</span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Problem : </b></span></span><br />
<u><b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Server not found</span></span></b></u><br />
<b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Firefox can't find the server at www.blogger.com.
</span></span></b><br />
<ul style="text-align: left;">
<li><b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Check the address for typing errors such as ww.example.com instead of www.example.com
</span></span></b></li>
<li><b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">If you are unable to load any pages, check your computer's network connection.
</span></span></b></li>
<li><b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.</span></span></b></li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGIdQsQxxe7taznPGoEUMK3eEC8HVWMT-HpP53B1jfZNbMMCN9v45tO1NpwUvfOVO55ERlab8b9wu3ETVG2vzAtyKQEAnHSEoR-dyy1sXd1uB7ObR8ajWuCcv5KShSlo8Q7BnxiZ1R/s1600/server-not-found.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGIdQsQxxe7taznPGoEUMK3eEC8HVWMT-HpP53B1jfZNbMMCN9v45tO1NpwUvfOVO55ERlab8b9wu3ETVG2vzAtyKQEAnHSEoR-dyy1sXd1uB7ObR8ajWuCcv5KShSlo8Q7BnxiZ1R/s1600/server-not-found.png" /></a></span></span></div>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Solution :</b></span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Step 1:</b> Open Command prompt<b> </b>: Press <b>Window Key + R, </b>type <b>cmd</b> then click on <b>OK</b> button.</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9BPZFMesvGAzNPfYRLVigidEPn7YMdImQc8RD325qoLA2IcJzmZBO_mNi6uigO0RYHBrDYFxSia6s4ttGD5Z52hfZRPSn4jF6hoj0sAMVdd1Dpbz5F1Lo67TDHmVIGvtpgnaUhrmh/s1600/open-command-prompt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9BPZFMesvGAzNPfYRLVigidEPn7YMdImQc8RD325qoLA2IcJzmZBO_mNi6uigO0RYHBrDYFxSia6s4ttGD5Z52hfZRPSn4jF6hoj0sAMVdd1Dpbz5F1Lo67TDHmVIGvtpgnaUhrmh/s1600/open-command-prompt.png" /></a></span></span></div>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Step 2 : </b>Type <b>ipconfig /flushdns</b> and press Enter. A message will appear stating <b>Windows IP configuration Successfully flushed the DNS Resolver Cache.</b></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0LQDaPkxlBp_JADy8yij5wYIpbxipdqXEBDWagXfzKzWx6sV59aW-IwIamwex3DzjsMDEbSeavk7TwNHHq-k-qiI7TBOZwdRRsHNo1IQ1WqyyFsuhCvLM5F7PFUvodHD2PIJdSuoF/s1600/ipconfig-flush-dns-cmd.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0LQDaPkxlBp_JADy8yij5wYIpbxipdqXEBDWagXfzKzWx6sV59aW-IwIamwex3DzjsMDEbSeavk7TwNHHq-k-qiI7TBOZwdRRsHNo1IQ1WqyyFsuhCvLM5F7PFUvodHD2PIJdSuoF/s640/ipconfig-flush-dns-cmd.png" width="640" /></a></span></span></div>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Step 3 :</b> Type <b>exit</b> on command prompt to close command prompt.</span></span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-36606973717141665232016-04-23T12:51:00.003-07:002016-05-03T07:22:48.787-07:00Disable or enable input field using jQuery and JavaScript<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">JavaScript :</span></span></b><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">We can disable or enable an input box by setting property true or false respectively by using below code.</span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Code of input box</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Name: <input type="text" id="myName">
</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">To Disable input box.</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">document.getElementById("myName").disabled = true;</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">To Enable input box.</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">document.getElementById("myName").disabled = false;</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<b><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">jQuery :</span></span></b><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">If you are using jQuery 1.6+ then you should use the .prop() function to disable or enable input field.</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">$("input").prop('disabled', true);
$("input").prop('disabled', false);</span></span></pre>
<br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Above code will disable all the input fields, if you want to disable or enable particular field, then you should use class or id of that particular input field.</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Name: <input type="text" id="myName" class="myName"> </span></span></pre>
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">$("#myName").prop('disabled', true); // using id of input box</span></span></pre>
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">$(".myName").prop('disabled', false); // using class of input box</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">If you are using jQuery 1.5 or below then you should use the .attr() function.</span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">To disable input field:</span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">$("input").attr('disabled', 'disabled');</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">To enable input field: </span></span><br />
<pre class="prettyprint"><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">$("input").removeAttr('disabled');</span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">There is also .removeProp like .removeAttr in jQuery 1.6 but we should not use it because once you use removeProp you can not again disable it.</span></span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-77350837127265738602016-04-17T11:11:00.000-07:002016-05-03T07:27:01.279-07:00JavaEE : oracle.jdbc.OracleTypes for CallableStatement.registerOutParameter with SYS_REFCURSOR<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">This is a procedure which has one out parameter of SYS_REFCURSOR type.
</span></span><br />
<pre><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">PROCEDURE p_get_data(query_result OUT SYS_REFCURSOR);</span></span></pre>
<br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">In java for working out with this procedure you need to import ojdbc14.jar and need to set registerOutParameter type as OracleTypes.CURSOR
</span></span><br />
<pre><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">import oracle.jdbc.driver.OracleTypes;
CallableStatement callStmt = connection.prepareCall("{call p_get_data(?)}");
callStmt.registerOutParameter(1, OracleTypes.CURSOR);
callStmt.execute();
ResultSet resultSet = (ResultSet) callStmt.getObject(1);</span></span></pre>
<pre><span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">if(resultSet.next()) {
//Your Code here</span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">} </span></span></pre>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-44155935551909912852016-04-02T11:41:00.000-07:002016-05-03T07:11:39.259-07:00Oracle SQL Developer : Display both date and time<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">SQL Developer date and time column returns only date so if you want to see both date and time on SQL developer then you have to make just a small change in SQL Developer's Preferences.</span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></span>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Go to Tools >> Preferences</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRgumnkRXN4QRiP1wytkmgRqhLruaevr9m79U8reBaHaj9PUWsusr5tZGy7c6Sf9hrOt1nRyqeyDeBxds22vvkGq4eEmJpLOAPwIZBHUjsky5vZpVqPgR-d8tOby92MCuvphCVnCuA/s1600/oracle-sql-developer-preferences-for-date-time.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRgumnkRXN4QRiP1wytkmgRqhLruaevr9m79U8reBaHaj9PUWsusr5tZGy7c6Sf9hrOt1nRyqeyDeBxds22vvkGq4eEmJpLOAPwIZBHUjsky5vZpVqPgR-d8tOby92MCuvphCVnCuA/s320/oracle-sql-developer-preferences-for-date-time.png" width="320" /></a></span></span></div>
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Preferences >> Database >> NLS </span></span><br />
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;">set the Date Format as DD-MON-RR HH24:MI:SS</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: large;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4fM8Ehe8Pd-Ex_WsXEZcceMuqetVcxhuoGWoqnprvmr-yKzQJZWl9-1eGAIwPQKI2XOmsCIz6ZVgAouvhiuLCa5LcnC3e_rBznORsMR5eQpFARht5BDVHt8V7u06f7vmFkfqoMn5d/s1600/oracle-sql-developer-Database-nls-date-format.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="434" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4fM8Ehe8Pd-Ex_WsXEZcceMuqetVcxhuoGWoqnprvmr-yKzQJZWl9-1eGAIwPQKI2XOmsCIz6ZVgAouvhiuLCa5LcnC3e_rBznORsMR5eQpFARht5BDVHt8V7u06f7vmFkfqoMn5d/s640/oracle-sql-developer-Database-nls-date-format.png" width="640" /></a></span></span></div>
</div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-44714264979758047872016-03-28T09:33:00.003-07:002016-05-03T07:26:36.941-07:00Convert java.util.Date > java.sql.Date > java.sql.Timestamp > java.text.SimpleDateFormat<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="color: #cc0000;"><b>java.util.Date :</b></span> The class Date represents a specific instant in time, with millisecond precision.</span><br />
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Code :</span></b><br />
<pre class="prettyprint" style="background: rgb(240, 240, 240) none repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><code style="color: black; word-wrap: normal;"> java.util.Date dtUtil = new java.util.Date();
System.out.println(dtUtil);
</code></span></pre>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Output :</span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Mon Mar 28 21:35:05 IST 2016</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><span style="color: #cc0000;">java.sql.Date :</span> </b>A thin wrapper around a millisecond value that allows JDBC to identify this as an SQL DATE value. A milliseconds value represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="color: #cc0000;">long java.util.Date.getTime() :</span> </span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by Date object.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Code : Convert java.util.Date to java.sql.Date</span></b><br />
<pre class="prettyprint" style="background: rgb(240, 240, 240) none repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><code style="color: black; word-wrap: normal;"> java.sql.Date dtSql = new java.sql.Date(dtUtil.getTime());
System.out.println(dtSql);
</code></span></pre>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Output :</span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">2016-03-28</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><span style="color: #cc0000;">java.sql.Timestamp :</span> </b>A thin wrapper around java.util.Date that allows the JDBC API to identify this as an SQL TIMESTAMP value. It adds the ability to hold the SQL TIMESTAMP fractional seconds value, by allowing the specification of fractional seconds to a precision of nanoseconds.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Code :</span></b><br />
<pre class="prettyprint" style="background: rgb(240, 240, 240) none repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><code style="color: black; word-wrap: normal;"> java.sql.Timestamp dtTime = new java.sql.Timestamp(dtUtil.getTime());
System.out.println(dtTime);
</code></span></pre>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Output :</span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">2016-03-28 21:35:05.181</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="color: #cc0000;"><b>java.text.SimpleDateFormat :</b></span> SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows for formatting (date ? text), parsing (text ? date), and normalization. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Code :</span></b><br />
<pre class="prettyprint" style="background: rgb(240, 240, 240) none repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><code style="color: black; word-wrap: normal;"> SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
String dt = sdf.format(dtTime);
System.out.println(dt);
</code></span></pre>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Output :</span></b><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">28-03-2016 21:35:05</span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-26438413303829546652016-03-20T06:01:00.002-07:002016-05-03T07:22:10.394-07:00Jquery : Show label value on alert and browser console<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b><span style="font-family: "arial" , "helvetica" , sans-serif;">Here,</span> we are working with <span style="font-family: "arial" , "helvetica" , sans-serif;">label</span>, button and pop up message
box where we are showing <span style="font-family: "arial" , "helvetica" , sans-serif;">label</span> value in message box on same page on <span style="font-family: "arial" , "helvetica" , sans-serif;">submit</span> button click using jquery.</b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b><br /></b></span>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>index.jsp</b></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b><span style="font-family: "arial" , "helvetica" , sans-serif;">console.log d<span style="font-family: "arial" , "helvetica" , sans-serif;">isplays <span style="font-family: "arial" , "helvetica" , sans-serif;">value(s) on browser console (Press F12 on browser <span style="font-family: "arial" , "helvetica" , sans-serif;">then click on console tab to see<span style="font-family: "arial" , "helvetica" , sans-serif;"> </span>console.log output</span>) and alert on message box.</span></span></span> </b></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitGcnxFdp6wPSAzks88Je-F4tAT5sSYPnsYrkbPLRHsrAkcbf5q2lUgQA2gRKt933E1XDRgqThqeke74YUhYALSXoaBrrF2TOeBUF6OSeSb6gWNqt_5_k24aT8C04GhgAA9DNoUQBu/s1600/jquery-script-function-alert-console-log.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitGcnxFdp6wPSAzks88Je-F4tAT5sSYPnsYrkbPLRHsrAkcbf5q2lUgQA2gRKt933E1XDRgqThqeke74YUhYALSXoaBrrF2TOeBUF6OSeSb6gWNqt_5_k24aT8C04GhgAA9DNoUQBu/s1600/jquery-script-function-alert-console-log.png" /></a></div>
<br /><span style="font-family: Arial,Helvetica,sans-serif;"><b>Jquery Download Link : <a href="http://jquery.com/download/">http://jquery.com/download/</a></b></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><b> </b></span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "arial" , "helvetica" , sans-serif; font-size: large;"><b>Output:</b></span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgESGaYIw32jRib8XinAt4OFYoXPBwn_Q0ntPMUlvjWoPO01X5pCM8rYBSjlGarqeFg9GtC0UkD_zLZ9kHZOD8txv4JbYlCntap35v4wybZ3SSuC1c3mdfTI_s5wf9wxa0YyCp4Ff4z/s1600/jqyery-fetch-value-from-label.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgESGaYIw32jRib8XinAt4OFYoXPBwn_Q0ntPMUlvjWoPO01X5pCM8rYBSjlGarqeFg9GtC0UkD_zLZ9kHZOD8txv4JbYlCntap35v4wybZ3SSuC1c3mdfTI_s5wf9wxa0YyCp4Ff4z/s1600/jqyery-fetch-value-from-label.png" /></a></div>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Also Read : <a href="http://ourerrorcodes.blogspot.com/2013/11/how-to-show-textbox-value-on-message.html">How to show textbox value on message box with Jquery on button click</a></b></span></div>
</div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-54869584892271793582016-03-13T04:51:00.002-07:002016-05-03T07:24:44.452-07:00Charge your smartphone while your laptop lid is closed/off<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Many-times I have to charge my mobile with my laptop but i can not down my laptop's lid because of phone charging goes off. But Now i can charge my mobile even by closing my laptop lid with a small change in Device Manager Setting.</span><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b><span style="color: #cc0000;">Important :</span></b> This will only work when your laptop is charging (Not using Laptop Battery)</span><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Device Manager >> Universal Serial Bus Controllers >> Generic USB Hub >> Properties</span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNIHy9ZGawYZ-jyNP8Ft9m4HBcp85tVtLnzy8xl_ISQId5_hQIYsRTiu610bVi3DBUR88IreexHebBw07DUUOOY2CjZ-yhg5315rF5ogJhTfg0TmMSreuFOQIQj_aVWk_fdKjuOQri/s1600/windows-enable-usb-on-laptop-lid-off.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="451" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNIHy9ZGawYZ-jyNP8Ft9m4HBcp85tVtLnzy8xl_ISQId5_hQIYsRTiu610bVi3DBUR88IreexHebBw07DUUOOY2CjZ-yhg5315rF5ogJhTfg0TmMSreuFOQIQj_aVWk_fdKjuOQri/s640/windows-enable-usb-on-laptop-lid-off.png" width="640" /></a></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Power Management :</span></b><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Uncheck "Allow this computer to turn off this device to save power"</span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzfSOKoRlqc-NGSDC6WRyUZGSYpXbVOl65JVtUjR1QsO0ERqp0gTRYP5YXB8QpzTE9vCKBPbQ5nz4oqdBcTL8N42wUStMxPQYO41b-AmTstXxTk9EgicDXeT-MSqJTdsPOwM8hh8PL/s1600/power-management-allow-usb-power-supply-on-laptop-off-sleep.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzfSOKoRlqc-NGSDC6WRyUZGSYpXbVOl65JVtUjR1QsO0ERqp0gTRYP5YXB8QpzTE9vCKBPbQ5nz4oqdBcTL8N42wUStMxPQYO41b-AmTstXxTk9EgicDXeT-MSqJTdsPOwM8hh8PL/s640/power-management-allow-usb-power-supply-on-laptop-off-sleep.png" width="640" /></a></span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">If This solution is not working then go to your Laptop <b>BIOS</b> to Enable <b>"USB Wake Support"</b>.</span><br />
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">BIOS >> Advanced >> USB Wake Support</span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRyLEBj0TgJDtGQGawnAYMTmbRNovBpR8DpJz88lxX27adrbs-dCjzLsERAFNKfbRaV7Inss-GvlP9NqAe-jO2f9WcB-tR9RKSuHApir4ePjqjlszBmcmeTcj5HRcZ-rqA0ljRPF_r/s1600/enable-disable-usb-wake-support-dell-bios.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRyLEBj0TgJDtGQGawnAYMTmbRNovBpR8DpJz88lxX27adrbs-dCjzLsERAFNKfbRaV7Inss-GvlP9NqAe-jO2f9WcB-tR9RKSuHApir4ePjqjlszBmcmeTcj5HRcZ-rqA0ljRPF_r/s640/enable-disable-usb-wake-support-dell-bios.jpg" width="640" /></a></span></div>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"> Enable USB Wake Support and then exit with save. </span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQx64tZTgFq3jnKZTTQ4ABJdyxAFcoC75M5Wg8Oy5x9k_oObGBs_LVDSUjFu1VTFmRiv5QuIRiYCZn4PQpiiXyuUsqhPvP0X7tKwUkf6MZrVUs2fN05pF6AyEb_83VJOpO6bEKr9xM/s1600/usb-wake-support-bios-dell.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQx64tZTgFq3jnKZTTQ4ABJdyxAFcoC75M5Wg8Oy5x9k_oObGBs_LVDSUjFu1VTFmRiv5QuIRiYCZn4PQpiiXyuUsqhPvP0X7tKwUkf6MZrVUs2fN05pF6AyEb_83VJOpO6bEKr9xM/s640/usb-wake-support-bios-dell.jpg" width="640" /></a></span></div>
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Also Read : <a class="PXLWASD-F-i" href="http://ourerrorcodes.blogspot.com/2015/04/windows-8-add-or-remove-sleep-or-Hibernate-in-Power-Options-Menu-of-your-PC.html">Windows 8 : Add or Remove Sleep or Hibernate in Power Options Menu of your PC</a></span></b><br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Also Read : <a class="PXLWASD-F-i" href="http://ourerrorcodes.blogspot.com/2015/07/stop-or-disable-skype-auto-launching-in-windows-8-on-startup.html">Stop or disable skype Auto-launching in Windows 8 on startup</a></span></b> </div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-87627210829324719572016-03-13T00:54:00.000-08:002016-05-03T07:11:39.293-07:00SQL : Find 2nd or 3rd highest salary from employee table without ROWNUM or TOP<div dir="ltr" style="text-align: left;" trbidi="on">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><span style="font-family: Arial,Helvetica,sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUNiir4L4ULou8X7J8FM-XMam6-exsGKjAxOrIwczue14OMd9dj67oDEhghNL7BWo03cLP9xXPZ83WHGfptFMD8mqcULo4wP31eJJ-QC3lKEAgD01rS8GTIk71IVU38krc9G2snmVJ/s1600/employee+table+data.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUNiir4L4ULou8X7J8FM-XMam6-exsGKjAxOrIwczue14OMd9dj67oDEhghNL7BWo03cLP9xXPZ83WHGfptFMD8mqcULo4wP31eJJ-QC3lKEAgD01rS8GTIk71IVU38krc9G2snmVJ/s1600/employee+table+data.png" /></a></span></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><b>Employee Table</b></span></span></td></tr>
</tbody></table>
<span style="font-family: Arial,Helvetica,sans-serif;">SELECT SALARY FROM EMPLOYEE ORDER BY SALARY DESC;</span><br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;"><b>OUTPUT : </b> </span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">SALARY</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;">----------<br /> 77777<br /> 60000<br /> 34000<br /> 23232</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: #cc0000;"><b><span style="font-family: Arial,Helvetica,sans-serif;">Example to find the 2rd highest salary</span></b></span><span style="color: #cc0000;"><b><span style="font-family: Arial,Helvetica,sans-serif;"> </span></b></span></span><br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;">SELECT MAX(SALARY) FROM EMPLOYEE WHERE SALARY NOT IN (SELECT MAX(SALARY) FROM EMPLOYEE);<br /><b> </b></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><b>OUTPUT :</b><br />MAX(SALARY)<br />-----------<br /> 60000</span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><br /></span>
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: #cc0000;"><b><span style="font-family: Arial,Helvetica,sans-serif;">Example to find the 3rd highest salary</span></b></span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><b>After union query is omitting first highest salary. </b></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: #cc0000;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: black;">SELECT MAX(SALARY) FROM EMPLOYEE WHERE SALARY NOT IN (SELECT MAX(SALARY) FROM EMPLOYEE WHERE SALARY NOT IN (SELECT MAX(SALARY) FROM EMPLOYEE) <b>UNION</b> SELECT MAX(SALARY) FROM EMPLOYEE);<br /><span style="font-size: small;"><b> </b></span></span></span></span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: #cc0000;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: black;"><span style="font-size: small;"><b>OUTPUT :</b></span><br />MAX(SALARY)<br />-----------<br /> 34000</span></span></span></span><br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif;"><b><span style="color: #cc0000;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: black;">Also Read : </span></span></span></b><span style="color: #cc0000;"><b><span style="font-family: Arial,Helvetica,sans-serif;"><span style="color: black;"><a class="PXLWASD-F-i" href="http://ourerrorcodes.blogspot.com/2015/06/oracle-mysql-find-top-3rd-highest-salary-row-from-employee-table.html">Oracle and MySql : Find Top 3rd highest salary row from employee table</a></span></span><span style="font-family: Arial,Helvetica,sans-serif;"> </span></b></span></span></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0tag:blogger.com,1999:blog-8683591895575827648.post-793841188471450342015-12-08T09:51:00.001-08:002016-05-03T07:22:10.407-07:00Check for Float value on keypress using JQuery<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4kJX6jbx3qzP4OYPeXhYQRLWUilttjBeOC9_7Sv9Y8xKQaCG6fQBs5rCqdIvQ8ug5OnI_KUY6xVUwGCVvuk99hUiD8J-QR-jwKqE25pfqH8EoLAHxez_WJHRR9qSA8dZOOlVhCkIg/s1600/jquery-logo.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4kJX6jbx3qzP4OYPeXhYQRLWUilttjBeOC9_7Sv9Y8xKQaCG6fQBs5rCqdIvQ8ug5OnI_KUY6xVUwGCVvuk99hUiD8J-QR-jwKqE25pfqH8EoLAHxez_WJHRR9qSA8dZOOlVhCkIg/s1600/jquery-logo.png" /></a><span style="font-family: "arial" , "helvetica" , sans-serif;">Following is script by which you can put check for float value.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">html input field on which you want to put check for float value:
</span><br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhujtaayTkLYvMTMThT4PsOS9l3n3jvxRvOf4RGUtb4FMJoVARp1BtIDkgElKCqpVOGIqrRQLM4M6MgfbLgazQzj-HEWrs45JxUKUxbgiMzFN7q7DCbxjU6NCm0Xm8eqpvTaKRlaAemY_qk/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <input class="checkfloat" type="text">
</code></pre>
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Script for Float Value check:
</b></span><br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhujtaayTkLYvMTMThT4PsOS9l3n3jvxRvOf4RGUtb4FMJoVARp1BtIDkgElKCqpVOGIqrRQLM4M6MgfbLgazQzj-HEWrs45JxUKUxbgiMzFN7q7DCbxjU6NCm0Xm8eqpvTaKRlaAemY_qk/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> $(".checkfloat").on("keypress keyup",function (event) {
$(this).val($(this).val().replace(/[^0-9\.]/g,''));
if ((event.which != 46 || event.which == 8 || event.which == 9 || $(this).val().indexOf('.') != -1)
&& ((event.which < 48 || event.which > 57))) {
event.preventDefault();
}
});
</code></pre>
<br /></div>
Blog Adminhttp://www.blogger.com/profile/00826406596115760683noreply@blogger.com0