I have 4 String parameter's in Java (from request object)
String dd = req.getParameter(dd);
String mm = req.getParameter(mm);
String yyyy = req.getParameter(yyyy);
after validating dd,mm,yyyy I am building date
object in 4th String variable by buildingString date = dd+"/"+mm+"/"+yyyy; again in some places i need to replace the date
format as following,
date = yyyy+mm+dd;
date =mm+"/"+dd+"/"+yyyy; // storing in db need this format
How much memory would consume since 4 objects need to pass till persist in table? Was it costlier memory call? Is there any best practice? At last howmany string objects would be in Stringpool?
java.timepackage. In earlier versions, useDateand/orCalendaror JodaTime. Do not use strings when saving to database.