Posts

Showing posts from June, 2011

Java Memory Leak Analysis

Image
This Article is not complete... It is in Progress - Common Causes of Memory Leak :  Memory Leak in your application can happen because following reasons - (1) Bad Programming -  Unnecessary creation of objects and holding their references for longer time, specially static objects. static objects gets memory in perm gen.  Wrong configuration of EJB components. (2) Server Configuration Heap Setting Thread Count Garbage Collection Algorithm (3) Less Resources (Physical Memory) (4) Wrong use of Cache. Approaches  for Memory Leak Analysis :         There are couple of things that we can do- Memory Profiling of application  - JProbe Thread Dump Analysis - Eclipse Plugin  Heap Dump Analysis - JMap Utility for capturing Heap Dump, IBM Heap Analyzer Heap Object Dump analysis - Manual Code for analysis. Monitoring of the System - Introscope (watch Memory and Thread usage graph), LeakHunter Prevent Memory Leak :  Choose GC algorithm carefully. Parallel GC with Ma

FALTU (USELESS)

This article is inspired by a Hindi movie named “FALTU“. FALTU (USELESS) is the label that society puts on the Majority of students who get less grades.  This way of thinking definitely need change with some awareness. “Nothing is FALTU in this world. The things that people have thought useless, can be of great value. Just need to think from a different perspective. ”  “Yun to pathar ki bhi takdeer badal sakti hai, shart ye hai k salike se Taraasha jaaye ” No body is accepting this majority of students who are passed with less grades. Sadly  nobody even tries to understand what was the reason behind their less grades/percentage. Many a times students don’t know what they can do about it? nobody tries to help them to discover their purpose in life and key strengths to achieve it.  May be somebody can help them to understand what they love to do and how to covert that thing or hobby into their profession.  “Students who got less grades are nev

Funny Messages

Mario met me online once, and i greeted him. "Hey Do u remember me?" He said - "NO" I Replied - Kamine i have spent my whole childhood in saving your girlfriend !! ============== I asked My Heart: Why can't I Sleep at Night? My Heart told me: Because ... You already Slept in the Afternoon... So, Don't Overreact like You are in Love.. ! :) ===============

Birthday Message and Shayari

Zindgi ka har khwab haqiqat ban jaye, Khushi k chirago se zindgi roshan ho jaye, Mehak jaye u zindagi apki, Ki gulab ki khushbu b apke samne feeki pad jaye… =================== Khile Phool Jaise labo pe hasi ho, Na koi gam ho na koi bebasi ho, Salamat rahe zindagi ka ye safar, Jahan aap raho bas kushi hi khusi ho. Happy Birthday =============== Dosti Ka Haq Hum Ada Yun Karte Hain Teri her ek khusi Pe Jaan Bhi Fida Karte Hain Tujhko Phool Bhi Zakhm Na Dene Paaye Khuda Se Har Dam Yehi Duaa Karte Hai. Happy Birthday :) =============== May You Rise To The New Heights Of Success May The Dreams Of Your Eyes Come Alive & May Each Step U Take Bring Smiles To U Forever. =========== Khuda na kare aapko koi gum mile,  Khushiya aur hasi har dam mile,  Gum jab bhi bad chale aapki taraf,  Khuda kare raste me use hum mile. ============ As Cloud cover the Sun  Truth cover the Lie  Angel cover the Evil  Flowers ocve the Garden  I Wish & Pray that happiness

JDBC : Connecting JAVA to MySQL Database

1. Database Preparation Create schema :  create schema djSchema Create Table     :  create table djSchema.t_dj_contacts (id int, firstname varchar(30), lastname varchar(20)); Insert Test Data:  insert into t_ dj_contacts values(1,"deepak", "jain"); 2. Download and Add mysql-connector-java-5.0.8- bin.jar in classpath. This jar contains JDBC driver for MySQL. 3. Keep MySQL Database details ready      DB IP        :     PortName  : In C:\Program Files (x86)\MySQL\MySQL Server 5.0\my.ini file contains the client port     UserName :     Password  : 4. Class is JDBCConnector.java import java.sql.*; public class JDBCConnector { public void connect(){ Connection connection=null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; try { // load the driver Class.forName("com.mysql.jdbc. Driver"); // create the connection connection = Drive