Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.admin.sql
Class SQLCommands

    java.lang.Object
      oracle.ifs.admin.sql.SQLCommands

    public class SQLCommands

extends java.lang.Object

The SQLCommands class provides methods which perform basic SQL commands. These commands allow clients to create database objects, such as tablespaces and users, query and set database parameters, and more.

Modified:
  dpitfel 06/23/2009 Removed isDbmsOfuscationToolkitPackageAvail., dpitfel 09/18/2008 Introduced isFullTextIndexingEnabled., vakumar 07/18/2007 Removed toUpperCase() from createUser calls, aknatara04/08/2004 Overloaded getUsers and added getRowsWhereColumnMatches, pyoung 08/16/2004 Updated for new 10g connect role security updates., aknatara05/18/2004 Overloaded createTablespace to work with DB_CREATE_FILE_DEST parameter., sgarg 11/08/2001 TBS can start with numbers. So putting TBS in double quotes in createUser method., lsaenz 08/30/2001 Changed getTablespaceNames and getCurrentInstance to work with non-SYS users, lsaenz 08/30/2001 Changed getTablespaceNames and getCurrentInstance to work with non-SYS users, lsaenz 04/10/2001 Changed createUser to take temp tbs; updated comments; cleaned up member names., lsaenz 12/04/2000 Removed get/setSchemaVersion methods., lsaenz 10/12/2000 Updated comments., lsaenz 08/24/2000 Removed get/setUpgradeTaskNumber methods., lsaenz 08/22/2000 Added isIfsSchemaContextEnabled method., lsaenz 07/27/2000 Added createTempUser method., lsaenz 07/26/2000 Modified getLanguage method to query NLS_DATABASE_PARAMETERS rather than NLS_SESSION_PARAMETERS., lsaenz 07/19/2000 Added getStatement method; changed the setConnection method to close any open Statement or ResultSet., lsaenz 07/17/2000 Added get/setUpgradeTaskNumber methods., lsaenz 07/12/2000 Added get/setIfsSchemaVersion methods., lsaenz 06/27/2000 Added getCharacterSet method., lsaenz 04/05/2000 Added changeUserPassword method., lsaenz 03/31/2000 Added getRowsWhereKeyEquals method., lsaenz 03/02/2000 Added getValueWhereKeyEquals method., lsaenz 03/01/2000 Added getUserNames method., lsaenz 02/22/2000 Added isDbmsOfuscationToolkitPackageAvail; add finalizer; call close methods explicitly., lsaenz 02/16/2000 Removed method createTablespace which specifies default tablespace directory for the tablespace file; added reuse parameter to the remaining createTablespace method; removed disconnect method., lsaenz 02/15/2000 Added method isRoleGrantedToUser., lsaenz 01/04/2000 Added method getCurrentInstance., lsaenz 12/21/1999 Added method getParameterValueAsString., lsaenz 12/04/1999 Fixed/updated method getOnlineNonSystemRollbackSegs., lsaenz 12/03/1999 Added more commands..., lsaenz 11/17/1999 Added dropTablespace, etc., lsaenz 11/13/1999 Added more commands..., lsaenz 10/06/1999 Created.

Constructor Summary
`SQLCommands()` Creates a new SQLCommands instance without creating a Connection to the database.
`SQLCommands(java.sql.Connection con)` Creates a new SQLCommands instance, given an existing Connection to a database.

Method Summary
`void` | `changeUserPassword(java.lang.String name, java.lang.String password)` Changes a database user's password.
`void` | `createTablespace(java.lang.String name, int size, java.lang.String init, java.lang.String next, java.lang.String file, boolean reuse)` Creates a tablespace in the database, writing the tablespace file in the directory specified by `file`.
`void` | `createTablespace(java.lang.String name, java.lang.String size, java.lang.String next)` Creates a tablespace in the database without the dbf file name This will work only if the DB_CREATE_FILE_DEST parameter is initialized.
`java.lang.String` | `createTempUser(java.lang.String prefix)` Creates a temporary database user (schema) named T with password (identified by) T (same as the name), where T = `prefix` i where i = {0..n} and n = `Integer.MAX_VALUE - 1`
`void` | `createUser(java.lang.String name, java.lang.String pass)` Creates a user in the database without specifying a default tablespace.
`void` | `createUser(java.lang.String name, java.lang.String pass, java.lang.String tbs, java.lang.String tempTbs)` Creates a user in the database.
`void` | `dropTablespace(java.lang.String name, boolean includeContents, boolean cascade)` Drops a tablespace from the database, optionally using the "including contents" and "cascade constraints" SQL directives.
`void` | `dropUser(java.lang.String name, boolean cascade)` Drops a user from the database, optionally deleting every object the user owns.
`void` | `finalize()` Invokes the close method on any open ResultSet or Statement instances that this SQLCommands has references to.
`java.lang.String` | `getCharacterSet()` Returns the value of the NLS_CHARACTERSET parameter from the NLS_DATABASE_PARAMETERS table.
`java.lang.String` | `getCurrentInstance()` Returns the current instance (service name, or ORACLE_SID) of this Oracle databasse connection.
`java.lang.String` | `getDefaultTablespaceDirectory()` Returns the directory where the default tablespaces are stored, or null if no default tablespaces are found.
`java.lang.String` | `getLanguage()` Returns the value of the NLS_LANGUAGE parameter from the NLS_DATABASE_PARAMETERS table.
`int` | `getOnlineNonSystemRollbackSegs()` Returns the number of online non-system rollback segments.
`int` | `getParameterValueAsInt(java.lang.String param)` Returns the value of a parameter from the `v$parameter` table.
`java.lang.String` | `getParameterValueAsString(java.lang.String param)` Returns the value of a parameter from the `v$parameter` table.
`java.util.Enumeration` | `getRows(java.lang.String column, java.lang.String table, boolean ascending)` Returns an Enumeration containing the row values as Strings in the specified column of the specified table, optionally in in ascending order.
`java.util.Enumeration` | `getRowsWhereColumnEquals(java.lang.String column, java.lang.String table, java.lang.String keyColumn, java.lang.String keyValue)` Returns the row values of a given column in a given table where a certain column in that row has a certain value.
`java.util.Enumeration` | `getRowsWhereColumnMatches(java.lang.String column, java.lang.String table, java.lang.String keyColumn, java.lang.String keyValue)` Returns the row values of a given column in a given table where a certain column in that row matches a certain value.
`java.sql.Statement` | `getStatement()` Returns the Statement used internally by this SQLCommands instance.
`java.lang.String` | `getTablespaceFile(java.lang.String tablespace)` Returns the full filename (including absolute path) of the tablespace file for a given tablespace, or null if the tablespace does not exist.
`java.util.Enumeration` | `getTablespaceNames()` Returns an Enumeration containing the names of every tablespace in the database, in ascending order.
`java.util.Enumeration` | `getUserNames()` Returns an Enumeration containing the names of every user in the database, in ascending order.
`java.util.Enumeration` | `getUserNames(java.lang.String userName)` Returns an Enumeration containing the names of every user in the database filtered based on the username.
`java.lang.String` | `getValueWhereKeyEquals(java.lang.String table, java.lang.String column, java.lang.String key, java.lang.String keyVal)` Executes a SQL query of the following form: `SELECT column FROM table WHERE key = keyVal;`
`void` | `grantConnectResource(java.lang.String name)` Grants connect and resource priviledges to a user in the database.
`void` | `grantPriviledgeToUser(java.lang.String name, java.lang.String priviledge)` Grants a priviledge to a user in the database.
`boolean` | `isContextInstalled()` Returns true if context seems to be installed in the database.
`boolean` | `isFullTextIndexingEnabled()` Gets whether full-text indexing is enabled.
`boolean` | `isIfsSchemaContextEnabled(java.lang.String schema)` Deprecated. use S_Media.getContextEnabledState
`boolean` | `isPartitioningInstalled()` Returns true if the partitioning option seems to be installed in the database.
`boolean` | `isRoleGrantedToUser(java.lang.String username, java.lang.String role)` Determines if a user `username` has been granted the role `role`.
`void` | `setConnection(java.sql.Connection con)` Sets the Connection to the database.
`void` | `setContextPreference(java.lang.String preference, java.lang.String attribute, java.lang.String value)` Sets a context preference attribute to a String value.
`boolean` | `tablespaceExists(java.lang.String tablespace)` Returns true if the given tablespace exists in the database.
`void` | `unlockAlterUserPassword(java.lang.String name, java.lang.String password)` Changes a database user's password and unlocks the user
`boolean` | `userExists(java.lang.String name)` Returns true if the given user exists in the database.

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SQLCommands

    public SQLCommands()

  Creates a new SQLCommands instance without creating a Connection to the database.

### SQLCommands

    public SQLCommands(java.sql.Connection con)
                throws java.sql.SQLException

  Creates a new SQLCommands instance, given an existing Connection to a database.

  Parameters:
    `con` - an existing Connection to a database.
  Throws:
    `java.sql.SQLException` - if an error occurs when trying to use the new Connection.

Method Detail

### setConnection

    public void setConnection(java.sql.Connection con)
                       throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Sets the Connection to the database.

  Parameters:
    `con` - the Connection to use.
  Throws:
    `java.sql.SQLException` - if an error occurs when trying to create a Statement from the new Connection.

### getStatement

    public java.sql.Statement getStatement()

  Description copied from class: `SQLCommands`
  Returns the Statement used internally by this SQLCommands instance.
  Note: Care should be taken NOT to close this Statement, as closing the Statement is handled by this instance of SQLCommands.

  Returns:
    the Statement used internally by this SQLCommands instance, or null if no Connection has been established.

### finalize

    public void finalize()

  Description copied from class: `SQLCommands`
  Invokes the close method on any open ResultSet or Statement instances that this SQLCommands has references to.

  Overrides:
    `finalize` in class `java.lang.Object`

### createTablespace

    public void createTablespace(java.lang.String name,
                                 int size,
                                 java.lang.String init,
                                 java.lang.String next,
                                 java.lang.String file,
                                 boolean reuse)
                          throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Creates a tablespace in the database, writing the tablespace file in the directory specified by `file`.

  Note: tablespaces are always created with UPPERCASE names; however, the tablespace filename is user-defined in this method.

  Note: if the tablespace file already exists, it is reused and the file's previous contents are lost.

  Parameters:
    `name` - the name of the tablespace.
    `size` - the size (in megabytes) of the tablespace.
    `init` - the initial extent size
    `next` - the next extent size
    `file` - the filename (including absolute path) of the tablespace file.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### createTablespace

    public void createTablespace(java.lang.String name,
                                 java.lang.String size,
                                 java.lang.String next)
                          throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Creates a tablespace in the database without the dbf file name This will work only if the DB_CREATE_FILE_DEST parameter is initialized.

  Note: tablespaces are always created with UPPERCASE names; however, the tablespace filename is generated by the database

  Parameters:
    `name` - the name of the tablespace.
    `size` - the size of the tablespace.
    `next` - the next extent size
  Throws:
    `java.sql.SQLException` - if an error occurs.

### dropUser

    public void dropUser(java.lang.String name,
                         boolean cascade)
                  throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Drops a user from the database, optionally deleting every object the user owns.

  Parameters:
    `name` - the user to drop (case-insensitive).
    `cascade` - true if this method should delete every object owned by the user.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### changeUserPassword

    public void changeUserPassword(java.lang.String name,
                                   java.lang.String password)
                            throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Changes a database user's password.

  Parameters:
    `name` - the user whose password to change (case-insensitive).
    `password` - the user's new password.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### unlockAlterUserPassword

    public void unlockAlterUserPassword(java.lang.String name,
                                        java.lang.String password)
                                 throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Changes a database user's password and unlocks the user

  Parameters:
    `name` - the user whose password to change (case-insensitive).
    `password` - the user's new password.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### dropTablespace

    public void dropTablespace(java.lang.String name,
                               boolean includeContents,
                               boolean cascade)
                        throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Drops a tablespace from the database, optionally using the "including contents" and "cascade constraints" SQL directives.

  Parameters:
    `name` - the tablespace to drop (case insensitive).
    `includeContents` - true if "include contents" should be used.
    `cascade` - true if "cascade constraints" should be used.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### createUser

    public void createUser(java.lang.String name,
                           java.lang.String pass)
                    throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Creates a user in the database without specifying a default tablespace.

  Parameters:
    `name` - the user to create (case insensitive).
    `pass` - the password to assign to the user.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### getCurrentInstance

    public java.lang.String getCurrentInstance()
                                        throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the current instance (service name, or ORACLE_SID) of this Oracle databasse connection.

  Throws:
    `java.sql.SQLException` - if an error occurs.

### createUser

    public void createUser(java.lang.String name,
                           java.lang.String pass,
                           java.lang.String tbs,
                           java.lang.String tempTbs)
                    throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Creates a user in the database.

  Parameters:
    `name` - the user to create (case-insensitive).
    `pass` - the password to assign to the user.
    `tbs` - the default tablespace to assign to the user.
    `tempTbs` - the temporary tablespace to assign to the user.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### createTempUser

    public java.lang.String createTempUser(java.lang.String prefix)
                                    throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Creates a temporary database user (schema) named T with password (identified by) T (same as the name),
  where T = `prefix` i
  where i = {0..n}
  and n = `Integer.MAX_VALUE - 1`

  Note: this algorithm will fail if there are already n database users named: `prefix` i.

  Parameters:
    `prefix` - the prefix to use when naming the temporary user.
  Returns:
    the name of the temporary user that was created.
  Throws:
    `java.sql.SQLException` - if a database error occurs, or if this algorithm fails as described above.

### isIfsSchemaContextEnabled

    public boolean isIfsSchemaContextEnabled(java.lang.String schema)
                                      throws java.sql.SQLException

  Deprecated. use S_Media.getContextEnabledState

  Description copied from class: `SQLCommands`
  Returns whether the iFS schema is enabled for interMedia. Executes the following SQL statement:
  `SELECT MAX(indexed) FROM odm_media;`
  Note: this implementation depends on the structure of the iFS repository tables, which are subject to change. In the future, this method may not function properly and will need to be updated.

  Returns:
    true if the iFS schema has been enabled for interMedia.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### grantConnectResource

    public void grantConnectResource(java.lang.String name)
                              throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Grants connect and resource priviledges to a user in the database.

  Parameters:
    `name` - the user to grant the priviledges to (case-insensitive).
  Throws:
    `java.sql.SQLException` - if an error occurs.

### grantPriviledgeToUser

    public void grantPriviledgeToUser(java.lang.String name,
                                      java.lang.String priviledge)
                               throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Grants a priviledge to a user in the database.

  Parameters:
    `name` - the user to grant the priviledge to (case insensitive).
    `priviledge` - the priviledge to grant.
  Throws:
    `java.sql.SQLException` - if an error occurs.

### getParameterValueAsInt

    public int getParameterValueAsInt(java.lang.String param)
                               throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the value of a parameter from the `v$parameter` table. This table includes all paramters from the "init.ora" file.

  Parameters:
    `param` - the name of the parameter to get the value of.
  Returns:
    the value of a parameter from the `v$paramter` table, converted to an int.
  Throws:
    `java.sql.SQLException` - if a database error occurs, or if the given parameter does not exist in the `v$parameter` table, or if the value cannot be converted to an int.

### getParameterValueAsString

    public java.lang.String getParameterValueAsString(java.lang.String param)
                                               throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the value of a parameter from the `v$parameter` table. This table includes all paramters from the "init.ora" file.

  Parameters:
    `param` - the name of the parameter to get the value of.
  Returns:
    the value of a parameter from the `v$paramter` table as a String.
  Throws:
    `java.sql.SQLException` - if a database error occurs, or if the given parameter does not exist in the `v$parameter` table.

### getTablespaceFile

    public java.lang.String getTablespaceFile(java.lang.String tablespace)
                                       throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the full filename (including absolute path) of the tablespace file for a given tablespace, or null if the tablespace does not exist.

  Note: tablespace names are case sensitive.

  Parameters:
    `tablespace` - the name of the tablespace to get the file for.
  Returns:
    the full filename (including absolute path) of the tablespace file for a given tablespace, or null if the tablespace does not exist.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getDefaultTablespaceDirectory

    public java.lang.String getDefaultTablespaceDirectory()
                                                   throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the directory where the default tablespaces are stored, or null if no default tablespaces are found.

  Note: the returned path includes the final file_separator character: i.e. "C:\ORACLE\ORADATA\ONI\" on Windows NT,
  "/data/oracle/oradata/oni/" on Solaris.

  Returns:
    the directory where the 'USERS' tablespace or the 'SYSTEM' tablespace is stored (if 'USERS' is not found), or null if neither of these tablespaces are found.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getCharacterSet

    public java.lang.String getCharacterSet()
                                     throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the value of the NLS_CHARACTERSET parameter from the NLS_DATABASE_PARAMETERS table.

  Returns:
    the value of the NLS_CHARACTERSET parameter, or null if it has no value.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getLanguage

    public java.lang.String getLanguage()
                                 throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the value of the NLS_LANGUAGE parameter from the NLS_DATABASE_PARAMETERS table.

  Returns:
    the value of the NLS_LANGUAGE parameter, or null if it has no value.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### setContextPreference

    public void setContextPreference(java.lang.String preference,
                                     java.lang.String attribute,
                                     java.lang.String value)
                              throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Sets a context preference attribute to a String value.

  Parameters:
    `preference` - the context preference to modify.
    `attribute` - the specific attribute to set.
    `value` - the value to set the parameter to.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### isContextInstalled

    public boolean isContextInstalled()
                               throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns true if context seems to be installed in the database. The way this method checks for context is pretty simple: it just queries the view 'CTX_VERSION' in `dba_views`. If the view exists, then context is assumed to be installed.

  Returns:
    true if context seems to be installed.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### isFullTextIndexingEnabled

    public boolean isFullTextIndexingEnabled()
                                      throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Gets whether full-text indexing is enabled.

  Returns:
    whether full-text indexing is enabled
  Throws:
    `java.sql.SQLException` - if the operation fails
  (Unpublished)

### isPartitioningInstalled

    public boolean isPartitioningInstalled()
                                    throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns true if the partitioning option seems to be installed in the database.

  The way this method checks for partitioning is pretty simple: it just queries the parameter 'partitioning' in `v$option`. If the value is 'true', then partitioning is assumed to be installed.

  Returns:
    true if partitioning seems to be installed.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### tablespaceExists

    public boolean tablespaceExists(java.lang.String tablespace)
                             throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns true if the given tablespace exists in the database. This method simply checks for the existance of the tablespace in the `dba_tablespaces` table.

  Note: the `tablespace` parameter is converted to uppercase.

  Parameters:
    `tablespace` - the tablespace to check the existence of.
  Returns:
    true if the given tablespace exists in the database.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getOnlineNonSystemRollbackSegs

    public int getOnlineNonSystemRollbackSegs()
                                       throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the number of online non-system rollback segments. For iFS, this number must be at least 1.

  Returns:
    the number of online non-system rollback segments.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### isRoleGrantedToUser

    public boolean isRoleGrantedToUser(java.lang.String username,
                                       java.lang.String role)
                                throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Determines if a user `username` has been granted the role `role`.

  Note: the given username and role name are always converted to UPPERCASE.

  Returns:
    true if the user has been granted the given role.
  Throws:
    `java.sql.SQLException` - if a database error occurs.
  (Unpublished)

### getTablespaceNames

    public java.util.Enumeration getTablespaceNames()
                                             throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns an Enumeration containing the names of every tablespace in the database, in ascending order.

  Returns:
    an Enumeration containing the names of every tablespace in the database, or null if no tablespaces are found.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getUserNames

    public java.util.Enumeration getUserNames()
                                       throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns an Enumeration containing the names of every user in the database, in ascending order.

  Returns:
    an Enumeration containing the names of every user in the database, or null if no users are found.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getUserNames

    public java.util.Enumeration getUserNames(java.lang.String userName)
                                       throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns an Enumeration containing the names of every user in the database filtered based on the username.

  Parameters:
    `userName` - user name string used to filter the list of users
  Returns:
    an Enumeration containing the names of every user in the database, or null if no users are found.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getRows

    public java.util.Enumeration getRows(java.lang.String column,
                                         java.lang.String table,
                                         boolean ascending)
                                  throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns an Enumeration containing the row values as Strings in the specified column of the specified table, optionally in in ascending order.

  Returns:
    an Enumeration containing row values as Strings for the specified column of the specified table.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getRowsWhereColumnEquals

    public java.util.Enumeration getRowsWhereColumnEquals(java.lang.String column,
                                                          java.lang.String table,
                                                          java.lang.String keyColumn,
                                                          java.lang.String keyValue)
                                                   throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the row values of a given column in a given table where a certain column in that row has a certain value. Executes the following SQL command:
  `SELECT column FROM table WHERE keyColumn = keyValue`

  Returns:
    an Enumeration containing row values as Strings.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getRowsWhereColumnMatches

    public java.util.Enumeration getRowsWhereColumnMatches(java.lang.String column,
                                                           java.lang.String table,
                                                           java.lang.String keyColumn,
                                                           java.lang.String keyValue)
                                                    throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns the row values of a given column in a given table where a certain column in that row matches a certain value. Executes the following SQL command:
  `SELECT column FROM table WHERE keyColumn like %keyValue%`

  Returns:
    an Enumeration containing row values as Strings.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### getValueWhereKeyEquals

    public java.lang.String getValueWhereKeyEquals(java.lang.String table,
                                                   java.lang.String column,
                                                   java.lang.String key,
                                                   java.lang.String keyVal)
                                            throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Executes a SQL query of the following form:
  `SELECT column FROM table WHERE key = keyVal;`

  Parameters:
    `table` - the table to select from.
    `column` - the column to select.
    `key` - the column to use as the key for the where clause.
    `keyVal` - the String value to use in the where clause.
  Returns:
    a String representation of the result of the SQL query.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

### userExists

    public boolean userExists(java.lang.String name)
                       throws java.sql.SQLException

  Description copied from class: `SQLCommands`
  Returns true if the given user exists in the database.
  Note: the `name` parameter is converted to uppercase.

  Parameters:
    `name` - the name of the user to check for.
  Returns:
    true if the given user exists in the database.
  Throws:
    `java.sql.SQLException` - if a database error occurs.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD