Class Hierarchy    Previous  Next  Index

Class COM.cloudscape.database.UserUtility

java.lang.Object
    |
    +----COM.cloudscape.database.UserUtility

public abstract class UserUtility
extends java.lang.Object
Copyright © 1998-2000, Informix Software, Inc. All rights reserved.

This utility class provides static methods for managing users and their authorization in a Cloudscape database.

The methods in this class can only be used within an SQL-J statement. Using the methods in application-side Java code results in Exceptions being thrown.

Cloudscape reserves the right to change, rename, or remove this interface at any time.


Variable Index

 o FULL_ACCESS_PERMISSION
Enumeration value for full access permission ("FULL_ACCESS_PERMISSION").
 o READ_ACCESS_PERMISSION
Enumeration value for read access permission ("READ_ACCESS_PERMISSION").

Method Index

 o add(String, String)
Add a user to the database.
 o drop(String)
Drop a user from the database.
 o getPermission(String)
Return a user's permission in a database.
 o set(String, String)
Set the permission for a user in the database.

Field Detail

 o READ_ACCESS_PERMISSION
public static final java.lang.String READ_ACCESS_PERMISSION
          Enumeration value for read access permission ("READ_ACCESS_PERMISSION").
 o FULL_ACCESS_PERMISSION
public static final java.lang.String FULL_ACCESS_PERMISSION
          Enumeration value for full access permission ("FULL_ACCESS_PERMISSION").

Method Detail

 o add
public static final void add(java.lang.String userName,
                             java.lang.String permission) throws java.sql.SQLException
          Add a user to the database.

Only users with FULL_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
permission - READ_ACCESS_PERMISSION or FULL_ACCESS_PERMISSION.
Throws:
java.sql.SQLException - thrown if this fails.
 o set
public static final void set(java.lang.String userName,
                             java.lang.String permission) throws java.sql.SQLException
          Set the permission for a user in the database.

Only users with FULL_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
permission - READ_ACCESS_PERMISSION or FULL_ACCESS_PERMISSION.
Throws:
java.sql.SQLException - thrown if this fails.
 o drop
public static final void drop(java.lang.String userName) throws java.sql.SQLException
          Drop a user from the database.

Only users with FULL_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
Returns:
if the user existed in the database and was dropped return true. If the user did not exist in the database to start with return false.
Throws:
java.sql.SQLException - thrown if this fails or the user being dropped does not exist.
 o getPermission
public static final java.lang.String getPermission(java.lang.String userName) throws java.sql.SQLException
          Return a user's permission in a database.

Users with FULL_ACCESS_PERMISSION or READ_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
Returns:
FULL_ACCESS_PERMISSION if the user is in "cloudscape.database.fullAccessUsers", READ_ACCESS_PERMISSION if the user is in "cloudscape.database.readOnlyAccessUsers", or null if the user is not in either list.
Throws:
java.sql.SQLException - thrown if this fails.

  Class Hierarchy    Previous  Next  Index