May 24, 2017

Oracle Database : System error 5 has occurred. Access is denied

Problem : 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 :
C:\oraclexe\app\oracle\product\10.2.0\server\BIN>net start OracleXETNSListener
System error 5 has occurred.
Access is denied.
Solution : Right click on Start Database icon and Run as Administrator.


May 21, 2016

Bootstrap : Prevent or disable Modal pop up disappearing while outside click or pressing escape

Problem : 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.

Solution : To disable on click set backdrop option as static and to prevent closing of the modal by esc button set keyboard option as false as shown in below given code.

1. If you are using javascript for displaying Modal.
$('#myModal').modal({backdrop: 'static', keyboard: false})  

2. If you are using data attributes on html or jsp.
<button data-backdrop="static" data-keyboard="false" data-target="#myModal" 
data-toggle="modal">  
Click Here for Modal  
</button>`  

May 3, 2016

Flush DNS cache - solved server not found Error

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.
Problem :
Server not found
Firefox can't find the server at www.blogger.com.
  • Check the address for typing errors such as ww.example.com instead of www.example.com
  • If you are unable to load any pages, check your computer's network connection.
  • If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
Solution :
Step 1: Open Command prompt : Press Window Key + R, type cmd then click on OK button.
Step 2 : Type ipconfig /flushdns and press Enter. A message will appear stating Windows IP configuration Successfully flushed the DNS Resolver Cache.
Step 3 : Type exit on command prompt to close command prompt.

April 23, 2016

Disable or enable input field using jQuery and JavaScript

JavaScript :
We can disable or enable an input box by setting property true or false respectively by using below code.
Code of input box
Name: <input type="text" id="myName">

To Disable input box.
document.getElementById("myName").disabled = true;

To Enable input box.
document.getElementById("myName").disabled = false;

jQuery :
If you are using jQuery 1.6+ then you should use the .prop() function to disable or enable input field.
$("input").prop('disabled', true);
$("input").prop('disabled', false);

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.
Name: <input type="text" id="myName" class="myName"> 
$("#myName").prop('disabled', true);  // using id of input box
$(".myName").prop('disabled', false); // using class of input box

If you are using jQuery 1.5 or below then you should use the .attr() function.
To disable input field:
$("input").attr('disabled', 'disabled');

To enable input field:
$("input").removeAttr('disabled');

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.

April 17, 2016

JavaEE : oracle.jdbc.OracleTypes for CallableStatement.registerOutParameter with SYS_REFCURSOR

This is a procedure which has one out parameter of SYS_REFCURSOR type.
PROCEDURE p_get_data(query_result OUT SYS_REFCURSOR);

In java for working out with this procedure you need to import ojdbc14.jar and need to set registerOutParameter type as OracleTypes.CURSOR
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);
if(resultSet.next()) {
//Your Code here
} 

April 2, 2016

Oracle SQL Developer : Display both date and time

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.

Go to Tools  >> Preferences
Preferences >> Database >> NLS 
set the Date Format as DD-MON-RR HH24:MI:SS

Disclaimer

We shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its response or damage to your system. We do not guarantee that the integrity or security of this communication has been maintained or that this communication is free of viruses, interceptions or interferences. Anyone communicating with us by email accepts the risks involved and their consequences. We accept no liability for any damage caused by any virus transmitted by this site.