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.
1. Rightclick "Databases" node and choose "New Database Connection...". 2. Specify parameters for MySQL server. Click "OK". Result: "Advanced" tab is opened for choosing schema, but "Schemas" drop down list is disabled.
Schemas drop down is disabled because MySQL driver (and I suppose MySQL itself) doesn't properly support schemas. The code is doing the right thing. The driver is returning an empty result set. Maybe we should be requiring the Database field from the base panel? That's actually what I proposed in issue 145201. This won't give us schemas, but the overall result will be correct and consistent with what the driver (and the RDBMS?) supports.
I think you'll notice that there are some databases that don't bring up the schema window, because schemas don't make sense. This is true for MySQL because schemas are the same as databases. The whole schema thing needs to be reworked - what we really want actually is to just show all the schemas for a database, which each schema showing as a folder. For now, however, I suggest we at least don't bring up the schemas dialog for MySQL after connecting.
> For now, however, I suggest we at least don't bring up the schemas dialog for MySQL after connecting. +1
What I plan to do is to close the dialog if the list of retrieved schemas is empty. This way we don't need to add any new configuration data for defining which database types support schemas. If there are no schemas, the connection process is complete.
I also don't see any reason to allow the user to go to the Advanced (aka Schema) tab before a connection is established. So I want to prevent that while I'm at it. Any objections?
Yes, this all make sense, thanks Rob.
020b66411f2b The Advanced (Schema) tab of the New Connection dialog is now disabled until a connection is established. If the connection has no schemas, that's the end of the process and the dialog is closed. Otherwise the user is taken to the Advanced tab as before. If the user goes back to the Basic tab and changes any parameters, the connection is dropped and the Advanced tab is once again disabled until the connection is established. Fixed the Basic panel so that it doesn't redraw and flicker when the error message line is shown.
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/020b66411f2b User: Rob Englander <mindstream@netbeans.org> Log: #145271 Do not show the Advanced (Schema) tab after a new connection is made and there are no available schemas. The Advanced tab is no longer available unless a connection is established (and there are schemas). If a connection is established and the user modifies any of the parameters, the connection is dropped. Also modified the connection panel so that showing the error message line doesn't cause the entire panel to redraw and flicker.
This is not right. After connecting to the database, the New DB Connection dialog selects a schema by default -- it is the schema with the same name as the user name. When such a schema cannot be found, the dialog switches to the Advanced tab and lets the user choose the schema. But only when a schema cannot be found -- otherwise the dialog selects the default one and closes. Before the fix, it was possible for the user to override the default selection mechanism by switching to the Advanced tab and pressing the Get Schemas button *before connecting*. This is not possible anymore. Now, this behavior is not very intuitive either. So I suggest that the dialog *always* switch to the Advanced tab after connecting (with the default schema selection mechanism left in place, of course). IIRC that was what we planned to do when we were considering to rewrite the New DB Connection dialog to a wizard.
I don't agree. I do not find it intuitive at all to switch to the Advanced tab 1) before I make the connection, or 2) if there won't be any schemas to choose from. This approach still allows the user to override the default schema, if there are any schemas to choose from. Otherwise, why offer the user a screen where nothing can be accomplished. I can revert the behavior. Not a big deal. But I don't agree with doing so.
I should have made it clear that you should only switch to the Advanced tab if there are any schemas -- of course! Also, the Advanced tab should not be selectable before the connection is made. Here's another attempt to explain the problem. In the current version, there is no way to connect to the sample Derby database with the app user name and *to the NULLID schema* directly from the dialog. At least I didn't find a one. You always get the APP schema (and you can modify it something else in the connection properties, which is clumsy). This was possible before your change. I am not proposing to revert your change, but to modify it -- cf. the second paragraph in desc2.
I think I see what you mean. Let me stare at it tomorrow and I'll propose a change.
Ok, this is due to my rather dumb mistake. The fix is complete and I'll commit after I finish local testing. BTW, I've removed the Get Schemas button from the Advanced panel as it is no longer needed. If the user is on the Advanced tab then the schemas have already been retrieved.
Right, that makes sense.
bb67d48d5c0a Fixed bug that prevented Advanced tab from being shown for connections that have schemas. There's a late UI change in this fix as well, which removed the Get Schemas button from the advanced tab of the New Connection dialog. That button is never needed and would just requery for schemas that have already been retrieved.
Integrated into 'main-golden', will be available in build *200809031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/bb67d48d5c0a User: Rob Englander <mindstream@netbeans.org> Log: #145271 Fixed bug that prevented Advanced (Schemas) tab from being displayed. Also removed Get Schemas button since it's not needed.
Verified with build 080909.