soundar rajan

Greenhorn
+ Follow
since May 08, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by soundar rajan

Hi,
Your question is not clear. If you want to read data from excel file , you have to use some third party libraries like POI, you can download the POI jar file using the following maven dependencies:

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.8</version>
</dependency>

Sample code for reading excel file using the POI api :

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
//..
FileInputStream file = new FileInputStream(new File("C:\\test.xls"));

//Get the workbook instance for XLS file
HSSFWorkbook workbook = new HSSFWorkbook(file);

//Get first sheet from the workbook
HSSFSheet sheet = workbook.getSheetAt(0);

//Get iterator to all the rows in current sheet
Iterator<Row> rowIterator = sheet.iterator();

//Get iterator to all cells of current row
Iterator<Cell> cellIterator = row.cellIterator();


Please rephrase your question and post again.
7 years ago
you can use jvisualvm and jconsole for monitoring your application. If you need to connect remote machine please refer the following link: http://visualvm.java.net/applications_remote.html
7 years ago
Another way of finding memory leaks is to enable the GC logs and analyze the same. Please find the reference for enabling and analyzing the same: http://www.tagtraum.com/gcviewer.html
7 years ago

To read a file Scanner class is recommended:
Scanner scanner = new Scanner(new FileInputStream(fFileName), fEncoding);
8 years ago
Can you please post the exception trace what you have in the server.log?
8 years ago
Yes you are correct, the following code will be printing true:

ArrayList<String> al = new ArrayList<String>();
al.add("hi");
al.add("hsi");



if(al.contains(new String("hi"))){
System.out.println("true");
}else{
System.out.println("false");
}

and the following code will be printing false:

ArrayList<ArrayList<String>> master = new ArrayList<ArrayList<String>>();
ArrayList<String> al = new ArrayList<String>();
al.add("hi");
al.add("hsi");
master.add(al);


if(master.contains(new String("hi"))){
System.out.println("true");
}else{
System.out.println("false");
}
8 years ago
HP LoadRunner is the best S/W for doing performance testing. For analyzing performance issue you can use your kit S/W , the trail version is available here: http://www.yourkit.com/
8 years ago
Hibernate doesn't have any API for retrieving DB details, but we can create the native query like session.createSQLQuery(...) and get all those details by using normal SQLs.
• Before going to start the performance improvement analysis you should have the SLA for each page, it means the expected responses time from the customer or end user.
• Execute performance test and get the base line results, before adding any performance optimizations.
• Use http watch plugin for getting total execution time for each page rendering.
• Identify the hotspots at method level, for this we have to enable the loggers to get the each method execution time.
• Identify the SQLs and checks all the SQLs having the proper indexing at DB level.
• Check if there were any optimization is possible in SQLs.
• Check the code level if any unnecessary query execution is happened and try to make it as less.
• Profiling the application will be giving more data points for adding optimizations.
• Using yslow plugin for getting more information for js, css and image related optimizations.
8 years ago
You can use jvisualvm.exe and jconsole for monitoring j2ee applications. Both the tools are available in the jdk folder \jdk1.6.0_07\bin.
Please refer the following site for configuring tomcat with jconsole :
http://www.skill-guru.com/blog/2010/11/11/troubleshooting-application-performance-with-visualvm/.
8 years ago
Please try to use SONAR, this is one of the tool we can integrate with our normal build tool. It will be providing all connection file related issues and recommendations.
8 years ago
Hibernate having the caching mechanism; we can get some performance improvement after caching the SQLs.

Also we have to define strategies for fetching data from the database based on the requirement either lazy or eager

The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched.
The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily when it is first accessed.

We have to avoid more reference tables when we designing the Data Model for hibernate.
This issue has been resolved by adding fscontext.jar into /jboss/production/lib folder.
8 years ago
you can use SLF4j MDC,MDC is set per thread. So each time a request is made to the server, we need to set MDC which can be acheived using Servet/Portlet filters.
8 years ago