Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dtp-dev] cached server name and version


Hi,
        Given a connection profile, we have 2 ways to get the server name and version info (I'll take version as example):
1. Get it from the cached properties, this is the real version got from the server:
IConnectionProfile.getProperties(ConnectionProfileConstants.PROP_SERVER_VERSION).getProperty(ConnectionProfileConstants.PROP_SERVER_VERSION).
2. Get it from base properties, this is the version declared in driver template:
IConnectionProfile.getBaseProperties().getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);

This difference may cause some confusion for connection profile API clients. Shall we define a unified version retrieving mechanism? e.g. always try to get version from solution 1, and only if it failed, shall we resort to solution 2. The benefit of this mechanism is clients don't have to define almost identical driver templates for different versions of a database. This mechanism is used in SQL Dev Tools now, ProfileUtil.getDatabaseVendorDefinitionId() defines the retrieving logic, while DatabaseVendorDefinitionId defines the version comparison logic (e.g. 15.1 is compatible with 15.x). But I found the ConnectionInfoImpl class just uses solution 2 (always get it from driver template).

Let me know what you think.

Best Regards!

Max ( Hui ) Cao
Sybase, Inc. Shanghai, China

Back to the top