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 84654 - Oracle database connection fail to display tables
Summary: Oracle database connection fail to display tables
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: John Baker
URL:
Keywords:
: 86616 86857 87335 87599 88358 88701 89948 90922 90951 92938 93094 96613 97833 99720 104117 105669 109951 114431 120102 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-09-11 23:38 UTC by liwang
Modified: 2008-04-07 14:22 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
oracle jdbc driver (1.13 MB, application/octet-stream)
2006-09-11 23:39 UTC, liwang
Details
diff of fix (1.16 KB, text/plain)
2007-11-02 09:14 UTC, John Baker
Details
screenshot showing Oracle connections (18.53 KB, image/gif)
2007-11-02 09:20 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description liwang 2006-09-11 23:38:42 UTC
Reproduce steps:
    In Netbeans Runtime, do the following steps to add Oracle database connection:
  1. add Oracle Driver (attached the driver jar file)
  2. add the oracle connection successfully by given:
       URL: jdbc:oracle:thin:@jws-cust-880-1.red.iplanet.com:1523:ORA9201
       User: admintest
       Password: admintest
  3.  I add  tables, by either SQL statement or from create table action of
tables node. Table got successfully created.
  But under Tables node there is no table display. If I click refresh, a small
error window popup and says "Unable to refresh children, connection is broken;
Unsupported feature".
Comment 1 liwang 2006-09-11 23:39:18 UTC
Created attachment 33795 [details]
oracle jdbc driver
Comment 2 _ ludo 2006-09-12 01:44:39 UTC
db
Comment 3 Andrei Badea 2006-09-12 14:38:54 UTC
I can reproduce the issue with the attached driver, but not with the 10.2.0.1.0
driver. Please try again with that version or with the current (10.2.0.2). 

An exception is also thrown when trying to browse the li_test2 table, but that
is already described in issue 75616. Best not to use quoted identifiers if possible.
Comment 4 Andrei Badea 2006-10-10 15:23:08 UTC
*** Issue 86857 has been marked as a duplicate of this issue. ***
Comment 5 Andrei Badea 2006-10-10 15:24:26 UTC
*** Issue 86616 has been marked as a duplicate of this issue. ***
Comment 6 asleson 2006-10-10 15:26:06 UTC
Isn't this a regression if it works OK for me using NetBeans 5.0 RC1 and the
Oracle 9 driver?  I can probably use the 10.2 driver, but there must be a
regression somewhere.
Comment 7 Andrei Badea 2006-10-13 14:51:19 UTC
It could be considered a regression, but note that NetBeans is just calling a
JDBC 3.0 method (which the 9.x driver does not support) -- it does so in order
to implement enhancement issue 76953. And JDBC 3.0 has been around for more than
four years and NetBeans has not required it until now.
Comment 8 Andrei Badea 2006-10-17 17:48:31 UTC
*** Issue 87335 has been marked as a duplicate of this issue. ***
Comment 9 Andrei Badea 2006-10-20 10:18:44 UTC
*** Issue 87599 has been marked as a duplicate of this issue. ***
Comment 10 wvreeven 2006-10-20 10:36:17 UTC
I ran into the same issue and can confirm that the NetBeans table explorer (with
which I had this problem) works fine with the Oracle 10.1.2 database driver
(ojdbc14.jar). I wasn't aware about NetBeans' requirement for a JDBC3 driver,
probably my bad. A nicer error handling would be very much appreciated here.
Perhaps an explanation or warning could be shown when registering the driver
with NetBeans so the user doesn't run into problems?


Greets, Wouter van Reeven
Comment 11 Andrei Badea 2006-11-08 10:14:26 UTC
*** Issue 88701 has been marked as a duplicate of this issue. ***
Comment 12 Andrei Badea 2006-11-16 15:52:14 UTC
*** Issue 89370 has been marked as a duplicate of this issue. ***
Comment 13 John Baker 2006-11-22 05:55:09 UTC
just an fyi:
I'm using odbc14.jar version 10.2.0.2.0 to connect to Oracle 9i, successfully
Comment 14 Andrei Badea 2006-11-23 17:01:11 UTC
*** Issue 89948 has been marked as a duplicate of this issue. ***
Comment 15 Andrei Badea 2006-12-12 13:15:08 UTC
*** Issue 90922 has been marked as a duplicate of this issue. ***
Comment 16 Andrei Badea 2006-12-12 13:17:56 UTC
*** Issue 90951 has been marked as a duplicate of this issue. ***
Comment 17 Andrei Badea 2007-01-03 16:06:22 UTC
*** Issue 90159 has been marked as a duplicate of this issue. ***
Comment 18 Andrei Badea 2007-01-04 15:12:53 UTC
*** Issue 88358 has been marked as a duplicate of this issue. ***
Comment 19 Petr Blaha 2007-01-22 11:58:16 UTC
*** Issue 92938 has been marked as a duplicate of this issue. ***
Comment 20 Andrei Badea 2007-01-31 13:45:32 UTC
*** Issue 93094 has been marked as a duplicate of this issue. ***
Comment 21 Andrei Badea 2007-02-27 09:20:35 UTC
*** Issue 96613 has been marked as a duplicate of this issue. ***
Comment 22 Andrei Badea 2007-02-27 09:23:20 UTC
Re desc11: perhaps the right way to solve this issue would be to catch the
"Unsupported feature" SQLException thrown by a non-JDBC 3.0 driver when calling
DatabaseMetaData.getDatabaseMajorVersion().
Comment 23 Andrei Badea 2007-03-15 13:24:59 UTC
*** Issue 97833 has been marked as a duplicate of this issue. ***
Comment 24 Andrei Badea 2007-04-03 10:15:44 UTC
*** Issue 99720 has been marked as a duplicate of this issue. ***
Comment 25 Andrei Badea 2007-06-05 13:35:38 UTC
*** Issue 105669 has been marked as a duplicate of this issue. ***
Comment 26 David Vancouvering 2007-06-05 18:14:28 UTC
Andrea - it looks like a lot of people are hitting this.  Perhaps we should
increase the priority and see what we can to notify people to upgrade their driver?
Comment 27 David Vancouvering 2007-06-05 18:14:55 UTC
Sorry, I meant Andrei, not Andrea :(
Comment 28 Andrei Badea 2007-06-06 09:31:22 UTC
No need to, see desc23.
Comment 29 David Vancouvering 2007-06-06 18:47:09 UTC
I looked at desc23.  It says "catch the exception."  But what are you going to
do when you catch it?  Has this been implemented already?
Comment 30 _ jimdavidson 2007-06-06 19:43:48 UTC
It looks like the SQLExceptions are all caught eventually.  Unfortunately, the
default reporting behavior may be to print out the message from the exception,
which in this case is something like "Unsupported feature".   That's where we
would want to detect the problem (probably based on something like the SQLState
of the exception), and give a more meaningful message.

Comment 31 Andrei Badea 2007-06-07 13:02:41 UTC
We could have a way to warn the user that the driver should be updated. The
warning should happen early, for example in the new connection dialog. But that
should be an enhancement and not the point of this issue.

In this issue we can just catch and ignore this particular exception. Look at
the code. The code tries to find the database version in order to avoid
displaying the tables in the Recycle Bin on Oracle 10. If the SQLException is
thrown while calling getDatabaseMajorVersion(), we can just log it and set
recycleBinTables to an empty list.
Comment 32 David Vancouvering 2007-06-07 16:42:02 UTC
Hi, Andrei.  That sounds like a good solution.  In terms of the more general
enhancement, I have logged an issue for that, see
http://www.netbeans.org/issues/show_bug.cgi?id=105684 
Comment 33 jbarnett 2007-06-14 20:55:21 UTC
I have a situation where "unable to display table" occurs, but only when using a "foreign" schema.  "Native" tables can
be browsed normally.  The error reported from oracle is ora-01031: insufficient privileges".  Selects and views of the
foreign tables work, and the views can be browsed in the table viewer.  This occurs with the ojdbc14 driver installed. 
I'm wondering if this is also related to the dependency mentioned earlier on the JDBC3 interface.
Comment 34 Andrei Badea 2007-06-18 13:46:30 UTC
*** Issue 104117 has been marked as a duplicate of this issue. ***
Comment 35 _ jimdavidson 2007-07-02 20:20:43 UTC
Besides the main issue ("unsupported feature") there were problems in CachedRowSetXImpl (in VisualWebPack), caused by
limitations in the Oracle 9 drivers.  I checked in a fix to those other problems, to be ready if the main issue is
addressed.
Comment 36 _ jimdavidson 2007-07-11 21:20:11 UTC
Added a check for an unsupported method (getDatabaseMajorVersion) in older Oracle9 drivers.  Newer Oracle9 drivers
(e.g., 9.2.0.8) do not have the problem. 

Users should still use the Oracle10 drivers if possible, which are more complete.
Comment 37 _ jimdavidson 2007-07-12 17:34:20 UTC
Commit log:

Checking in TableListNodeInfo.java;
/cvs/db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java,v  <--  TableListNodeInfo.java
new revision: 1.31; previous revision: 1.30
done
Comment 38 Andrei Badea 2007-07-17 10:51:54 UTC
It seems that some older Oracle drivers implement the JDBC 3.0 methods, but throw an SQLException for them. You worked
around that case. But users also use non-JDBC 3.0 drivers (e.g., classes12.zip version 9.0.1), which throw an
AbstractMethodError. See e.g. issue 109951. You probably need to work around that as well. And also please log the
exception instead of just silently swallowing it.
Comment 39 Andrei Badea 2007-07-17 10:52:35 UTC
*** Issue 109951 has been marked as a duplicate of this issue. ***
Comment 40 _ jimdavidson 2007-09-01 07:54:33 UTC
*** Issue 114431 has been marked as a duplicate of this issue. ***
Comment 41 John Baker 2007-11-02 08:26:21 UTC
Sorry, I missed this bug.  Maybe this should be a P2

At minimum, I can throw an exception (instead of swallowing it) when using the older Oracle driver, classes12.zip

I see that the deprecated method to determine the driver version is
dmd.getDriverMajorVersion()

I could add a condition for this but I'm not sure what to do if the version is less than Oracle 10
Comment 42 John Baker 2007-11-02 09:11:11 UTC
After testing both classes12.zip and ojdbc14.jar with Oracle 9 and Oracle10g servers, there's no need to check for
database version.  There is an extra step to execute a query for filtering out tables created in the Recycle Bin, but
no noticeable performance hit.

Since there's no need to check for Database version no need to catch exceptions.

Diff is attached.  Now tables from Oracle 9 and Oracle 10 databases can be accessed using classes12.zip and ojdbc14.jar
Comment 43 John Baker 2007-11-02 09:14:38 UTC
Created attachment 52338 [details]
diff of fix
Comment 44 John Baker 2007-11-02 09:15:54 UTC
Fixed

Checking in db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java;
/cvs/db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java,v  <--  TableListNodeInfo.java
new revision: 1.34; previous revision: 1.33
done
Comment 45 John Baker 2007-11-02 09:20:56 UTC
Created attachment 52339 [details]
screenshot showing Oracle connections
Comment 46 Andrei Badea 2007-11-02 11:36:59 UTC
By the way, what is the point in posting a diff with the fix for an hour or so before the commit? Is that for review
purposes? If so, suggest doing that by e-mail (assuming David is now the only one who can review in your time zone) and
only using IZ if you expect feedback from a larger audience -- in which case you should allow for more time before the
planned commit.
Comment 47 John Baker 2007-11-02 17:33:07 UTC
Even though the fix appears to work, older databases may not parse the query to filter tables in the RECYCLE BIN
Comment 48 John Baker 2007-11-02 17:36:49 UTC
If classes12.zip is registered (older version) then after establishing a connection, tables cannot be accessed and an
AbstractMethodError exception is thrown
Comment 49 John Baker 2007-11-03 00:40:47 UTC
Fixed
 Now tables from Oracle 9 and 10 servers can be accessed using the older classes12.zip driver
 
 Also logged warnings when older Oracle drivers are used to access database tables from the database connection
 

Checking in db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java;
/cvs/db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java,v  <--  TableListNodeInfo.java
new revision: 1.36; previous revision: 1.35
done
Comment 50 John Baker 2007-11-03 00:46:43 UTC
Somehow I changed the warning from WARNING to SEVERE

Fixing this
Checking in db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java;
/cvs/db/src/org/netbeans/modules/db/explorer/infos/TableListNodeInfo.java,v  <--  TableListNodeInfo.java
new revision: 1.37; previous revision: 1.36
done
Comment 51 David Vancouvering 2007-11-03 03:12:17 UTC
*** Issue 120858 has been marked as a duplicate of this issue. ***
Comment 52 Andrei Badea 2008-04-07 14:22:55 UTC
*** Issue 120102 has been marked as a duplicate of this issue. ***