What is the real meaning of overriding hashcode and equals methods in Java

What is the real meaning of overriding hashcode and equals methods in Java ? In many places we would have overridden hashcode and equals method without understanding deeply about it. Today after reading this post you will come to know,  Why we want to override hashcode and equals ?  What will happen if we override and if we won’t override

114 total views, no views today

» Read more

Change all words first letter to uppercase/lowercase in a string

Change all words first letter to uppercase/lowercase in a string: When you are getting particular string from different source and like to format all the different source strings to some particular format like all first letter to uppercase/lowercase, you can make use of the below given java program. .toUpperCase() & .toLowerCase() toUpperCase and toLowerCase in java will convert all the

65 total views, 1 views today

» Read more

how to read csv file in java example?

Title: Reading CSV File in Java Example Program CSV is abbreviation of Comma Separated Values. CSV file is also just a plain text file along with some delimiters [familiar one is ,]. It is used to store the data with comma separation. We have an option in excel also to export the column values as csv with comma delimited to

60 total views, no views today

» Read more

Java Program with Hibernate is not terminating

Java Program with Hibernate is not terminating: In hibernate you would have created the hibernate session factory to open the session and work with the databases. In that case you will face the program not termination issue sometimes. Rootcause: Once the program execution finishes session and sessionfactory should be closed, When it is not closed then you may face Java

97 total views, no views today

» Read more

No data was received to import. Either no file name was submitted

No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16 Before going further first take the backup of the php.ini file which exists in the xampp/php folder. Root Cause: This issue will occur either of these reasons, 1. upload_tmp_dir parameter would have

102 total views, no views today

» Read more

[Solved] org.hibernate.NonUniqueObjectException

org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [in.javadomain.ContentVO#0]   When I put my code like this, I got the above “org.hibernate.NonUniqueObjectException” exception, because session opening and closing has been done outside the for each loop which caused this nonunique object exception.   Set<ContentVO> extractedSaveSet = czc.getCouponsFrmCSV(); session = sessionFactory.openSession(); for (ContentVO content :

53 total views, no views today

» Read more

[Solved] JVM debug port in use issue

 JVM debug port in use issue: In Servers tab -> Right click on the server -> Administration -> Run Administrative console Now Administration console will be opened,   Servers -> Server Types -> WebSphere application servers -> CLICK_YOUR_SERVER[say myserver] -> Under Additional Properties section -> Debugging services -> JVM Debug Port (change to some port numbers (say 11119)) and restart

188 total views, no views today

» Read more

[Solved] org.hibernate.service.UnknownServiceException

org.hibernate.service.UnknownServiceException: Unknown service requested[org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] Rootcause: You will get this exception, at the line of opening the session which will be similar like this, session = sessionFactory.openSession(); If you would have closed the sessionfactory before the above mentioned line executes then you will get the “UnknownServiceException”. Solution: Ensure you did not close the sessionfactory before using it in next place and

96 total views, no views today

» Read more

setLenient Example in Java date

setLenient Example in Java date: In any programming language, handling date will always be challenging at some scenario. In Java we are using SimpleDateFormat to validate the date. If you see the below program it is behaving in a unexpected manner, which cause system/application instability, package in.javadomain; import java.text.ParseException; import java.text.SimpleDateFormat; public class DateSetLenientExample { public static void main(String[] args)

78 total views, no views today

» Read more

How to calculate months between two dates in java using Joda ?

  How to calculate months between two dates in java using Joda ? Joda Jar is the one of the opensource jar in java for date related validations and functionalities. Finding the months between the two dates has been a challenging task if we try to do only with Java. Same requirement can be done very easily using the Joda

85 total views, no views today

» Read more
1 2