Partager via


Microsoft Visual J++

Important

This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Instead, write a fully functional OLE DB provider using the native OLE DB interfaces.

Information and Guidelines

Following is an outline of the basic steps needed to build an OLE DB Simple Provider in Visual J++ 6.0.

To build the OSP component using Visual J++

  1. Create a Java application.

  2. Implement IDataSource on the Java application.

  3. Implement the methods for OLEDBSimpleProvider with the object (at least once).

Registration

Visual J++, when building a COM DLL, will generate the ProgID for the OLE DB Simple Provider Data Object. This ProgID is <Project Name>.<class name of the OSP Data Object>. This is the same way that Visual Basic generates the ProgID.

Programming Notes

  • In Visual J++ implementations, use IDataSource and its methods (such as GetDataMember) to expose the correct OSP implementation to the OLE DB Simple Provider DLL (Msdaosp.dll).

  • When coding data source notifications in Visual J++, use the addDataSourceListener and removeDataSourceListener methods with IDataSource to add and remove DataSource listeners.

    Note

    To run the OSP Java sample, ensure that the virtual machine can locate the sample's compiled class files by adding their location to the Java class path search order. You can use the CLASSPATH environment variable for this purpose.