Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java

Author dlr
Full name Daniel Rall
Date 2000-10-19 13:38:10 PDT
Message For orthogonal naming, this method would be getUserForName().

davidp at tigris dot org wrote:
>
> User: davidp
> Date: 00/10/19 13:24:36
>
> Modified: java/org/joist/database UserManager.java
> Log:
> Added method getUserByName()
>
> Revision Changes Path
> 1.27 +32 -4 joist/java/org/joist​/database/UserManage​r.java
>
> Index: UserManager.java
> ====================​====================​====================​=======
> RCS file: /cvs/joist/java/org/​joist/database/UserM​anager.java,v
> retrieving revision 1.26
> retrieving revision 1.27
> diff -u -r1.26 -r1.27
> --- UserManager.java 2000/10/17 05:20:22 1.26
> +++ UserManager.java 2000/10/19 20:24:36 1.27
> @@ -62,7 +62,7 @@
> *
> * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
> * @author Leonard Richardson <A HREF="mailto:leonard​r@collab.net">leo​nardr at collab dot net<​/A>
> - * @version $Revision: 1.26 $
> + * @version $Revision: 1.27 $
> *
> * Copyright (c) 1999 dataweb systems, inc.
> * Copyright (c) 1999, 2000 Collab.Net, Inc.
> @@ -143,7 +143,7 @@
> }
>
> /**
> - * Gets a Record for a particular user.
> + * Gets a Record for a particular user by userID.
> *
> * @param connection A JDBC connection.
> * @param userID ID of the user to get.
> @@ -152,11 +152,12 @@
> * @exception DataSetException
> * @exception JoistDatabaseException
> */
> - public Record getUser(Connection connection, String userID)
> + public Record
> + getUser(Connection connection, String userID)
> throws SQLException, DataSetException, JoistDatabaseException
> {
> TableDataSet user = new TableDataSet(connection, TABLE_NAME);
> - user.where("userID="+userID);
> + user.where("userID=" + userID);
> user.fetchRecords();
> if (user != null && user.containsRecord(0))
> {
> @@ -165,6 +166,33 @@
> else
> {
> throw new JoistDatabaseException("No such user " + userID);
> + }
> + }
> +
> + /**
> + * Gets a Record for a particular user by user name.
> + *
> + * @param connection A JDBC connection.
> + * @param name name of the user to get.
> + * @return a TableDataSet with all the users.
> + * @exception SQLException
> + * @exception DataSetException
> + * @exception JoistDatabaseException
> + */
> + public Record
> + getUserByName(Connection connection, String name)
> + throws SQLException, DataSetException, JoistDatabaseException
> + {
> + TableDataSet user = new TableDataSet(connection, TABLE_NAME);
> + user.where("name=" + name);
> + user.fetchRecords();
> + if (user != null && user.containsRecord(0))
> + {
> + return user.getRecord(0);
> + }
> + else
> + {
> + throw new JoistDatabaseException("No such user " + name);
> }
> }
>
>
>
>

--

Daniel Rall <dlr at finemaltcoding dot com>

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java dlr Daniel Rall 2000-10-19 13:38:10 PDT
Messages per page: