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: | Oracle database connection fail to display tables | ||
---|---|---|---|
Product: | db | Reporter: | liwang <liwang> |
Component: | Code | Assignee: | John Baker <jbaker> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | pjiricka |
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
oracle jdbc driver
diff of fix screenshot showing Oracle connections |
Description
liwang
2006-09-11 23:38:42 UTC
Created attachment 33795 [details]
oracle jdbc driver
db 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. *** Issue 86857 has been marked as a duplicate of this issue. *** *** Issue 86616 has been marked as a duplicate of this issue. *** 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. 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. *** Issue 87335 has been marked as a duplicate of this issue. *** *** Issue 87599 has been marked as a duplicate of this issue. *** 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 *** Issue 88701 has been marked as a duplicate of this issue. *** *** Issue 89370 has been marked as a duplicate of this issue. *** just an fyi: I'm using odbc14.jar version 10.2.0.2.0 to connect to Oracle 9i, successfully *** Issue 89948 has been marked as a duplicate of this issue. *** *** Issue 90922 has been marked as a duplicate of this issue. *** *** Issue 90951 has been marked as a duplicate of this issue. *** *** Issue 90159 has been marked as a duplicate of this issue. *** *** Issue 88358 has been marked as a duplicate of this issue. *** *** Issue 92938 has been marked as a duplicate of this issue. *** *** Issue 93094 has been marked as a duplicate of this issue. *** *** Issue 96613 has been marked as a duplicate of this issue. *** 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(). *** Issue 97833 has been marked as a duplicate of this issue. *** *** Issue 99720 has been marked as a duplicate of this issue. *** *** Issue 105669 has been marked as a duplicate of this issue. *** 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? Sorry, I meant Andrei, not Andrea :( No need to, see desc23. 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? 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. 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. 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 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. *** Issue 104117 has been marked as a duplicate of this issue. *** 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. 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. 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 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. *** Issue 109951 has been marked as a duplicate of this issue. *** *** Issue 114431 has been marked as a duplicate of this issue. *** 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 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 Created attachment 52338 [details]
diff of fix
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 Created attachment 52339 [details]
screenshot showing Oracle connections
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. Even though the fix appears to work, older databases may not parse the query to filter tables in the RECYCLE BIN If classes12.zip is registered (older version) then after establishing a connection, tables cannot be accessed and an AbstractMethodError exception is thrown 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 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 *** Issue 120858 has been marked as a duplicate of this issue. *** *** Issue 120102 has been marked as a duplicate of this issue. *** |