This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 129633

Summary: Provide API that let's you call showAddDriver on AWT thread and return the driver
Product: db Reporter: Vadiraj Deshpande <vadirajvd>
Component: CodeAssignee: David Vancouvering <davidvc>
Severity: blocker Keywords: API, API_REVIEW_FAST, PLAN
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 131356, 134193, 138142    
Attachments: Patch for proposed change

Description Vadiraj Deshpande 2008-03-10 09:35:59 UTC
Using JDBCDriverManager.getDefault().showAddDriverDialog(), one can register a non-existent driver into the IDE.
But this method call do not have any kind of feedback as to whether the operation was successful and a new driver is
registered into the IDE or not. 
The work around is to call  JDBCDriver[] drivers = JDBCDriverManager.getDefault().getDrivers(driverClassName) and check
the array size and if this is still zero, display the add driver dialog again (possibly in a loop). This is annoying.
Comment 1 Andrei Badea 2008-03-10 14:13:37 UTC
Probably a method like


needs to be provided which can only be called in the event dispatching thread and can return the new driver. Similar to
Comment 2 David Vancouvering 2008-03-10 17:22:41 UTC
I know this is frustrating, but it's not a defect, it really is an enhancement request.  I like Andrei's suggestion.
Comment 3 David Vancouvering 2008-04-29 20:39:53 UTC
Let's do this, it shouldn't be hard at all, and will provide a real benefit.
Comment 4 David Vancouvering 2008-06-27 22:29:17 UTC
Created attachment 63625 [details]
Patch for proposed change
Comment 5 David Vancouvering 2008-06-27 22:30:49 UTC
Please review patch for proposed change.

I tested this manually and it works as desired.
Comment 6 Vadiraj Deshpande 2008-06-30 11:49:06 UTC
Patch looks good to me.
Comment 7 Andrei Badea 2008-07-09 13:10:07 UTC
API looks fine.
Comment 8 David Vancouvering 2008-07-10 17:56:02 UTC
Ready for integration
Comment 9 David Vancouvering 2008-07-10 17:56:20 UTC;node=a45560212d61
Comment 10 Roman Mostyka 2008-07-14 19:24:38 UTC
Verified with build 080714.