Package net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui

Examples of net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerPrivilege


   * @param groupHeader
   * @return the read privileges
   */
    public static FirebirdManagerPrivilege readPrivileges(ISession session, String userName,
        String relationName, boolean groupHeader) {
      FirebirdManagerPrivilege fbPrivilege = new FirebirdManagerPrivilege();
       
        if (!groupHeader) {
            try {
                Statement stmt = session.getSQLConnection().createStatement();
                ResultSet rs = stmt.executeQuery("Select RDB$PRIVILEGE From RDB$USER_PRIVILEGES" +
                        " Where RDB$USER = '" + userName + "'" +
                        " and RDB$RELATION_NAME = '" + relationName + "'" +
                        " Order By RDB$PRIVILEGE");
                while (rs.next()) {
                    String sValue = rs.getString(1).trim();
                    if (sValue.equals("S"))
                        fbPrivilege.setSelect(true);
                    else if (sValue.equals("I"))
                        fbPrivilege.setInsert(true);
                    else if (sValue.equals("U"))
                        fbPrivilege.setUpdate(true);
                    else if (sValue.equals("D"))
                        fbPrivilege.setDelete(true);
                    else if (sValue.equals("R"))
                        fbPrivilege.setReference(true);
                    else if (sValue.equals("X"))
                        fbPrivilege.setExecute(true);
                    else if (sValue.equals("M"))
                        fbPrivilege.setMember(true);
                } // while (rs.next())
                rs.close();
                stmt.close();
            } catch (SQLException e) {
                log.error(e.getLocalizedMessage());
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerPrivilege

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.