ADO Java Sample

Microsoft ActiveX Data Objects (ADO)

ADO Java Sample

ADOJAVA demonstrates how to use ADO from Java and Java/COM integration. It is installed to c:\Platform SDK\Samples\DataAccess\ado\Java.

This sample can be executed as an applet in a browser or as a stand-alone application. It opens an ADO Recordset, displays the current record, and allows the user to click buttons to move through the data. It also shows the usage of command line parameters.

To run ADOJAVA

  1. This sample uses an ODBC DSN called OLE_DB_Nwind_Jet with a user id of Admin and a blank password. Set up an ODBC system DSN on the Web Server computer called OLE_DB_NWind_Jet. Click Start, point to Programs, and point to Administrative Tools. Choose Data Sources (ODBC).

  2. On the System DSN tab, click Add. Select "Microsoft Access Driver (.mdb)" from the list of available drivers. Click Finish.

  3. In the ODBC Microsoft Access Setup dialog box, enter "OLE_DB_NWind_Jet" in the Data Source Name box. In the Description box, enter "MDAC SDK Sample Data."

  4. Under Database, click Select and locate <drive>:\Platform SDK\Samples\DataAccess\ado\xml. Select Nwind.mdb. Click OK.

  5. In the ODBC Microsoft Access Setup dialog box, click OK. Click OK again in the ODBC Data Source Administrator dialog box.

  6. Open the project file, Simpleado.vjp, in Microsoft Visual J++ 6.0 or later.

  7. From the Debug menu, choose Start.

  8. If you want to run in a different mode, from the Project menu, choose simpleado Properties.

  9. On the Launch tab, click the box When project runs, load and select one of the three modes.

  10. Click OK and run as in Step 3 above.