RemoveConnection - Maple Help

Database

 RemoveConnection
 Remove a saved Connection

 Calling Sequence RemoveConnection( name, opts )

Parameters

 name - string; the identifier for the connection to remove opts - (optional) an equation of the form filename=string

Description

 • RemoveConnection deletes the connection associated with identifier name from a file of connections created with calls to Save.
 • RemoveConnection requires that an identifier be specified.  This differs from Save and LoadConnection.  These functions assume an identifier of "default" if one is not given.
 • RemoveConnection accepts one optional argument.
 filename = string
 used to specify the file from which this connection is removed.  When no filename is given, connections will be loaded from "$HOME/maple/toolbox/Database/data/default.con", where$HOME is the value returned by kernelopts( homedir ).

Examples

Create a connection.

 > $\mathrm{driver}≔\mathrm{Database}\left[\mathrm{LoadDriver}\right]\left(\right):$
 > $\mathrm{conn}≔\mathrm{driver}:-\mathrm{OpenConnection}\left(\mathrm{url},\mathrm{name},\mathrm{pass}\right):$

Save the connection to disk using the default file and the default identifier.

 > $\mathrm{conn}:-\mathrm{Save}\left('\mathrm{filename}'="connection.con"\right):$

Close the connection.

 > $\mathrm{conn}:-\mathrm{Close}\left(\right);$$\mathrm{driver}:-\mathrm{Close}\left(\right)$

Remove this connection.

 > $\mathrm{Database}:-\mathrm{RemoveConnection}\left("default",'\mathrm{filename}'="connection.con"\right):$

Attempt to re-establish the connection saved as default.

 > $\mathrm{Database}\left[\mathrm{LoadConnection}\right]\left(\mathrm{password}='\mathrm{hidden}','\mathrm{filename}'="connection.con"\right):$

 Error, (in Database:-LoadConnection) no entry named "default" found in connection.con