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 128546 - Provide an API to allow you to connect to a database without bringing up the dialog
Summary: Provide an API to allow you to connect to a database without bringing up the ...
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords: API, API_REVIEW_FAST, PLAN
Depends on:
Blocks: 134193
  Show dependency tree
 
Reported: 2008-02-27 12:02 UTC by Vadiraj Deshpande
Modified: 2008-07-14 19:28 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch file for changes to API (46.74 KB, patch)
2008-06-27 10:58 UTC, David Vancouvering
Details | Diff
This updated patch includes the check for running on the event thread (46.94 KB, text/plain)
2008-07-01 23:39 UTC, David Vancouvering
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadiraj Deshpande 2008-02-27 12:02:54 UTC
The connection dialog is a modal dialog and is distracting. The DB explorer should allow background operation to connect
to the db without this modal dialog. Or at least show the progress in the status bar. 

This is annoying in the case of code completion for database tables and column names in Hibernate module.
Comment 1 Andrei Badea 2008-02-27 12:53:17 UTC
Probably would be nice to add a ConnectionManager.connect(DatabaseConnection) method.
Comment 2 Vadiraj Deshpande 2008-03-11 14:57:35 UTC
This is really affecting the code completion in Hibernate plugin. First time when the user requests for code completion
of database data (such as table names and column names), this dialog pops up and code completion dialog will even come
up. Once this happens, the connection is established and hence forth the code completion works properly. I would like to
prioritize this.
Comment 3 David Vancouvering 2008-04-29 20:35:23 UTC
We should do this for 6.5
Comment 4 David Vancouvering 2008-06-27 10:57:14 UTC
Please review this API change to add a new method to the ConnectionManager, connect(), which synchronously connects to
the database without bringing up any UI.

The attached patch includes the change as well as a new unit test that passes.  Apologies for the spurious irrelevant
diffs, I'm using hg queues and it seems to be doing something odd to the diffs.
Comment 5 David Vancouvering 2008-06-27 10:58:16 UTC
Created attachment 63586 [details]
Patch file for changes to API
Comment 6 David Vancouvering 2008-06-27 11:01:48 UTC
One issue I found already is I didn't add the check to see if it's on the event thread.  I've added this, but will await
other comments before submitting a new patch.
Comment 7 _ ahimanikya 2008-06-27 11:55:56 UTC
This looks very good, this will be very useful not only to DataView but all the editors that we have SOA team. Thanks
much. Check for event thread sounds OK to me, but can't we have this as guideline instead of enforcing it. May be log a
warning, when the check fails...

But I am OK either way.
Comment 8 Vadiraj Deshpande 2008-06-27 19:26:29 UTC
Looks fine to me. Checking for event thread is needed.
Comment 9 David Vancouvering 2008-07-01 23:39:50 UTC
Created attachment 63781 [details]
This updated patch includes the check for running on the event thread
Comment 10 Andrei Badea 2008-07-09 13:06:20 UTC
AB01: connect() should return false when not all credentials are present, instead of throwing an exception. You should
not use exceptions for control flow, and also, the exception makes it difficult for the caller to distinguish between a
real error and the credentials not being present.

Comment 11 David Vancouvering 2008-07-10 17:51:25 UTC
http://hg.netbeans.org/main?cmd=changeset;node=f12f9b38fab2
Comment 12 Roman Mostyka 2008-07-14 19:28:58 UTC
Verified with build 080714.