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 237648 - When I connect to DB2 database explorer doesnt show me tree with database objects.
Summary: When I connect to DB2 database explorer doesnt show me tree with database obj...
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
: 225254 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-25 08:57 UTC by jaroslav.beran
Modified: 2014-01-08 10:04 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (62.57 KB, text/plain)
2013-10-25 08:57 UTC, jaroslav.beran
Details
In 7.3.1 it works well (44.96 KB, image/png)
2013-10-29 21:15 UTC, jaroslav.beran
Details
In 7.4 it doesnt show tree (45.10 KB, image/png)
2013-10-29 21:16 UTC, jaroslav.beran
Details
URLs (59.52 KB, application/zip)
2013-10-29 22:20 UTC, jaroslav.beran
Details
Fixed (53.03 KB, image/png)
2013-11-08 12:11 UTC, jaroslav.beran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jaroslav.beran 2013-10-25 08:57:12 UTC
When I connect to DB2 database explorer doesnt show me tree with database objects. It works well in 7.3.1
I am using:
IBM DB2 Universal Driver
db2jcc4.jar
db2jcc_license_cisuz.jar
sqlj4.zip


Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_21
Runtime = Java HotSpot(TM) Client VM 23.21-b01
Comment 1 jaroslav.beran 2013-10-25 08:57:17 UTC
Created attachment 141547 [details]
IDE log
Comment 2 Libor Fischmeistr 2013-10-29 11:35:28 UTC
Hello, thanks for the report.

Unfortunately I don't see anything in the log related to this issue.

The screenshot could be useful.

I would also ask you to look into the issue 225254 if they are related somehow.
Comment 3 jaroslav.beran 2013-10-29 21:15:58 UTC
Created attachment 141662 [details]
In 7.3.1 it works well
Comment 4 jaroslav.beran 2013-10-29 21:16:57 UTC
Created attachment 141663 [details]
In 7.4 it doesnt show tree
Comment 5 jaroslav.beran 2013-10-29 21:26:13 UTC
It is hard to say if there is some connection between this issue and 225254. 

Here there is exactly the same db2 database, exactly the same JDK (1.7.0_21), exactly the same db2 driver in both cases. The only difference is NB_7.3.1 in working case and NB_7.4 in case of trouble.

Let me know how can I help you more. I am able to setup Skype conference and to share my desktop if it would help.

Jarda
Comment 6 matthias42 2013-10-29 22:05:57 UTC
Could you please provide the jdbc url your using to connect? It can anonymized, but I need the structure with all elements. I suspect (call it hunch) a duplicate of bug 237345. There the jdbc connection does not refer to one database, but the whole dbms. You could be facing the same issue.
Comment 7 jaroslav.beran 2013-10-29 22:20:34 UTC
Created attachment 141665 [details]
URLs
Comment 8 matthias42 2013-10-30 20:33:59 UTC
Ok - once again jdbc implementors prove that can mess up even the simplest apis.

I downloaded the IBM demo appliance (https://www.ibm.com/developerworks/data/library/techarticle/dm-1205testdrivedb2/). I could reproduce the problem.

First problem is indeed a duplicate of bug 237345 (no children are shown for the connection node, because delegation does not work - see discussion and potential fix in mentioned bug).

Second is bogus data from DB2:

For the connection: jdbc:db2://192.168.1.100:50001/SAMPLE

Connection#getCatalog returns NULL for DB2 connections
Connection#getMetadata#getCatalogs returns a list with one entry: SAMPLE

This is already bogus - it gets even better (dmd = DatabaseMetaData):

dmd.getTables(null, null, "%", new String[] {"TABLE"})

lists all tables in the SAMPLE DB. While this:

dmd.getTables("SAMPLE", null, "%", new String[] {"TABLE"});

doesn't list any table.

So my fix for the second problem: Mark the DB2 driver as reporting bogus catalog names (introduced for pointbase, bug 173798).

Libor, could you please take a look at this?

I raised priority to P1, according to guide lines it qualifies by:

 usability 	Prevents most users from completing work, with no workaround 

While bug 237345 could be worked around (connect to mysql db), I don't see a similar possibility for DB2.
Comment 9 matthias42 2013-10-30 20:36:14 UTC
(In reply to matthias42 from comment #8)
> Mark the DB2 driver as reporting bogus catalog names (introduced for pointbase, bug 173798).

In db.metadata, JDBCMetadata.java:

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -210,6 +210,8 @@
      * @return
      */
     private boolean driverReportsBogusCatalogNames() throws SQLException {
-        return "PointBase JDBC Driver".equals(dmd.getDriverName());
+        String driverName = dmd.getDriverName();
+        return "PointBase JDBC Driver".equals(driverName) ||
+                "IBM Data Server Driver for JDBC and SQLJ".equals(driverName);
     }
 }
Comment 10 Libor Fischmeistr 2013-11-07 08:54:17 UTC
Sorry for late patch integration.

Fixed in changeset: http://hg.netbeans.org/core-main/rev/f2ab1d481cc5

Matthias, thank you very much for that patch. It works perfectly for me.

Jaroslav, could you please verify it?

Thank you
Comment 11 jaroslav.beran 2013-11-07 11:00:38 UTC
Hello can you guide me how to implement this patch?

Thank you

Jaroslav
Comment 12 Libor Fischmeistr 2013-11-07 11:26:37 UTC
(In reply to jaroslav.beran from comment #11)
> Hello can you guide me how to implement this patch?
> 
> Thank you
> 
> Jaroslav

Hello, just wait when it'll be integrated into daily build. It will be noticed here.
Comment 13 Quality Engineering 2013-11-08 03:53:07 UTC
Integrated into 'main-silver', will be available in build *201311080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f2ab1d481cc5
User: Libor Fischmeistr <lfischmeistr@netbeans.org>
Log: #237648: When I connect to DB2 database explorer doesnt show me tree with database objects.
Comment 14 jaroslav.beran 2013-11-08 12:11:42 UTC
Created attachment 141981 [details]
Fixed

Hello,

I tested it with success - now it works well.

Thank you very much :-)

Jaroslav
Comment 15 Tomas Danek 2013-11-12 13:01:38 UTC
thanks for verification. 
(In reply to jaroslav.beran from comment #14)
> Created attachment 141981 [details]
> Fixed
> 
> Hello,
> 
> I tested it with success - now it works well.
> 
> Thank you very much :-)
> 
> Jaroslav
Comment 16 Libor Fischmeistr 2013-11-13 08:38:33 UTC
Integrated into release74: http://hg.netbeans.org/releases/rev/2c3337758136
Comment 17 Quality Engineering 2013-11-14 14:33:05 UTC
Integrated into 'releases/release74', will be available in build *201311141216* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/2c3337758136
User: Libor Fischmeistr <lfischmeistr@netbeans.org>
Log: #237648: When I connect to DB2 database explorer doesnt show me tree with database objects.
Comment 18 Libor Fischmeistr 2014-01-08 10:04:43 UTC
*** Bug 225254 has been marked as a duplicate of this bug. ***