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.
Summary: | Provide an API to allow you to connect to a database without bringing up the dialog | ||
---|---|---|---|
Product: | db | Reporter: | Vadiraj Deshpande <vadirajvd> |
Component: | Code | Assignee: | David Vancouvering <davidvc> |
Status: | VERIFIED FIXED | ||
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: | 134193 | ||
Attachments: |
Patch file for changes to API
This updated patch includes the check for running on the event thread |
Description
Vadiraj Deshpande
2008-02-27 12:02:54 UTC
Probably would be nice to add a ConnectionManager.connect(DatabaseConnection) method. 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. We should do this for 6.5 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. Created attachment 63586 [details]
Patch file for changes to API
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. 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. Looks fine to me. Checking for event thread is needed. Created attachment 63781 [details]
This updated patch includes the check for running on the event thread
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. Verified with build 080714. |