Microsoft SDK for Java

refresh

This method of the Errors class updates the objects in a collection to reflect objects available from and specific to the provider.

Syntax

public void refresh();

The refresh method accomplishes different tasks depending on the object from which you call it.

Parameters

Using the refresh method on Command object parameters retrieves provider-side parameter information for the stored procedure or parameterized query specified in the Command object. The collection will be empty for providers that do not support stored procedure calls or parameterized queries.

Pass Command.setActiveConnection a valid Connection object, pass Command.setCommandText a valid command, and set CommandType to STOREDPROC before calling the refresh method.

If you access the Parameters object before calling the refresh method, ADO will automatically call the method and populate the collection for you.

Note   If you use the refresh method to obtain parameter information from the provider and it returns one or more variable-length data type Parameter objects, ADO may allocate memory for the parameters based on their maximum potential size, which will cause an error during execution. You should call setSize for these parameters before calling Command.execute to prevent errors.

Fields

Using the refresh method on the Fields collection has no visible effect. To retrieve changes from the underlying database structure, you must use either the Recordset.requery method or, if the Recordset object does not support bookmarks, the moveFirst method.

Properties

Using the refresh method on a Properties collection of some objects populates the collection with the dynamic properties the provider exposes. These properties provide information about functionality specific to the provider, beyond the built-in properties ADO supports.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.