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.
DataDirect jdbc drivers (DB2, Oracle, Sybase, MS SQL Server) don't work in Java Studio Enterprise 8 (Buzz) after changes made in DatabaseConnection. See bug CR 6250647 "can not establish connection to DataDirect drivers" in Bugster and cvs log: ---------------------------- revision 1.34 date: 2005/03/25 15:07:52; author: nnguyen; state: Exp; lines: +42 -17 issue 56861 Use service lookup for OpenConnectionInterface ---------------------------- I've investigated source code and found that invoking of 'New Database Connection' dialog (select a driver and call 'Connect Using...' item) runs default constructor of DatabaseConnection. In previous version (1.32) it was /** Default constructor */ public DatabaseConnection() { propertySupport = new PropertyChangeSupport(this); // For Java Studio Enterprise. Create instanceof OpenConnection try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); openConnection = (OpenConnectionInterface) Class.forName(bundle.getString("CLASS_open_connection"), true, cl).newInstance(); } catch(Exception ex) { org.openide.ErrorManager.getDefault().notify(ex); } } where openConnection variable was set by my implementation com.sun.tools.dbdrivers.JseOpenConnection which sets/resets password for unlocking driver. But now constructor is: /** Default constructor */ public DatabaseConnection() { propertySupport = new PropertyChangeSupport(this); openConnection = new OpenConnection(); } where openConnection is empty default implementation. /** Default constructor */ public DatabaseConnection() { propertySupport = new PropertyChangeSupport(this); // For Java Studio Enterprise. Create instanceof OpenConnection try { Collection c = getOpenConnections(); for (Iterator i=c.iterator(); i.hasNext();) { OpenConnectionInterface oci = (OpenConnectionInterface) i.next(); openConnection = oci; break; } } catch(Exception ex) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); } } It seems not a good patch but might be fast way to solve the problem.
My overlook, not alerted enough when changing the defautl constructor. I have a better fix. Will post a patch, checkin trunk and wait for release41 approval.
Created attachment 21435 [details] Patched DatabaseConnection.java
The patch is tested against Oracle in Buzz environement. Also tested against NetBeans PointBase driver and connection. Checked in to trunk. Checking in src/org/netbeans/modules/db/explorer/DatabaseConnection.java; /cvs/db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java,v <-- DatabaseConnection.java new revision: 1.36; previous revision: 1.35 Needs reviews@netbeans.org for release41 integration. Ludo is offering to take care of this. Thanks. Vladimir (Yaroslavskiy) please help test in Buzz against other drivers. Thanks.
41_HR_FIX keyword added
Verified against DB2, Oracle
This fix does not introduce regression in our sun resources zero config area, so it is safe, so far.
Petre B, can you please verify that this does not break anything?
OK, I will test it more thoroughly.
verified in build 200504101930 against MS SQL
integrated into 41 branch. Ludo
v