[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-04-21
1
Medium Priority
?
397 Views
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. 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.
0
Comment
Question by:SimmerDown
1 Comment
 

Accepted Solution

by:
SimmerDown earned 0 total points
ID: 24199005
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:

http://forums.sun.com/thread.jspa?threadID=5316221, second post from the bottom.  I neglected to even imagine it had something to do with our proxy.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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…
Suggested Courses

834 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