Maury Hammel wrote:
> Glenn:
>
>> My gut feeling is that Maury's idea of including DBMS-specific
>> renderer/editor classes in plugins could work. There is already an
>> interface that the DataType classes need to use (currently only used
>> internally in the core code, but what the heck). We'ld need to add a
>> way for the plug-in to register a class to associate it with a given
>> SQL type code, but that should be easy to do. Then it would be "just" a
>
>
> There would have to be more to it than just have a plug-in registering a
> class based on the Type code, as we've got databases that use the same
> type code for multiple data types (as we saw with the Oracle database).
Given that different DBMSs could use the same code for different data
types, you're probably right. Without looking into it, I'm reasonably
confident that the DB identification and table name could be passed in.
>
> On the other hand, maybe it is. However, the registering class from the
> plug-in, when it is invoked, would have to be sent all the metadata
> information about the column in question, so that it could make
> intelligent decisions about what needs to be done to for that type of
> column -- this would be very important for java.sql.Types.OTHER, but
> would probably still be required for some of the other types as well
> (e.g. precision and scale values for numeric values).
Yup. The DataType components currently take a ColumnDisplayDefinition
object in the constructor, from which they can extract those kinds of
things. If you like, take a look at fw.datasetviewer.cellcomponent
where CellComponentFactory creates instances of DataTypeInteger and
DataTypeString objects. I guess that we would need to put the
constructor definition into IDataTypeComponet, but the basic idea is there.
Something to be careful of is that some/many/all DBMSs do not fill in
that info. At least the ones that I've been playing with don't. Of
course, if you are building a DBMS-specific class, you can check out
what that DBMS provides and use what's available.
>
> > matter of finding people willing to do the codeing and testing. :-)
>
> Yeah, I guess I can volunteer to do some stuff for Oracle, once you've
> got the interface/API nailed down.
>
>
> Maury...
Okay. Don't know when that will be.
Glenn
|