Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dtp-dev] Delivery for BZ151739: Automatically populate driver class when driver jars are selected

Hi all...

This is to let you know that I've delivered a fix to Connectivity for
BZ151739: Automatically populate driver class when driver jars are
selected.

I Have implemented a number of new things to get this working (and fixed
some existing issues with creating property descriptors also).

1) All custom property descriptors must implement a zero-argument
constructor for their property descriptor class. This constructor should
call the super constructor and pass an id and display name.

As an example, the new DriverClassBrowsePropertyDescriptor uses this as
it's zero-argument constructor:

 private static String DRIVER_CLASS_PROP_ID =
"org.eclipse.datatools.connectivity.db.driverClass"; //$NON-NLS-1$

 public DriverClassBrowsePropertyDescriptor() {
  super(DRIVER_CLASS_PROP_ID,

ConnectivityUIPlugin.getDefault().getResourceString("DriverClassBrowsePropertyDescriptor.property.label"));
 //$NON-NLS-1$
 }

2) If the custom property descriptor needs information from the driver
instance, it must implement the new interface
org.eclipse.datatools.connectivity.drivers.IDriverInstancePropertyDescriptor.
 This interface allows you to pass the Driver Instance to your descriptor
when it is instantiated in the Edit Driver Definition dialog.

3) The new DriverClassBrowsePropertyDescriptor is only accessible currently
in the Generic JDBC driver. If you create a new Generic JDBC driver and
select the driver class property, you will see a new little "..." button to
the right. Select it, and if there are any jars in the jar list, it will be
searched for any classes implementing java.sql.Driver and provide a list.
You can then select one and click OK and it will use that class name for
the property.

Note that any other driver template can use this property descriptor for
the driver class property in their own drivers.

Thanks.
--Fitz

Brian Fitzpatrick
Senior Software Engineer/DTP Committer
Sybase, Inc.



Back to the top