Calendar cl=Calendar.getInstance();
cl.set(Calendar.DAY_OF_MONTH,1);
cl.roll(Calendar.MONTH,-1);
System.out.println("date is "+new java.sql.Date(cl.getTimeInMillis()));
Calendar cl=Calendar.getInstance();
cl.set(Calendar.DAY_OF_MONTH,1);
cl.roll(Calendar.MONTH,-1);
System.out.println("date is "+new java.sql.Date(cl.getTimeInMillis()));