Posts

Showing posts from June, 2019

Difference between Get and Post and PUT

1.Get is Very less in size probably 2kb. Post is large in size. 2. Get sends data in URL whereas post send data separately. 3. Get is used for Getting data and Put is used for sending something to server. Put is generally used to upload large files. It is very lease servlet method.

Servlet Request Dispatcher

Request Dispatcher The RequestDispatcher interface provides the facility of dispatching the request to another resource it may be html, servlet or jsp. public void forward(ServletRequest request,ServletResponse response)throws ServletException,java.io.IOException{ //Forwards request } public void include(ServletRequest request,ServletResponse response)throws ServletException,java.io.IOException{ //include Resource } How to create Request dispatcher and use it RequestDispatcher rd=request.getRequestDispatcher(myServlet); rd.forward(request,responce); A simple example of it could be on Place order button servlet validate request if its valid then send to order placed page else will send to error page or info missing page.

Manifest.MF File

Java archives (JAR, ejb-jar, client-jar, etc.) contain another file called a MANIFEST.MF that is stored in the META-INF directory along with the other descriptors. For a standard JAR file, the MANIFEST describes Java elements of a JAR file. For J2EE modules, a MANIFEST plays a critical role; it is the J2EE-compliant way to specify classpath information for a J2EE module. Each utility JAR, Web module, and EJB module can specify in their MANIFEST the other JARs in the same EAR that are visible to them. Any other JAR not listed in the MANIFEST of the WAR or the EJB-JAR is not visible to its classpath. Any ref ere nce to a class stored in a JAR within the EAR that is not listed in the MANIFEST will cause a ClassNotFoundException at runtime.

Escaping Underscore in Sql query

to escape underscore use / and escape / before underscore WHERE mycolumn LIKE '%\_%' ESCAPE ' \ '

Insert and Update in Same Query

Hi You can use this query for inserting records and if already present the following query will update it.

Big O Notation in Java #Calculating performance of Collection

Callable and Future Interfaces in Java

Error Updating Language table L_Maxattribute

To avoid this error you need to disable the trigger and run the query and then enable the query. Example alter trigger UPDATE_MAXATTRIBUTE disable; update l_maxattribute set title='dsaf' where langcode='ZH' and ownerid=234323; alter trigger UPDATE_MAXATTRIBUTE enable;

Replace word using update query

Often we require to replace a word using update query example Preventive Maintenance PM for testing here we want to replace PM with FV for that we can create query like UPDATE PM p    SET column = REPLACE (p. description , ' PM ' , 'FV' )

Hashcode in Java

Well Hashcode is a method of object class, we can say it is a bucket number for a particular object. Hashcode method return bucket number for the object. Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. Object class Hashcode method. public native int hashCode();

Java inner classes

Java collection

Java Multuthreading

Workflow best practices

Start center best practices

Here are list of best practices for start center:-

Roles of IBM Tririga

List of roles of ibm tririga APPLICATION ADMIN APPLICATION USER WORKPLACE EXECUTIVE Finance Executive Business unit manager Requestor 

Association in Tririga

Association are used to connect records in tririga Application Platform.

100 SQL Interview Questions

What is DBMS and RDBMS. What are constraints What is primary key. What is unique constraint. What is index, explain its different types.

Rdf Puller Command

You can run following command for RDF puller. ant -f anywhere-rdfs-puller.xml -Dadapter.connection.user=<user_name> -Dadapter.connection.password=<password>

Getting started with IBM Worklight

IBM Worklight IBM Worklight is a mobile application platform containing all of the tools needed to develop a mobile application. We develop mobile application here using hybrid way. Components of IBM Worklight 1.        Workligh Studio :- IBM Worklight provides a robust, Eclipse-based development environment called Worklight Studio. 2.        Worklight Server: This component is a runtime server that activates or enables secure data transmission through centralized backend connectivity with adapters. 3.        Worklight Device Runtime : The device runtime provides a rich set of APIs that are accessible across platforms and offer easy access to the services provided by the IBM Worklight Server. 4.        Worklight Console : Worklight Console is a web-based interface and is dedicated to ongoing administration of Worklight Server and its deployed apps, adapters, ...

Unable to view Gantt view in Schedule

This issue could be due to either java is not present in system or not installed. Install java JDK 1.7 on client machine where this issue is occurring and restart machine.

Reflection in java

Reflection Reflection is used to in java to obtain run-time information about class or method. With reflection we can find ·        Number of instance methods. ·        Number of static methods. ·        Determining modifiers of the class. etc. Inorder to use reflection we must import java.lang.reflect.* pacackage. class ReflectionTesting {  public static void main (String [] args)  {   String s=new String ("Hello Reflection"); printParentclass (s);  }  static void printParentclass (Object s)  {   Class c=s.getClass ();  Class sc=c.getSuperclass ();   System.out.println ("NAME OF this CLASS : "+c.getName ()); System.out.println ("NAME OF parent CLASS : "+sc.getName ());  } };

Security in tririga

What are levels of security you have in tririga? 1. Access to records. 2. Access to portion of records 3. Access to create, update and delete records. 4. Access to tools.

Spool command in oracle sql server

Spool is used to take script and its output in a file Example of spool SET sqlformat csv spool c:\spoolfile . csv SELECT * FROM workorder; spool off Example 2 SET SQLFORMAT SQL SPOOL 'C:\users\mysql.sql'; select * from asset; spool off You can use it also to create a insert script like select 'insert into Table values(Id=' + Id + ', name=' + name + ')' from Maxusers SET sqlformat csv spool c:\spoolfile . csv select 'insert into Table values(Id=' + Id + ', name=' + name + ')' from Maxusers; spool off Note : For running this you need to press F5 only because it runs as a batch file..

Customization fundas

To get unique value from field or mbo   getmbovalue(“failurelist”).generateuniqueid. getmbo().generateuniqueid. To make a field readonly: mbo.setfieldflag("Readonly").

Create query using Concatenation Notepad ++ Tricks and Tips.

How to delete lines whose part we know for example to delete all lines with error keyword open Notepad++ Go to the search menu Ctrl+F and open the "Mark" tab. Check "Bookmark line" (if there is no "Mark" tab update to the current version). Enter your search term and click "Mark All" All lines containing the search term are bookmarked. Now go to the Menu "Search -> Bookmark -> Remove Bookmarked lines" Done.

Java best practices

Use as many tools as possible to improve code quality. Use string buffer instead of string concatenation when concatenating. Use comments in your code not documentation. Often check-in your code. Break complex programs in easy to understand blocks Use naming conventions and give relevant names to blocks, methods and variables. Always format your code inorder for others to easily read it.