Problem Connectiong to DB Using "Desktop Application" in NB 6.5

Posted on 2009-04-21
Last Modified: 2013-12-14
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.

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.
Question by:SimmerDown
    1 Comment

    Accepted Solution

    Found my own answer.  I had been Googling variations on NetBeans and jdbc or database connectivity.  Changed it to SingeFrameApplication and it was the second hit on the list.  For future reference:, second post from the bottom.  I neglected to even imagine it had something to do with our proxy.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now