Java Reference
In-Depth Information
Listing 9-6
Explore DME-supported capabilities
1. public void init() throws JDMException {
2. //Create DME connection as shown in Listing 9.1 or 9.2
3. . . .
4. //validate required capabilities to execute this program
5. boolean capabilitiesExist =
dmeConn.supportsCapability(MiningFunction.classification, null, MiningTask. build);
6. if(!capabilitiesExist) //If required capabilities doesn't exist throw exception
7. . . .
8. //Create object factories for the objects in this example
9. . . .
Recall that Table 9-4 lists all support capabilities methods in the
Connection interface for your reference. These methods can be used
by applications to validate a DME's capabilities before actually using
them to ensure application portability across JDM implementations.
Application designers determine how to check capabilities. For
example, an application can check all capabilities required immedi-
ately after connecting to the DME, or can check capabilities just
before using them.
Finding DME and JDM Version Information
Applications may need to find DME and JDM version information to
use capabilities based on a vendor product version. JDM supports the
retrieval of this information using the Connection.getConnectionMeta-
Data method. This method returns an object called resource.Connec-
tionMetaData that encapsulates DME and JDM version information.
Table 9-7 lists the methods in resource.ConnectionMetaData .
Table 9-7
javax.datamining.recorce.ConnectionMetaData interface
getVersion(): String
Returns the version of the JDM standard is supported by the
connected DME.
getProviderVersion(): String
Returns the version of the connected DME. It is typically the
provider's product version.
getProviderName(): String
Returns the JDM implementation product/provider name.
Search WWH ::

Custom Search