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: | JDBC SQLServer : cannot show data from non-default database | ||
---|---|---|---|
Product: | db | Reporter: | neuros_nid <neuros_nid> |
Component: | Code | Assignee: | Jiri Rechtacek <jrechtacek> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | dynamite, hmichel, jkovalsky |
Priority: | P3 | Keywords: | NETFIX |
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows Vista | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
hg diff of QueryAction.java
QueryAction.java |
Description
neuros_nid
2009-06-04 13:38:24 UTC
I too have seen this issue and I now have a fix ready! The code that generates the SQL is in org.netbeans.modules.db.explorer.action.QueryAction class. This compared the name of the selected table's schema against the default schema name. This is not however populated, presumably because the code was left mid-development (note the greyed-out menu option to change the default catalog/schema). Additionally the code did not perform the same check for the catalog (database in SQLServer terminology). My fix checks the selected table's catalog and schema against the one for the database connection and only attaches it to the table name in the query if they are different. The table's schema is only checked if the schema name is not null (which is notably the case for MySQL). Created attachment 84149 [details]
hg diff of QueryAction.java
Created attachment 84150 [details]
QueryAction.java
I was using the jTDS driver for SQLServer. I have tested this against SQLServer and MySQL with success. I am currently using the DB explorer a lot a work. A few weeks ago out of curiosity I had a look into whether I could avoid opening multiple connections for the same database and when I succeeded this proved very helpful. I then went to raise an issue and found that this one had already been created, and so I attached the patch. I have in the last day or so become a NetFIX member and realised that I have performed the process in reverse, for which I apologise. I wonder if you would consider this as a NetFIX fix. Jirko, would you be willing to review Daniel Sheppard's (dynamite) patch and integrate it if you find no problems? Thanks a lot! Daniel is new member of NetFIX [1] team. [1] http://wiki.netbeans.org/NetFIX I'm investigating the problem and I'll review the patch. Thanks for the patch. Thanks. To avoid confusion I should say that my patch was written prior to your patch for issue #167564. I think that the patch I have included ought to satisfy that issue as well, although I must confess that I haven't tested it against SQLite. Thanks for the patch. It's was applied in core-main/rev/f06457e60c13. @dynamite: The proposed patch contains the patch of issue #167564, actually. Your patch fixes both cases - either using non-default databases or querying SQLite as well. Thanks *** Issue 160269 has been marked as a duplicate of this issue. *** Integrated into 'main-golden', will be available in build *200907300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f06457e60c13 User: Jiri Rechtacek <jrechtacek@netbeans.org> Log: #166549: JDBC SQLServer : cannot show data from non-default database (applied dynamite's patch, thanks) |