How to create an audit trail file and what is it ( pls see the code)

All my System.out.println statements , should be printed in an audit file , instead of printing to a console .
How and where in the program , i should create a file and how should i write System.out.println statements output to it .
Pls help me with the code .
//Start the main method
     public static void main(String[] args){
          if(!(args.length == 3 || args.length == 4))
               System.out.println("Usage: java Load_data @baseyr @rateyr @caseID [@infile]");
               System.exit(1);
          String baseYr = args[0];
          String rateYr = args[1];
          String param3 = args[2];
          System.out.println("The base year is :"+baseYr);
          System.out.println("The rate year is :"+rateYr);
          if(param3.compareToIgnoreCase("max") == 0)
               caseID=25;
               System.out.println("The CaseID begins at :"+caseID);
          else if(param3.compareToIgnoreCase("one") == 0)
               System.out.println("Warning : I am assuming the CaseID as 1");
               //caseID=1;
          inFile = (args.length == 4) ? args[3] : "C\\UDS_YYYY.txt";     
        System.out.println("The Input file we are using is :"+inFile);
          goodOutFile = "C:/Documents and Settings/Desktop/Program/GOOD_LOAD.txt";
          badOutFile = "C:/Documents and Settings/Desktop/Program/BAD_LOAD.txt";
          inFormat = "C:/Documents and Settings/Desktop/Program/FORMAT.csv";
//Here I call the Load_data method.
          new Load_data();
          System.out.println("The number of records written to good O/P FIle :" +goodRecord);
          System.out.println("The number of records written to bad O/P FIle :" +badRecord);
          System.out.println("")
}

1sai wrote:
However, a better choice would be to use log4j which support rolling log files and more control over what output goes where in what format.
Can U pls explain this ,or where i can learn abt this .
Thank UTry clicking on the link BigDaddyLoveHandles provided you in the previous reply.
Your hands must get tired with your hiney sitting on them all day, huh?

Similar Messages

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • How to create customer material information(vd51) and what is it's use

    how to create customer material information(vd51) and what is it's use.
       does it will work even in mm module also??
      my requirement is such that...
    my sap code is 235
    where as customer will give purchaase order on code 536.when i am entering this 536 code  in my system,automatically sytem should propse my sap code of 235.subsequently my inventory should reduce.

    Hi,
    the transaction for maintaining the customer material inforecord is VD51.Data on a material defined for one specific customer is stored in the customer material information records.
    Features:
    During order entry, items can be entered by specifying the material number used by the customer. You also enter a customer material number in the order view of the sales order. You can then use both material numbers during the order entry, the material number your company uses or the one defined by the customer, because the system can carry out allocation automatically.
    If you maintain the plant in the customer material info record, the system will give priority for the plant maintained in the CMIR in the order.
    Prase

  • How to create an audit trail report in SAPB12007

    Hello,
    I been looking for some ways to make an Audit Trail Report for our System Audit. Could anyone help me with this?
    I would like to generate a report that will list all the BP and ITem master data. the date its created and modified and if its modified what are the old values and the modified values.
    I browse the table ACRD for the BP history. how every it could be read as a report. So I was wondering if anyone knows what table should I look at if I am to get the old and new value of a modified transaction. Pls. note that I wanted to create a report.
    Thank you very much
    cat

    Here are the queries that I use for my audits internally. The first one is for customer changes. And the second one to control pricing.
    Query Name: Business Partner History Log
    Author: Vincent Motte                  
    Version: 1.0                          
    History:
    /SELECT FROM ACRD T1/
    DECLARE @DATE AS DATETIME
    /* WHERE */
    SET @DATE = /* T1.UpdateDate */ getdate()-30
    SELECT
    CASE
                    WHEN (SELECT ISNULL(T10.BankCode,0) FROM ACRD T10 WHERE T10.CardCode=T0.CardCode AND T10.LogInstanc=T0.LogInstanc-1)<>ISNULL(T0.BankCode,0)
                                    Then  'Bank details modified'
                     WHEN (SELECT ISNULL(T10.DflAccount,0) FROM ACRD T10 WHERE T10.CardCode=T0.CardCode AND T10.LogInstanc=T0.LogInstanc-1)<>ISNULL(T0.DflAccount,0)
                                    Then  'Bank  details modified'
                     WHEN (SELECT ISNULL(T10.DflBranch,0) FROM ACRD T10 WHERE T10.CardCode=T0.CardCode AND T10.LogInstanc=T0.LogInstanc-1)<>ISNULL(T0.DflBranch,0)
                                    Then  'Bank  details modified'
                    WHEN (SELECT COUNT(T10.CardCode) FROM ACRD T10 WHERE T10.CardCode=T0.CardCode and T10.LogInstanc<T0.LogInstanc)<=0
                                    Then 'Creation'
                    else ''
    END 'Alert',
    T0.UpdateDate 'Update Date', T1.[U_NAME] 'User',T0.CardCode, T0.CardName
    , T0.[CreditLine], T0.[DebtLine],
    T0.[Discount], T0.[VatStatus], T0.[LicTradNum], T0.[ListNum] 'Price List', T0.[DflAccount], T0.[DflBranch], T0.[BankCode],
    T0.[validFor], T0.[frozenFor], T0.[VatGroup], T0.[Deleted], T0.[PymCode], T0.[BlockDunn],
    T0.[WTCode]
    FROM ACRD T0 , OUSR T1 WHERE
    T1.INTERNAL_K=T0.UserSign AND T0.UpdateDate>=@DATE
    Query Name: Price Change log
    Description: extracts the price modification for each item in SBO for the past 30 days
    Version 1.0
    Author: Vincent Motte
    History:
    Select
    --T0.UserSign,
    T1.itemcode 'Item Code',
    T0.Price [Previous],
    T1.Price [Current],
    T2.ListName 'Price List',
    T0.Factor[Old Factor] ,
    T0.factor [New Factor],
    /* select the update date for the log instance(determined by the where condition )*/
    (Select distinct T3.Updatedate from aitm T3 where T3.itemcode= T0.itemcode and (T3.loginstanc +1)= T0.loginstanc ) 'Update Date',
    T0.loginstanc 'Instance',
    T2.listName 'Price List',
    /Select the base price list for the item's price list from the price list table/
    (Select T4.base_num from opln T4 where T4.listnum = T1.pricelist and T4.listnum = T0.pricelist) [Base PriceList ]
    --t0.Currency,
    --T1.CURRENCY
    From
    ait1 T0 inner join
    itm1 T1 on T0.pricelist = T1.pricelist and T0.itemcode = T1.itemcode
    Inner Join opln T2 on T1.pricelist = T2.listnum
    where
    /* Condition 1: Select all the items + their price change where the price has been changed and the base price list equals the price list itself. It counts the Log Instance from the item in
    the price list and substract one to get the last entry where the price was changed. The loginstance coutn ignores a count of 1
    T0.loginstanc =
    ((Select count (a.Loginstanc) from ait1 a where a.itemcode = T0.itemcode and a.pricelist = T0.pricelist group by a.itemcode having count(a.Loginstanc) > '1' ) -1)
    and
    /* Cater for prices in target price lists which may have been manually changed. */
    (T1.ovrwritten='y'and T0.Price <> T1.Price)
    or (T0.Price <> T1.Price and T2.base_num = T1.pricelist and T2.base_num = T1.pricelist
    and T2.base_Num = T2.listnum )
    Cater for cases where a currency change but not a price change may happen
    OR T0.CURRENCY <> T1.CURRENCY
    or
    Condition 2: Select all price changes where the price may have changed due to the price of the parent price lsit changing.
    As this type of price chnage is not recorded in the AIT1 the second log instance condition details that the base price list
    from opln does not equal the actual price list in ait1 or itm1.
    T0.loginstanc =
    (Select top 1 c.loginstanc from ait1 c where c.itemcode = T0.itemcode and c.pricelist = T0.pricelist and c.loginstanc <> '1' order by c.loginstanc desc)
    and T2.base_num <> T1.pricelist and T2.base_num <> T1.pricelist
    and T2.base_Num <> T2.listnum
    and
    caters for a change in the factors or prices in target price lists which may have been manually changed.
    ((T0.Factor <> T1.factor)
    or (T1.ovrwritten='y'and T0.Price <> T1.Price)
    or T0.price <> T1.price
    Cater for cases where a currency change but not a price change may happen
    OR T0.CURRENCY <> T1.CURRENCY
    and (T0.Price >= 0 or T1.Price >=0) and ((T0.Price <> T1.Price) or ((T0.Price <>
    (Select distinct b.pricelist from itm1 b right outer join OPLN T4 on b.pricelist= T4.listnum and b.pricelist <> T4.base_Num where b.pricelist = T1.pricelist and b.itemcode =T1.itemcode)))
    and (Select distinct T3.Updatedate from aitm T3 where T3.itemcode= T0.itemcode and (T3.loginstanc +1)= T0.loginstanc ) >getdate()-30

  • How to create a custom ear file and deploy it onto a freshly created oc4j

    Hi,
    Wanted to know that how should i go about creating a custom EAR file or for that matter any application and deploy it onto a test oc4j instance created within the 10.1.3 Home of Oracle Apps R12.
    I believe in a standalone Application server installation it is quite simple to deploy an application by creating an oc4j instance using the AS console ,but not very sure about how to go about it in Oracle Apps .
    N.B:I have been able to create a test oc4j instance by the name of Test and able to start and stop it using the opmn of 10.1.3 oracle home.
    Any help in this regard will be appreciated.

    Hi,
    can you please post this question to one of the Apps forums if your main concern is to deploy applications in the context of Oracle Apps?
    It seems that you don't have a problem in creating the EAR file in JDev.
    Frank

  • How to create both a XML file and a check

    Hi,
    I'm currently implementing the use of XML files for payments in the USA and I run into a problem for check payments. We need to generate both an XML file, which needs to be sent to the bank for validation and the checks, which are printed by the finance department and then sent to the vendors. These checks are only paid when they match the XML file.
    We are using payment medium workbench for generating the XML file (DME structure) and on running F110 I get a nice XML file, however this prevents me from entering the printing form for check in the printout tab of F110.
    I tried to add the check in transaction OBPM1, but I cannot get it to work.
    Anny suggestions on how I can continue?
    Thanks in advance
    Peter Kauwenberg

    Hi Kauwenberg,
    You can add multiple payment in DMEE file but for that you have to change in DME properties where if you want sort according to payment method or dont want to club the different method in one line then add on more filed RZAWE from table FPAYH.
    I have used this options to one of my client where they want to add check payment with other payment method.
    Kindly try this and let me know in case of any issue.
    Regards,
    Dattatraya Biradar

  • How to create a website with Dreamweaver and what is Hosting?

    Does anyone here know about website hosting?

    Unless you have a specific issue converting sites from GoLive to Dreamweaver, you should try posting in the main Dreamweaver forum.
    Few people view this forum.

  • How to create database from .sql file

    how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
    ho to do it..??

    why do you want to do this from java?
    i just don't see the point.
    find your dba and have him/her run it for you

  • I have a file ".DS_Store" that is appearing everywhere . How do I get rid of it and what is it?

    I have a file ".DS_Store" that is appearing everywhere . How do I get rid of it and what is it?

    Open the Script Editor or AppleScript Editor in one of the subfolders of Applications and run the following:
    tell application "Finder" to quit
    if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is "1" then
    do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
    else
    do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
    end if
    delay 2
    tell application "Finder" to run
    If you change your mind later, run the script again.
    (71410)

  • Mac OS X : ORA-09925: Unable to create audit trail file

    I have followed the instuctions on Oracle's site:
    http://www.oracle.com/technology/tech/macos/index.html
    specifically the Blog pages by Sergio and Anthony and have encountered a couple problems:
    1) I got this error when running the db config assitant (dbca) as per Anthony's steps:
    ORA-09925: Unable to create audit trail file
    I was running this from a shell while logged onto the gui as my admin id (mtaylor) then running
    sudo -u oracle sh
    then running the ./bash_profile commands, altho I had to
    cd /Users/oracle
    cat .bash_profile
    and then copy and paste the commands since running
    ./.bash_profile
    and then testing by running
    echo $ORACLE_HOME
    gave me a blank line.
    I thought that logging onto the gui as mtaylor might be the problem since I was getting 2 errors in the shell as the java initialized:
    ATSFontGetFileSpecification failed: error -5000 (twice),
    2) so I decided to log onto the gui as the user oracle and then open a shell. Doing this, I get to step 12 of 12, press finish and nothing happens at all. It doesn't freeze tho because I can cancel and exit with no problem.
    I went back to mtaylor and tried again and now I get the same result. I may have done something else to fix my first problem meanwhile as I have been working on this for a few hours. 
    I have confirmed that I am specifying the correct directories in the dbca, the .bash_profile and the files below, and that the owner:group is oracle:oinstall with r/w access:
    ORACLE_BASE=/Volumes/u01/app/oracle
    ORACLE_HOME="$ORACLE_BASE/product/10.1.0.3/db_1"
    PATH="$PATH:~bin:$ORACLE_HOME/bin"
    ORACLE_SID=orcl
    My tnsnames.ora is (after default entry):
    orcl.world =
    (DESCRIPTION =
    (ADDRESS=(PROTOCOL=TCP)
    (HOST=localhost)(PORT=1521))
    (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))
    My listener.ora is:
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=orcl)
    (ORACLE_HOME=/Volumes/u01/app/oracle/product/10.1.0.3/db_1)))
    I am specifying /Volumes/u02/oradata as the datafiles location (this exists with the same permissions as above)and specifying include the example schemas.
    Any ideas anyone?
    Matt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Problem solved.
    See
    10g install Mac OS X (Tiger) - ALMOST

  • Unable to create audit trail file

    When I am trying to login.....it's showing below error messae
    [oracle@localhost dbs]$ sqlplus / as sysdba
    SQLPlus: Release 11.2.0.1.0 Production on Thu Apr 21 16:47:15 2011*
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    ERROR:
    ORA-09925: Unable to create audit trail file
    Linux Error: 2: No such file or directory
    Additional information: 9925
    ORA-01075: you are currently logged on
    Enter user-name:
    Thanks in advance

    I think you not have permission.
    please read following links
    ORA-09925: Unable to create audit trail file
    http://www.dbasupport.com/forums/showthread.php?t=55938
    http://laurentschneider.com/wordpress/2007/12/how-to-resolve-ora-09925.html
    Edited by: Mahir M. Quluzade on Apr 21, 2011 11:02 AM

  • How to create OEMS JMS In-Memory and File-Based Persistence?

    Anyone knows how to create OEMS JMS In-Memory and File-Based Persistence? Any help it is appreciated. I m working with Oracle BAM 11g TP4 and I want to test the capability of connecting directly to a JMS queue, and reading Oracle´s "complex" documentation I couldnt find the right way to make this happen.
    tks

    Hi Mario
    This is explained in the soa developer's guide. Chapter 43 "Enterprise message source"should help you. You will find how to connect OEMS or JMS in-memory/file based to your BAM data objects with or without xpath transformation.
    You can find sample of advanced XML formating in the 10g tech note: "Oracle BAM 10.1.3 configuration for BPEL 10.1.2 using JMS sensors" (useful even if you don't plan to use BPEL).
    Anyway, if you plan to use BPEL, forget JMS and use the BAM adapter (chapter 42), it's quicker & easier.
    Dominique

  • How to create OEMS JMS In-Memory and File-Based Persistence ? Anyone?

    Anyone knows how to create OEMS JMS In-Memory and File-Based Persistence? Any help it is appreciated. I m working with Oracle BAM 11g TP4 and I want to test the capability of connecting directly to a JMS queue, and reading Oracle´s "complex" documentation I couldnt find the right way to make this happen.
    tks

    Hi Mario
    This is explained in the soa developer's guide. Chapter 43 "Enterprise message source"should help you. You will find how to connect OEMS or JMS in-memory/file based to your BAM data objects with or without xpath transformation.
    You can find sample of advanced XML formating in the 10g tech note: "Oracle BAM 10.1.3 configuration for BPEL 10.1.2 using JMS sensors" (useful even if you don't plan to use BPEL).
    Anyway, if you plan to use BPEL, forget JMS and use the BAM adapter (chapter 42), it's quicker & easier.
    Dominique

  • ORA-09925: Unable to create audit trail file

    hi
    everyone,
    I met a problem when I ran 'rman' to backup database . It said that,
    "unable to create audit trail file"
    what cause this problem ,somebody told me that the privilege is not proper .
    I am confused ....
    anybody can help me ?
    many thanks.
    best
    carl

    Privilege may not be appropriate or the volume where the audit log resides may be full.

  • Unable to create audit trail file  database upgrade

    hi
    when i am trying to upgrade my database from oracl10g into oracl11g middle of the upgrade i m getting below error
    "unable to create audit trail file " help me resolve

    SQL> startup nomount
    ORACLE instance started.
    Total System Global Area 1553305600 bytes
    Fixed Size              2213656 bytes
    Variable Size           1258293480 bytes
    Database Buffers       285212672 bytes
    Redo Buffers              7585792 bytes
    SQL> show parameter dump
    NAME                         TYPE      VALUE
    background_core_dump               string      partial
    background_dump_dest               string      /u01/app/oracle/diag/rdbms/v112/v112/trace
    core_dump_dest                    string      /u01/app/oracle/diag/rdbms/v112/v112/cdump
    max_dump_file_size               string      unlimited
    shadow_core_dump               string      partial
    user_dump_dest                    string      /u01/app/oracle/diag/rdbms/v112/v112/trace

Maybe you are looking for

  • Can anyone help with AirPrint

    Can anyone help with this. I recently purchased an Airport Express unit to connect to my Canon MP 640 via USB. I was advised to download the airport utility app for both my iPad and iPhone, which I did. I also downloaded it on my pc. I have connected

  • How to compare two files in Java & uncommon text should print in Diff text

    Hi All, can any one help me to write a java program.. How to compare two files in Java & uncommon text should print in Diff text file.. Thanks Sam

  • Enabling Audio Input

    I have my Xbox 360 setup with my computer using the VGA adapter for display and a 3.5mm output streamed into my Mac mini for audio. When I go to System Preferences > Sound > Input, I see the sound coming, as the "Input Level" bar is fluctuating; howe

  • Internet based applications not working

    I was on the safari and all of a sudden it quit. A message popped up and said subpub agent quit unexpectedly. I'm assuming that this is the reason why every time I open safari or skype or mail, that it tries to load, quits, then says "insert applicat

  • How to get job status information from printer without using printer's web interface

    Hi, all! I need to resolve problem with logging my printer hp lj 700 m712.   I configure syslog on it, but it sending only status messages ("peripheral low-power state" - for exapmle), I need to register the job status of printer's job on my server.