Badal Chowdhary

Ranch Hand
+ Follow
since Apr 26, 2011
Badal likes ...
Eclipse IDE Oracle Java
Merit badge: grant badges
Biography
My name is Badal Chowdhary. I am a Software Engineer by profession and a Cricketer by heart!

I have done Bachelors in Engineering with honors in Information Technology from RAIT, Mumbai University and Masters in Computer Science from NYU-Poly.

I am a Sun Certified Programmer for Java and Sun Certified Web Component Developer.

Cricket is my religion, Sachin is my GOD!
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Badal Chowdhary

Adding to an old thread. Wanted to add 1 more scenario. If your application queries large volume of data and then processes it, Hibernate could slow down processing and could lead to memory issues. Because internally it binds each db record to an object and loads the entire resultset into a collection in memory. I was processing approx 200K records i.e. querying from database and creating a proprietary file. Using Spring JDBC gave a much better performance.

Keep learning...
Man! This is beating it to death stuff. But it's a good deep look. Thanks Jeff.
12 years ago
Basically, methods cannot be nested in methods. A method can only be inside a class.
12 years ago
Jeff, Correct. I was imagining a hashcode function such that if objects are unequal, their hashcodes will never be same. But the hashcode contract doesn't conform to that.

Here's my imagination:

String s ="abd";
int hashCode = (1*1)+(2*2)+(3*4); // basically index_of_char * occurance_in_a-z with a==1 and z=26

But yes using hashcode method of String will lead to inconsistent results in the given scenario.
12 years ago
You can use ProcessBuilder class in Java to invoke any executable. So you can have your sqlldr command in a bat file, and invoke this bat file from Java.
12 years ago
Abhinav, the question is what are you trying to achieve here?
12 years ago
If you really want to convert a String into int, you could also use hashcode method of String. But spend a good amount of time testing since you wanna encrypt a user's message which would be confidential.

Thanks
12 years ago
If you are getting heap memory error, that means objects are being created but are not de-referenced when not needed. As a result, Java garbage collector cannot free up memory on heap. There are quite a few tools to analyze heap. All you have to do is set up a JVM parameter to do a heap dump on first occurance of OutOfMemoryError. I had written a post that does this using Eclipse Memory Analyzer. Check out if this is helpful:
http://badalchowdhary.wordpress.com/2011/11/09/java-heap-memory-analyzer/


Thanks,
Badal
12 years ago
For creating a war file, you can go to the dir that contains WEB-INF dir. WEB-INF dir should have classes, lib and web.xml file. Run the below command from parent dir of WEB-INF dir:
jar cvf myapp.war .
12 years ago
How about using user_id as uniqueid? If one person can make mulitple user accounts in your application, then that itself is a different problem altogether.
12 years ago
VisualVM is a free Java profiling tool. I did use this to play around and got a basic Java program attached to this profiler. What is the state of your heap memory?
12 years ago
Albert,

The main program of Java takes a String array:


So if your class name is TakeParams.java, you can run it as below to take 2 String params:
java TakeParams string1 string2

To convert it to other data type, you can use parse method. Eg: parseDouble, parseInt...
12 years ago
There are tools to visualize the state of heap. The heap should be dumped to a .hprof file at the first occurrence of OutOfMemoryError. Eclipse Memory Analyzer can open .hprof file and you can then visualize the heap. See this post for more details:
http://badalchowdhary.wordpress.com/2011/11/09/java-heap-memory-analyzer/

Thanks,
Badal
12 years ago