Package org.firebirdsql.management

Examples of org.firebirdsql.management.FBUserManager


     * @param session session to connect to FirebirdUserManager
     * @return list with all firebird users
     */
    @SuppressWarnings("unchecked")
    public static List<FBUser> getFirebirdUserList(ISession session) {
      FBUserManager fbUserManager = new FBUserManager();
      fbUserManager.setHost(FirebirdManagerHelper.getHost(session.getAlias().getUrl()));
      fbUserManager.setPort(FirebirdManagerHelper.getPort(session.getAlias().getUrl()));
      fbUserManager.setUser(session.getAlias().getUserName());
      fbUserManager.setPassword(session.getAlias().getPassword());
    ArrayList<FBUser> listFBUser = new ArrayList<FBUser>();

      try {
      IscSvcHandle iscSvcHandle = fbUserManager.attachServiceManager(fbUserManager.getGds());
      Map<String,FBUser> mapUsers = null;
      try {
        mapUsers = fbUserManager.getUsers();
      } catch (Exception e) {
        log.error(e.getLocalizedMessage());
      }

      Collection<FBUser> listUsers = mapUsers.values();
      for (Iterator iter = listUsers.iterator(); iter.hasNext();) {
        listFBUser.add((FBUser) iter.next());
      }

      fbUserManager.detachServiceManager(fbUserManager.getGds(), iscSvcHandle);
      iscSvcHandle = null;
    } catch (GDSException e) {
      log.error(e.getLocalizedMessage());
    }
     
View Full Code Here

TOP

Related Classes of org.firebirdsql.management.FBUserManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.