Posts

Database Performance Tuning MUST Read

Database Performance Tuning Query Run Time A database is also a software and is subject to the same limitations as all software, it can only process as much information as its hardware is capable of handling. The way to make a query run faster is to reduce the number of calculations that the software (and therefore hardware) must perform.  To do this, you will need some understanding of how SQL actually makes calculations.     Table size: If your query hits one or more tables with millions of rows or more, it could affect performance.     Joins: If your query joins two tables in a way that substantially increases the row count of the result set, your query is likely to be slow.     Aggregations: Combining multiple rows to produce a result requires more computation than simply retrieving those rows.     Other users running queries: This is something you probably can’t control. The more queries running concurrently on a dat...

Java 8 (1.8) New Features

Java 8 (1.8) New Features - Oracle released a new version of Java as Java 8 in March 18, 2014.   - Java Platform, Standard Edition 8 is a major feature release.   Java 8 Programming Language Enhancements Java 8 provides following features for Java Programming: Lambda expressions, Method references, Functional interfaces, Stream API, Default methods, Base64 Encode Decode, Static methods in interface, Optional class, Collectors class, ForEach() method, Parallel array sorting, Nashorn JavaScript Engine, Type and Repeating Annotations, IO Enhancements, Concurrency Enhancements, JDBC Enhancements etc. Without Lambda Expression interface  Drawable{        public   void  draw();   }   public   class  LambdaExpressionExample {        public   static   void  main(String[] args) {      ...

When to use NULL and when to use an empty string?

1) It depends on the domain you are working on. NULL means absence of value (i.e. there is no value ), while empty string means there is a string value of zero length. For example, say you have a table to store a person' data and it contains a Gender column. You can save the values as 'Male' or 'Female'. If the user is able to choose not to provide the gender data, you should save that as NULL (i.e. user did not provide the value) and not empty string (since there is no gender with value ''). 2)A null value means no memory is assigned to object only a reference is created in stack . So a null value is memory efficient . Also a null value will throw a null pointer exception if we by mistake use the reference , on the other hand if we initialize with an empty string we might not know about this error early. We can use empty string if required for the code else we should initialize string with null.

Ho to resolve the following issue "The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit" specifically in jsp

To resolve the issue you have to delete the extra code  and try manage using buffer directive in jsp

How to encode HTML in JAVA (Remove HTML from your text)

Here is the following code :- --------------------------------------------------------------------------  private String htmlEncode(final String string) {    String value="";    try{    byte ptext[] = string.getBytes("ISO-8859-1");     value = new String(ptext,"UTF-8");     value=value.replaceAll("\\p{C}", "?");    }catch(Exception e)    {    Util.AppendExceptionToLog(e);    }    return value;     } -------------------------------------------------------------------------- Thanks Pavan Dhokne 8888865193

How to resolve session timeout issue in JAVA

How to fixed Session timeout issue  :-     Pls follow the below details............................. SessionTimeOut.jsp --------------------------------- <%@page import="com.ecw.security.DataValidation"%> <%@page import="com.ecw.components.PerformanceHelper"%> <% String sessionValueinSeconds =  PerformanceHelper.checkItemkeyCache(null, "sessionTimeOut"); %> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <body> <script src="../../script/newui/js/jquery-1.10.2.min.js"></script> <script>     $(document).ready(function()            {     /* session Timeout code End Pavan */     var timer = null;     var secondsBeforeExpire='<%=DataValidation.escapeStringForJavaScript(sessionValueinSeconds)%>';     if(secondsBeforeExpire!="")     {     v...

JavaScript_Solution_21July2017

Hello Friends, While I start to work in javascript, I found the most important issue we are facing as follows.... --------------------------------------------------------------------------------------------------------------- ISSUE:- 1) var fromDate=document.getElementById("fromDate").value;       if(fromDate !== "undefined" && fromDate!=null)    etc....... ----------------------------------------------------------------------------------------------------------------- Solution:- 1) You have to sipmly check      if(fromDate); No need to write extra code  for that.... -------------------------------------------------------------------------------------------------------------------------- Thank you Pavan Dhokne