SAMPLE: Spvjado Demonstrates Using Stored Procedures from WFC/ADO/Java

ID: Q206452


The information in this article applies to:
  • Microsoft Visual J++, version 6.0
  • ActiveX Data Objects (ADO), versions 2.0, 2.1, 2.1 SP2


SUMMARY

The Spvjado.exe sample demonstrates using the SQL Server stored procedures from the WFC ADO Java classes. The sample also contains the adoCon class, which is a complete set of the ADO version 2.0 enumerated types as described in the ADO documentation.


MORE INFORMATION

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:

Spvjado.exe
Release Date: Mar-08-1999

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.
SpVJado.exe contains the following files:

File Name Size
adoCon.java 14,680
spVJado.sln 511
spVJado.vjp 4,562
WFCadoSP.java 15,305
Readme.txt 4,000


Upon startup, the sample creates two stored procedures:
  • The first stored procedure is sp_AdoVJin, which takes an input parameter (money) and returns a recordset.


  • The second stored procedure is sp_AdoVJinOutRtn, which also takes a input parameter but includes a output parameter and a return parameter as well.


The sample demonstrates how you must close the returned ADO recordset before you can access the output and return parameters.

The sample also demonstrates ADO's automatic and manual parameter population methods. Each stored procedure uses the value in the edit box next to the label "Sel > Price" as the input parameter. The default value of the edit box is $9.99, but you can enter any value. The "spIN" button opens a forward-only, read-only recordset with the stored procedure sp_AdoVJin.

The "spInOutRtn" button opens a forward-only, read-only recordset with the stored procedure sp_AdoVJinOutRtn. Once you navigate past the end of the recordset (via the Next button), the output and return parameters are displayed.

The spIN2 button opens a read/write recordset using the sp_AdoVJin stored procedure.

Note that the constant identifiers in the class adoCon are the same constant names used in Visual Basic and Visual C++. Although WFC/ADO includes all the ADO constants in the com.ms.wfc.data.AdoTypes class, WFC does not use the same constant names as ADO; this can be confusing for some programmers. For example, from Visual Basic, Visual C++, or the ADO documentation, to choose a client cursor you would use the "adUseClient" constant; however, in WFC you would use "AdoEnums.CursorLocation.CLIENT". If you use adoCon, you can use the same ADO constant names in Visual J++ as you use in Visual C++ or Visual Basic.



© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Rick Anderson, Microsoft Corporation

Additional query words:

Keywords : kbADO200 kbDatabase kbSDKDataAc kbVJ kbGrpMDAC kbDSupport kbADO210sp2
Version : WINDOWS:2.0,2.1,2.1 SP2,6.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.