Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

MyCrmUserManagerDBQuery.java

00001 /*
00002  * Created on 21 janv. 2004
00003  *
00004  * To change the template for this generated file go to
00005  * Window>Preferences>Java>Code Generation>Code and Comments
00006  */
00007 package org.openmobileis.examples.mycrm.data.jdbc;
00008 
00009 import java.sql.ResultSet;
00010 
00011 import org.openmobileis.common.context.ApplicationContext;
00012 import org.openmobileis.common.context.ApplicationContextManager;
00013 import org.openmobileis.common.util.database.AbstractQueryManager;
00014 import org.openmobileis.common.util.exception.DatabaseException;
00015 import org.openmobileis.common.util.exception.ServiceException;
00016 
00023 public class MyCrmUserManagerDBQuery extends AbstractQueryManager {
00024 
00025         protected static String queryGetUserId = "SELECT code_rep FROM user where login='%0%' AND password='%1%'";
00026         protected static String queryValidateUser = "SELECT code_rep FROM user where code_rep='%0%'";
00027  
00028         private static  String queryGetUser = "SELECT code_rep, login, password FROM user WHERE code_rep='%0%'";
00029 
00030         protected static String queryUpdateUser = "UPDATE user " 
00031                 +"SET login='%0%',      password='%1%' "
00032                 +" WHERE code_rep='%2%'";
00033 
00037   public MyCrmUserManagerDBQuery() {
00038     super();
00039   }
00040 
00041         /* (non-Javadoc)
00042          * @see org.openmobileis.commonserver.database.AbstractQueryManager#create(java.lang.String[])
00043          */
00044         public void create(String[] parameters) throws ServiceException {
00045                 throw new UnsupportedOperationException("can't create user, create representant instead");
00046         }
00047 
00048         /* (non-Javadoc)
00049          * @see org.openmobileis.commonserver.database.AbstractQueryManager#delete(java.lang.String[])
00050          */
00051         public void delete(String[] parameters) throws ServiceException {
00052                 throw new UnsupportedOperationException("can't delete user, delete representant instead");
00053         }
00054 
00055         /* (non-Javadoc)
00056          * @see org.openmobileis.commonserver.database.AbstractQueryManager#update(java.lang.String[])
00057          */
00058         public void update(String[] parameters) throws DatabaseException {
00059                 this.executeUpdate(MyCrmUserManagerDBQuery.queryUpdateUser, parameters);
00060         }
00061   
00062         public ResultSet getUserIDWithloginPass (String parameters[]) throws DatabaseException {
00063                  return (this.executeQuery(queryGetUserId, parameters));
00064          }
00065   
00066         public ResultSet getValidateUserID (String parameters[]) throws DatabaseException {
00067                  return (this.executeQuery(queryValidateUser, parameters));
00068          }
00069   
00070         public ResultSet getUser (String parameters[]) throws DatabaseException {
00071                  return (this.executeQuery(queryGetUser, parameters));
00072          }
00073 
00074 }

Generated on Mon Jul 10 10:29:31 2006 for OpenMobileIS by  doxygen 1.4.4