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 207362

Summary: "Execute Command" function from the database context menu connects to the wrong database
Product: db Reporter: athompson <athompson>
Component: CodeAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW ---    
Severity: normal    
Priority: P4    
Version: 7.1   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description athompson 2012-01-16 20:59:07 UTC
Initial conditions: a DBMS instance with multiple databases (I'm using SQL server).  I'll call the databases "db1" and "db2".

1. In Netbeans, add a DB connection for the DBMS.  Specifify "db1" as the database to connect to.

2. Connect to the DBMS through netbeans.

3. Open the node for the DBMS, then navigate to db2-->dbo-->Tables.

4! Right-click on Tables and select "Execute Command..." from the context menu.  The SQL CC shows completions for db1 instead of db2 as expected, and the active DB when running the query is set to db1.

To summarize, if the user picks a node under db2 and opens an SQL query window, she expects the active DB to be db2, even if the connection was created using db1 as the default.  Due to this and also issue #200368, there's no way to get CC for db2 without explicitly creating a connection for it.