Extracting Permissions from database in JAAS

I am working on enterprise application where we want to implement JAAS and extract the permissions and roles from the data base but not from the policy file.Can any body post me the solution.

Hi, raghave66!
You should read the documents below.
http://java.sun.com/j2se/1.4/docs/guide/security/PolicyFiles.html
You'll have to create your own Policy Class instead of
using default com.sun.security.auth.PolicyFile.class
regards,
kt

Similar Messages

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

  • How to extract data from database to XSLT?

    I want to generate a report by XSLT, but the data is extracted from the database. I will use Access/SQL server for my database. Can i write SQL in XSLT to extract data from database? Have any sample code or reference website to show how it work?
    THX

    for example: "SELECT code, name FROM TABLE FOR XML RAW"
    String xml = null;
    if(rs.next()){
      xml = rs.getString(1);
    }You will get xml string something like this:
    <row empID="1234"/><row empID="1235"/>
    You can construct a DOM using this xml data and operate on it.
    However you may explore more on resulting xml format.
    A different SQL Query (rather than using XML RAW) may give output in a more desired format.

  • Extract data from database to xml ?

    is there any API, classes or tools ready to extract data from oracle database and generate xml files, Instead to implement a DOM class and build little by little the xml file??
    thanks for every info in advance.

    Yes, download the Oracle XML Development Kit from Oracle's website and look at the documentation of the XML-SQL Utility.

  • Extract HTML from database

    How can i extract data from a database that has html or
    coldfusion language in it. My browser keeps trying to process it. I
    want to display it as raw text.

    Also you may follow this tutorial at,
    http://tutorial92.easycfm.com/

  • Extract results from database

    I want to be able to re-create a test report from the results database and do statistical analysis on the results of specific tests. Are there any querries or other database tools that have already been developed for this?

    Hi Gumby,
    As far I know there aren't any tools developed specifically for this kind of a task. However depending on the environment you're using there will probably be tools developed for easily retrieving information from databases.
    In TestStand we have SQL step types that allow you to easily retrieve data from databases. There are two examples that ship with TestStand I would suggest looking at in addition to the help for these step types.
    C:\Program Files\National Instruments\TestStand 3.1\Examples\Database
    (This path will vary depending on the version of TestStand and your installation directory.)
    If you're using LabVIEW or LabWindows/CVI we have special tools developed to simplify communicating to databases.
    c.vp?cid=6429〈=US>LabVIEW Database Connectivity Toolkit
    NI LabWindows/CVI Enterprise Connectivity Toolset
    There are also lots of examples available by searching our website.
    If you're using another environment there are probably tools available as well, I just don't know enough to recommend any.
    I hope this helps!
    Regards,
    Sarah Miracle
    National Instruments

  • Extracting data from database table containg perticular string.

    hi every body ,
    can any body provide me a solution for extracting the OT01 data from kna1 table where the OT01 ends with the string 'town' .
    exe : the O/P should be
    midTOWN
    newTOWN
    there is one more query i am not able to execute the following statement .......why?
    select ORT01 from KNA1 where ORT01 CS 'TOWN'.
    write:/ kna1-ort01.
    endselect.
    it is showing a syntax error.......
    Thank You.

    Hi Tippu,
    Your select statement consists of CS whcih may not be a valid comparision operator because of which error is displayed have look of this..
    data itab like kna1 occurs 0 with header line.
    parameters: s_town like kna1-ORT01.
    select ORT01 from KNA1 into table itab where ORT01 = s_town.
    Fetch the city and concatenate with TOWN your issue will be sloved.
    Cheers!!
    Balu
    Edited by: Balu CH on Oct 21, 2008 11:13 PM

  • Extract DDL from Database

    Hi all,
    I am trying to extract the DDL statements for my database indexes. I am using Oracle 8i. The two option:
    (1) You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.
    (2) DBMS_METADATA.GET_DDL but it is only available for Oracle 9i and above. So it does me not good.
    Are there any other option beside (1) that I can use in Oracle 8i. Any suggestion would be appreciated.
    Thanks,
    Ravi

    You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.You haven't mentioned the OS.
    you can create the indexfile(ddl file) and remove the quoted strings using global replacement and you would have a clean SQL file with DDL's.

  • Need to Extract Image from Database for Report

    Greetings,
    I have two databases that I could work with; both are for card access users.  One is an old Access 98 database, the other is a SQL database,
    In the tables I can "see" references to employee_photo and badge_picture_path respectively, but when I run the Report, the Image is not retrieved.
    Any ideas how I can overcome this ?
    I am trying to create a hard copy in a binder, so that new guards can thumb through the binder and familiarize themselves with employees.
    Thanks
    Peter

    Hi Peter,
    What format are the pcitures saved in.  I believe they have to be either BMP or JPEG.  Any other formats will not work in Crystal. 
    Have a look with the sample Extreme database.  The Employee table has a picture field, very similar to what you are using.  If you create a simple report with it, can you see the pictures? 
    Thanks,
    Brian

  • Extracting date from oracle/other databases exactly to java

    Hello Friends,
    Iam creating a simple program which extracts data from any database and stores it in an XML file and also it can extract data from an XML file and updates the database.
    My program is just getting the tablename as an input and from that it builds the query (select * from tablename). Through ResultSet, Iam extracting date fields with getDate() method of ResultSet, which is yeilding converted dates [In oracle if date is 23-DEC-1980, Im getting it as 1980-12-23 in java]. Even getString() method of ResultSet doesn't work.
    I want my program to work with any database engine, which may have their own date formats. Kindly can anyone suggest me a way to extract date from any database exactly as it is to java.
    NOTE:: I can't use to_char(datefield) type commands in SQLQUERY as the only input to my program is tablename and my query is, select * from tablename.
    Regards,
    Ch.Praveen.

    HI Friends,
    Thanks for your fast replies. My program is extracting data from a database and generating an XML file for it, which is as follows.
    <?xml version="1.0" encoding="UTF-8"?>
    <table tableName="EMP">
    <row>
    <column columnName="EMPNO" columnType="NUMBER">7369</column>
    <column columnName="ENAME" columnType="VARCHAR2">'SMITH'</column>
    <column columnName="JOB" columnType="VARCHAR2">'CLERK'</column>
    <column columnName="MGR" columnType="NUMBER">7902</column>
    <column columnName="HIREDATE" columnType="DATE">'1980-12-17'</column>
    <column columnName="SAL" columnType="NUMBER">800</column>
    <column columnName="COMM" columnType="NUMBER" />
    <column columnName="DEPTNO" columnType="NUMBER">20</column>
    </row>
    <row>
    <column columnName="EMPNO" columnType="NUMBER">7499</column>
    <column columnName="ENAME" columnType="VARCHAR2">'ALLEN'</column>
    <column columnName="JOB" columnType="VARCHAR2">'SALESMAN'</column>
    <column columnName="MGR" columnType="NUMBER">7698</column>
    <column columnName="HIREDATE" columnType="DATE">'1981-02-20'</column>
    <column columnName="SAL" columnType="NUMBER">1600</column>
    <column columnName="COMM" columnType="NUMBER">300</column>
    <column columnName="DEPTNO" columnType="NUMBER">30</column>
    </row>
    </table>
    Here you can observe that HIREDATE column is having date in different format than in oracle. We are getting an error while we are extracting data from an XML file and updating the database, as dateformats differ. Can anyone provide a solution, which extracts date from database to java exactly as per the dateformat in database.

  • Question on pulling data from database

    I have a question. I have one form in designer and i need to extract data from database. database is in sequel. any help on how do i do this or how can i do this?

    If you use a process to interact with the database, this recent thread is very related and would be helpful:
    http://www.adobeforums.com/webx/.59b639e7/0
    scott

  • Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?

    Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?
      Now a days we are saving / extracting data in a excel spreadsheet, but we would like to do that using a database because it is better.

    You can use ODBC connection to work with SQL Server database.
    Use SQLExec object to execute the SQL statement. Here is a KB about the SQL statement.
    http://digital.ni.com/public.nsf/allkb/4ADEEA04CD24AE0B862565E20002A16F?OpenDocument
    To write data to spreadsheet is more straightforward because Lookout has built-in spreadsheet object. But you need to write SQL statement by yourself to interact with other database.
    To read the data back is the same way. Just use "select" SQL statement to query. You can use Datatable object to query.
    The "Data Source" can be "DSN = data source name;". The data source name is configured in Control Panel->Administrative Tools->Data Sources(ODBC).
    Ryan Shi
    National Instruments

  • How to extract data from essbase to oracle database incrementally?

    I have to extract data from essbase to an oracle database table incrementally using informatica , can anyone tell me how to do it or give me some tips. I have been thinking about it for a whole day but have no ideas.
    I cannot do the delete & insert method because this oracle database table is a interface table that has to deliver the data to Oracle ESB tables.
    Thanks in advance....

    Hi,
    Have you read through :-
    Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
    Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
    If you have read them and are still have a problem at what stage are you having the issues?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to extract data from oracle database directly in to bi7.0 (net weaver)

    how to extract data from oracle database directly in to bi7.0 (net weaver)? is it something do with EDI? can anybody explain me in detail?
    Thanks
    York

    You can use UDConnect to get from Oracle database in to BW
    <b>Data Transfer with UD Connect -</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
    <b>Prerequisites</b>
    You have installed the SAP WAS J2EE Engine with BI Java components.  You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
    Hope it Helps
    Chetan
    @CP..

  • Which is better? Extracting images from directories or from database?

    Good day,
    I would like to start a discussion on extracting image (binary data) from a relational database. Although some might say that extracting image from directories is a better approach, I m still sceptic on that implementation.
    My argument towards this is based on the reasonings below:
    1. Easier maintainence. - System Administrator can do backup from one place which is the database.
    2. High level of security - can anyone tell me how easy it is to hack into a database server?
    3. image is not dependent on file structure - no more worries about broken links because some one might mistakenly change the directory structure. If there needs to be a change, it will be handle efficiently by the database server.
    The intention of my question is to find out :
    1. Why is taking image from a directory folder which resides on the web server is better than using the same approach from the database?
    2. How is this approach (taking image from directory) scalable if there is thousands of images and text that needs to be served?
    If anybody would be kind enough to reply, I would be most grateful.
    Thank You.
    Regards
    hatta

    Databases are typically more oriented towards text and number content than binary content, I believe. If you carry images in the database you will need to run them through your code and through your java server before they are displayed. If they are held in a directory they will be called from hrefs in the produced page, which means that they are served by your static server. This is quicker because no processing of the image is required. It also means the Database has to handle massively less data. Depending on the database this should be far quicker to query.
    It is worth noting that it is also quite difficult to actually change mime-types on a page to display a picture in the midst of HTML- the number of enquiries on these pages about this topic should be enough to illustrate this.
    If you give over controls of all the image file handling to your java system (which I do when I write sites like the one you describe) then the actual program knows where to put the images and automatically adds them to the database. The system administrator never needs to touch them. If they want a backup they save the database and the website directory. The second of those should be a standard administrative task anyway, so there is not a huge difference there. The danger of someone accidentally changing the directory structure is no greater than the danger of someone accidentally dropping a database table- it can be minimised by making sure your administrators are competent. Directory structures can be changed back, dropped tables are gone.
    The security claim is slightly negated because you still have to run a webserver. Every program you run on your server is vulnerable to attack but if you are serving web pages you will have a server program that is faster than a database for image handling. You are far more at risk from running FTP or Telnet on your server or (worst of all) trying to maintain IIS.
    The images in directory structure is more scalable because very large databases are more likely to become unstable and carrying a 50k image in every image field rather than 2 bytes of text will make the database roughly 25000 times larger. I have already mentioned the difference in serving methods which stands in favour of recycling images. A static site will be faster than a dynamic site of equivalent size, so where you can, take advantage of that.

Maybe you are looking for

  • I just updated my Macbook pro's OS from Maverick to Yosemite...now my safari doesnt open and always quits

    Macbook Pro (13inch , Mid 2012 ) processor 2.5Ghz Intel core i5 memory 4Gb 1600Mhz DDR3 OS X Yosemite version 10.10.1

  • Corruption in system objects

    Dear all, 9.2.0.4 on Linux. We have some corruption in the database DBVERIFY - Verification starting : FILE = /home/oracle/oradata/psa/system01.dbf Page 4092 is marked corrupt Corrupt block relative dba: 0x00400ffc (file 1, block 4092) Bad check valu

  • Why Can I Only Get Sound On Video's

    I have a 30gig iPod and have a few vid's I would like to watch on it while travelling. I converted a number of .avi formatted vid's to the .mp4 that ipod requires using winAVI but on trying to watch the then converted files on my PC or the iPod I onl

  • Recycle

    When I was setting up and registering my new MacBook there was a label that could be used to send back an old computer to be recycled. Since I was not connected to a printer at the time I figured I would come back to that after I had finished transfe

  • How to modify the database by Oracle-ridc-client

    How to modify the database by Oracle-ridc-client