Posts Tagged Java

Installing Java on Linux

March 15, 2012
Installing Java on Linux

Lets see how to install Java on Ubuntu. On all other Unix flavored systems, the procedure will be more or less same as we’re using terminal Unix commands to install JDK. Download JDK from here: http://www.oracle.com/technetwork/java/archive-139210.html#javase Suppose say JDK is downloaded to ‘Downloads‘ folder Change directory to Downloads folder % cd ~/Downloads Change the execute [...]

NonUniqueResultException in Hibernate

March 6, 2012
NonUniqueResultException in Hibernate

Sometimes we will get the NonUniqueResultException when we tried to get the result-set by executing query using Hibernate. The following is the stack trace of the exception: query did not return a unique result: 2 org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.hibernate.internal.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:899) at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:890) at org.bss.dao.SampleDAO.main(SampleDAO.java:84) This happens because you’re expecting [...]

Parse the XML using DOM Parser in Java

December 8, 2011
Parse the XML using DOM Parser in Java

From Wikipedia http://en.wikipedia.org/wiki/Java_API_for_XML_Processing#DOM_interface, we can read like: The DOM interface is perhaps the easiest to understand. It parses an entire XML document and constructs a complete in-memory representation of the document using the classes modeling the concepts found in the Document Object Model(DOM) Level 2 Core Specification The following is the Java code to parse [...]

Fully qualified V/S unqualified name in java

November 24, 2011
Fully qualified V/S unqualified name in java

Lets make it clear what is meant by fully qualified name & unqualified name in Java, and how to get them inside Java code Consider a small example: package org.bss.pkg;   Class Member {   private int id;   public int getId() { return id; }   public void setId(int id) { this.id = id; [...]

SCWCD / OCWCD Mock Exams

November 6, 2011
SCWCD / OCWCD Mock Exams

SCWCD / Oracle Certification Paths for JSP / Servlet Certification examination: Oracle Certified Professional, Java EE 5 Web Component Developer: Oracle J2EE 5 Exam Path Oracle Certified Expert, Java Platform, Enterprise Edition 6 JavaServer Pages and Servlet Developer: Oracle J2EE 6 Exam Path (Click on exam link of each page to find the syllabus of [...]

Difference between ServletRequest.getRequestDispatcher and ServletContext.getRequestDispatcher

October 26, 2011
Difference between ServletRequest.getRequestDispatcher and ServletContext.getRequestDispatcher

If you use ServletRequest.getRequestDispatcher: you can use absolute path like “/index.jsp“, which forwards request to “http://www.myapp.com/index.jsp” from the request received directory or you can use relative path like “index.jsp”, which forwards request to “index.jsp” which is relative to the request received servlet. For example, if you receive your request on “http://www.myapp.com/mymodule/”, RequestDispatcher requestDispatcher = request.getRequestDispatcher(“index.jsp”); [...]

Open Office in a Java Applet using OpenOffice.org API

October 22, 2011
Open Office in a Java Applet using OpenOffice.org API

Using OpenOffice.org API, you can manage the spreadsheet from your application only. This is simple flow for viewing spreadsheet in an Applet of Java.Easy steps to view & manage Open Office in Java Applet: Download Java Development Kit (minimum version 6) and install using the article: http://poisure.com/2011/10/installing-java-on-windows/ Download OpenOffice.org (OOo) from here: http://download.openoffice.org/, and install [...]

Installing Java on Windows

October 22, 2011
Installing Java on Windows

Install JDK in easy steps: Download JDK from here: http://www.java.com/en/download/manual.jsp (Choose the matching version) Install Java (Lets assume you downloaded jdk1.6.0_22 version and installed in C:\Program Files\Java folder) Set the below system properties by going here: ‘My Computer-> properties -> Advanced -> Environment Variables’: variable name: JAVA_HOME variable value: C:\Program Files\Java\jdk1.6.0_22 (Change this path to [...]

 

If you have a Tip, Comment, Article or anything you want to share, please send it to: i@poisure.com