I have a singleton class I've used in numerous projects in MyEclipse to generate database connections. I recently attempted to use this in a "Java Desktop Application" in NetBeans and had problems connecting on the target client. The connection would timeout at the getConnection() method. This is an Informix database, but I don't think that's relevant at all since I know of at least one person having the exact same issue with Oracle. http://forums.netbeans.org/viewtopic.php?t=8586
I created two new projects in NetBeans, one a simple Java Application with only a main which simply obtained the connection object and another Desktop Application which did the exact same thing with a single button. I'm able to run the "console" application and have it connect just fine but when I try the GUI it once again hangs.
I'm using the "Basic Application" skeleton because a) this isn't a project which requires the additional overhead of persistance and b) it's not a traditional CRUD application. It basically reads data from a CSV file containing data in a matrix and atomically updates the associated records. Alternatively, it downloads the records and creates the matrix CSV file.
I created the same simple application using the exact same singleton class using MyEclipse and Matisse and it works fine on the client. I attempted to create a "Database Application" skeleton in NetBeans to see if that would solve the problem, perhaps then I could reverse engineer the differences and make my application work, but the wizard tells me none of my tables have primary keys (which is incorrect). At this point I'm completely at a loss as to what the problem could be. It's obviously something specific to the Desktop Application type in NB 6.5 but I have no idea what would cause this behavior. It's even more perplexing because on the dozen or so clients I've tried it works on 4 of them. There's no similarities in JRE version, classpaths, OS versions, or login credentials among the working or broken clients.
I would post code but I don't see the point. I know it works on 25% of the clients 100% correctly, so it's not the code *unless* it's the generated code from NetBeans. However, if someone really thinks posting the only code I've changed would be helpful, I have no problem doing that. Also, I have half a dozen applications deployed (GUI-based, built in ME Matisse) with the exact same singleton class and I've never had a problem, so I don't believe the singleton itself is the issue unless it's a problem caused by the generated code in NB.
UPDATE: Just for giggles I eliminated the singleton class and put generic connection code right in the ActionPerformed method for the button. Same result...hang and timeout when creating the connection.