I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism in Java. In the range of storing 20,000+ java objects, updated every 5 or so seconds. Some options I am open to: Pure JDBC/database combination JDO JPA/ORM/database combination An Object Database Other Storage Mechanism…
StackOverflowError when serializing an object in Java
I am writing an application in Java using Swing. I am trying to implement functionality to save and load simulation states for at simulation i am running. The entire simulation is kept as an object, disconnected from Swing. I am trying to serialize my Simulation class with this code: But i get the following e…
Does Java have native support for events, similar to that of C#?
I’m a bit confused from what I’ve heard Java doesn’t do events. But I know that it does GUI events. Am I missing something? Does java have an event handling mechanism? I’m aware that I can implement a publisher subscriber pattern, but I’m looking for native support within Java. I…
Is there any way to do n-level nested loops in Java?
In other words, can I do something like Except N times? In other words, when the method creating the loops is called, it is given some parameter N, and the method would then create N of these loops nested one in another? Of course, the idea is that there should be an “easy” or “the usualR…
How can I generate an MD5 hash in Java?
Is there any method to generate MD5 hash of a string in Java? Answer You need java.security.MessageDigest. Call MessageDigest.getInstance(“MD5”) to get a MD5 instance of MessageDigest you can use. The compute the hash by doing one of: Feed the entire input as a byte[] and calculate the hash in one…
Variable naming conventions in Java
In PHP, we (at least the good programmers) always start general variable names with a lower-case letter, but class variables/objects with an upper-case letter to distinguish them. In the same way we start general file names with a lower case letter, but files containing Classes with an upper case letter. E.g.…
How can I display a byte array as a String in java’s debug detail formatter?
I’d like to write a simple detail formatter that displays byte[] data in the form of a String (using String.<init>([B) to do the dirty work). However, I’m not sure how to find the class name for [B to use when creating the formatter. Is this even possible? Or, alternatively, is there another…
hibernate column name issues
I specifically need the above code to create a column named “DateOfBirth,” instead Hibernate gives me a column named date_of_birth. How can I change this? Is there a web.xml property? I came across DefaultNamingStrategy and ImprovedNamingStrategy, but not sure how to specify one or the other. Answ…
Java get JPanel Components
I have a JPanel full of JTextFields… How do I later get the JTextFields in that JPanel? Like if I want their values with Thanks Answer Well bear in mind they didn’t get there by them selves ( I think a read some questions about dynamically creating these panels at runtime ) In the answers posted t…
How to uninstall plugins in Eclipse 3.4.X or higher
The GUI for managing plugins in Eclipse got a bit of an overhaul in version 3.4.0. This GUI is accessed via the “Software Updates…” option in the Help menu. The option to remove the selected Mylyn plugin is greyed out. In fact, this is true of virtually every installed plugin. I know that th…