Need help||||||||||floating point error

my code is this
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.sql.*;
import java.math.*;
* This class implements the Portfolio tab appearing on the System Tabs.
* The purpose of this class is to implement a JTable that will list the details of all the companies
* listed under the selected portfolio, which the user will choose from the Choose Portfolio Tab.
public class PortfolioTable extends JPanel
     String t,totalPl,PPL;
     double CP=0;
     double total=0,overallPL=0;
     double totalperChange=0;
* The PortfolioTable Class Constructor. This Constructor creates a JTable, and populates the
* JTable with the details of the companies under the selected portfolio
public PortfolioTable()
          // Creating objects for the various panels present
          JPanel p1 = new JPanel();
          JPanel p2 = new JPanel();
          JPanel p3 = new JPanel();
          JPanel p4 = new JPanel();
          JPanel p5 = new JPanel();
          // A boolean type variable
          boolean flag = false;
          // Creating a label. This label is shown when no companies are present under any selected portfolio, or no portfolio is selected.
          JLabel label = new JLabel("THERE ARE NO COMPANIES WITHIN THE SELECTED PORTFOLIO. TO ADD A COMPANY PLEASE GOTO THE 'PORTFOLIO ACTIONS' MENU ITEM AND THEN ADD A COMPANY.");
          JLabel label1 = new JLabel("Overall Amount Invested ");
          JLabel label2 = new JLabel("Overall Profit/Loss ");
          JLabel label3 = new JLabel("Overall Percentage Change");
          JLabel label4 = new JLabel("Amount Invested");
          JLabel label5 = new JLabel(" Profit/Loss ");
          JLabel label6 = new JLabel(" Percentage Change");
          // The following string array holds the JTable Column headers.
          String[] columnNames = {"Company Name","Previous Close (p)","Open (p)","Bid (p)","Ask (p)","Change Value","No. of Shares","Total (Pd)","Current (Pd)","Commission","Profit/Loss (Pd)","% Change"};
          // Creating an object of the JTable
          JTable table;
          // The following variables are defined to communicate with the database.
          Connection     Conn;          // The Connection object variable
          Statement     Stmt;          // The Statement object variable.
          ResultSet     rs;               // The Resultset object variable.
          // Below I'm attempting to retrieve the JDBC-ODBC Class definition
          try
               Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
          catch(ClassNotFoundException e)
               System.out.println("Unable to retrieve the JDBC-ODBC Bridge. Exiting.....");
               System.exit(1);
          int i = 0;
          try
               // Creating an database connection using the DSN - DataStorage
               Conn = DriverManager.getConnection("jdbc:odbc:DataStorage","","");
               Stmt = Conn.createStatement();
               String queryString = "select COMPANYNAME,PREVCLOSE,OPEN,BID,ASK,TODAYSCHANGE,NOOFSHARES,TOTPRICEPAID FROM CompanyDetails where UNIQUEID = " + Variables.getSelectedPortfolio ();
               // Executing the above SQL query. The values returned by the executeQuery statement is placed in the Resultset rs.
               rs = Stmt.executeQuery(queryString);
               // A counter variable. this counter is incremented for each record present in the table.
               // I'm following this procedure to show only the same number of JTable rows as the number of records.
               int count = 0;
               while (rs.next())
                    count ++;
               // Closing all Data Objects created above
               rs.close();
               Stmt.close();
               Conn.close();
               // Now since I know the number of records, I will initialize a String array only to the size as the number of rows present in the table.
               // As mentioned earlier the number of rows will be determined from the variable count, declared above.
               String rowData[][] = new String[count][12];
               // Instantiating the JTable object created above, with the declared Column headings and the row data.
               table = new JTable(rowData, columnNames);          
               // Creating an database connection using the DSN - DataStorage
               Conn = DriverManager.getConnection("jdbc:odbc:DataStorage","","");
               Stmt = Conn.createStatement();
               queryString = "select COMPANYNAME,PREVCLOSE,OPEN,BID,ASK,TODAYSCHANGE,NOOFSHARES,TOTPRICEPAID FROM CompanyDetails where UNIQUEID = " + Variables.getSelectedPortfolio ();
               // Executing the above SQL query. The values returned by the executeQuery statement is placed in the Resultset rs.
               rs = Stmt.executeQuery(queryString);
               int j = 0;
               // Getting the current Commision Rate. This value is retrieved from the database when the application is started and is stored in the
               // Application variable. The Variables class handles all by Application related work.
               String commissionVal = Variables.getCommisionValue ();
               // Retrieving all the records.
               while(rs.next())
                    flag = true;                                   // this variable is initialized to true to indicate that some records were found.
                    String companyName = rs.getString(1);     // the company value retrieved from the DB
                    String prevCloseStr = rs.getString(2);     // the Previous Close retrieved from the DB
                    String openPriceStr = rs.getString(3);     // the Open Price retrieved from the DB
                    String bidPriceStr = rs.getString(4);     // the Bid Price retrieved from the DB
                    String askPriceStr = rs.getString(5);     // the Ask Price retrieved from the DB
                    String todaysChg = rs.getString(6);     // the Today's Change retrieved from the DB
                    String noofShares = rs.getString(7);     // the No of Shares retrieved from the DB
                    String totPrice = rs.getString(8);     // the Total Price paid for the above shares retrieved from the DB
                    // Determining the Current Price, where it is calculated by = Current Price = Bid Price * No of Shares bought
                    double currPrice = Double.valueOf(bidPriceStr).doubleValue() * Double.valueOf (noofShares).doubleValue ();
                    // Since the Bid Price is in pence, therefore the Current Price will also be in cents. I now convert then into Pounds.
                    currPrice = currPrice/100;
                    // Determining the precision upto 2 decimal places.
                    currPrice = new java.math.BigDecimal(currPrice).setScale(2,java.math.BigDecimal.ROUND_HALF_EVEN).doubleValue ();
                    // Creating a string variable for the Current Price. This string will help me to place the value into the JTable
                    String currPriceStr = new String();
                    // calculating the profit loss. the Profit/Loss is calculated by the Current Price - Total Price. If negative then loss, if positive the profit.
                    double profitloss = currPrice - Double.valueOf(totPrice).doubleValue();
                    // Determining the precision upto 2 decimal places.
                    profitloss = new java.math.BigDecimal(profitloss).setScale(2,java.math.BigDecimal.ROUND_HALF_EVEN).doubleValue ();
                    // Creating a string variable for the Profit Loss. This string will help me to place the value into the JTable
                    String profitLossStr = new String();
                    // calculating the percentage change. The percentage Change is calculated by the profitloss/Total Price. the result value is divided by 100 to get in % profit or loss.
                    double perChange = (profitloss / Double.valueOf(totPrice).doubleValue()) * 100;
                    // Determining the precision upto 2 decimal places.
                    perChange = new java.math.BigDecimal(perChange).setScale(2,java.math.BigDecimal.ROUND_HALF_EVEN).doubleValue ();
                    // Creating a string variable for the Percentage Change. This string will help me to place the value into the JTable
                    String perChangeStr = new String();
                    // The following statements are populating the JTable columns with the appropriate values.
                    table.setValueAt(companyName,i,j);     // Company Name
                    j = j + 1;
                    table.setValueAt(prevCloseStr,i,j);     // Previous Close
                    j = j + 1;
                    table.setValueAt(openPriceStr,i,j);     // Open Price
                    j = j + 1;
                    table.setValueAt(bidPriceStr,i,j);     // Bid price
                    j = j + 1;
                    table.setValueAt(askPriceStr,i,j);     // Ask Price
                    j = j + 1;
                    table.setValueAt(todaysChg,i,j);     // Today's Change
                    j = j + 1;
                    table.setValueAt(noofShares,i,j);     // No of Shares
                    j = j + 1;
                    table.setValueAt(totPrice,i,j);          // Total Price Paid
                    j = j + 1;
                    table.setValueAt(currPriceStr.valueOf (currPrice),i,j);
                    j = j + 1;
                    table.setValueAt(commissionVal,i,j);     // Commission
                    j = j + 1;
                    table.setValueAt(profitLossStr.valueOf(profitloss),i,j);     // Profit/Loss
                    j = j + 1;     
                    table.setValueAt(perChangeStr.valueOf(perChange),i,j);          // Percentage Change
                    i = i + 1;
                    j = 0;
                    //currPrice = 0;
                    //profitloss = 0;
                    //perChange = 0;
               //JFrame frame=new ExitableJFrame();
//Container contentPane=frame.getContentPane();
                    total=total+Double.valueOf(totPrice).doubleValue();
                    currPrice = Double.valueOf(bidPriceStr).doubleValue() * Double.valueOf (noofShares).doubleValue ();
                    CP=CP+currPrice;
                    CP=CP/100;
                    overallPL=CP-total;
                    totalperChange=overallPL/total;     
                    totalperChange = new java.math.BigDecimal(totalperChange).setScale(2,java.math.BigDecimal.ROUND_HALF_EVEN).doubleValue ();
t=Double.toString(total);
                    label4.setText(t);
                    totalPl=Double.toString(overallPL);
                    label5.setText(totalPl);
                    PPL=Double.toString(totalperChange);
                    label6.setText(PPL);
                    p1.add(table.getTableHeader(), BorderLayout.NORTH);
                    p2.add(table);
                    p2.setLayout(new GridLayout(10,0,5,5));
                    p4.add(label1,BorderLayout.NORTH);
                    p4.add(label2,BorderLayout.SOUTH);
                    p4.add(label3,BorderLayout.NORTH);
                    p5.add(label4,BorderLayout.SOUTH);
                    p5.add(label5,BorderLayout.NORTH);
                    p5.add(label6,BorderLayout.SOUTH);
          catch(SQLException e)
               System.out.println(e.getMessage ());
          // Here I'm placing the various panels and the JTable onto the Frame
Box horibox1 = Box.createHorizontalBox();
horibox1.add(p1);
Box horibox2 = Box.createHorizontalBox();
horibox2.add(p2);
Box horibox3 = Box.createHorizontalBox();
horibox3.add(p4);
Box horibox4 = Box.createHorizontalBox();
horibox4.add(p5);
          if (!flag)
               p3.add(label);
Box veribox = Box.createVerticalBox();
veribox.add(horibox1);
veribox.add(Box.createGlue());
veribox.add(horibox2);
veribox.add(horibox3);
//veribox.add(Box.createGlue());
veribox.add(horibox4);
          if (!flag)
               veribox.add(p3);
               veribox.add(Box.createGlue());               
          this.add(veribox);
//main method for testing purposes
public static void main(String[] args)
// Create a JFrame
JFrame frame = new JFrame("Portfolio Summary");
// Create a Portfolio Table
PortfolioTable portfolioTableObj = new PortfolioTable();
// Add the Portfolio Table to the JFrame
frame.getContentPane().add(portfolioTableObj, BorderLayout.WEST);
// Set Jframe size
frame.setSize(800, 400);
// Set JFrame to visible
frame.setVisible(true);
     // set the close operation so that the Application terminates when closed
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
but when i run i get messege by calling applcaton.java i get
C:\JavaProjectnew>java Application
Exception in thread "main" java.lang.NullPointerException
at java.lang.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.valueOf(Unknown Source)
at TradingHistory.<init>(TradingHistory.java:156)
at SystemTabs.<init>(SystemTabs.java:18)
at Application.<init>(Application.java:31)
at Application.main(Application.java:87)

sorry for trouble
actaually db's first record has the null value.it is solved now.
sorry again
sheetal

Similar Messages

  • Invalid Floating Point Error

    I have one Captivate 3 project published as a Stand Alone
    project with Flash 8 selected. There are 36 slides, no audio, no
    eLearning, SWF size and quality are high.
    One person who runs this gets an "Invalid Floating Point"
    error when he tries to run it the first time. He is running Windows
    XP SP2, Firefox 3.0.4. and Flash Player 10.0.12.36. Other Captivate
    projects I've created run fine for him. This one sometimes runs
    after the first Error message.
    Any thoughts on the cause and fix?
    Thanks,
    Janet

    iMediaTouch probably doesn't support Floating Point formats - it certainly doesn't mention them in the advertising. Try saving your files as 24-bit PCMs, and they should import fine.

  • Installing Elements 11 on Mac. Need help with install error "Setup wants to make changes."

    Installing Elements 11 on Mac 10.8.2. Need help with install error:  Setup wants to make changes. Type your password to allow this."  After entering Adobe password, nothing happens.  Locked from further installation.  Any ideas?  Adobe phone support could not help.

    Just before letting changes (installation in this case) be made on the system, Mac OS prompts for password & this has to be the Mac system password. This password prompt is the system's own native prompt & would accept the system password only. Please make sure it is the right system password (all/admin rights) and the installaion should run.

  • Designing for floating point error

    Hello,
    I am stuck with floating point errors and I'm not sure what to do. Specifically, to determine if a point is inside of a triangle, or if it is on the exact edge of the triangle. I use three cross products with the edge as one vector and the other vector is from the edge start to the query point.
    The theory says that if the cross product is 0 then the point is directly on the line. If the cross product is <0, then the point is inside the triangle. If >0, then the point is outside the triangle.
    To account for the floating point error I was running into, I changed it from =0 to abs(cross_product)<1e-6.
    The trouble is, I run into cases where the algorithm is wrong and fails because there is a point which is classified as being on the edge of the triangle which isn't.
    I'm not really sure how to handle this.
    Thanks,
    Eric

    So, I changed epsilon from 1e-6 to 1e-10 and it seems to work better (I am using doubles btw). However, that doesn't really solve the problem, it just buries it deeper. I'm interested in how actual commercial applications (such as video games or robots) deal with this issue. Obviously you don't see them giving you an error every time a floating point error messes something up. I think the issue here is that I am using data gathered from physical sensors, meaning the inputs can be arbitrarily close to each other. I am worried though that if I round the inputs, that I will get different data points with the exact same x and y value, and I'm not sure how the geometry algorithms will handle that. Also, I am creating a global navigation mesh of triangles with this data. Floating point errors that are not accounted for correctly lead to triangles inside one another (as opposed to adjacent to each other), which damages the integrity of the entire mesh, as its hard to get your program to fix its own mistake.
    FYI:
    I am running java 1.6.0_20 in Eclipse Helios with Ubuntu 10.04x64
    Here is some code that didn't work using 1e-6 for delta. The test point new Point(-294.18294451166435,-25.496614108304477), is outside the triangle, but because of the delta choice it is seen as on the edge:
    class Point
         double x,y;
    class Edge
         Point start, end;
    class Triangle
         Edge[] edges;
         public Point[] getOrderedPoints() throws Exception{
              Point[] points = new Point[3];
              points[0]=edges[0].getStart();
              points[1]=edges[0].getEnd();
              if (edges[1].getStart().equals(points[0]) || edges[1].getStart().equals(points[1]))
                   points[2]=edges[1].getEnd();
              else if (edges[1].getEnd().equals(points[0]) || edges[1].getEnd().equals(points[1]))
                   points[2]=edges[1].getStart();
              else
                   throw new Exception("MalformedTriangleException\n"+this.print());
              orderNodes(points);
              return points;
            /** Orders node1 node2 and node3 in clockwise order, more specifically
          * node1 is swapped with node2 if doing so will order the nodes clockwise
          * with respect to the other nodes.
          * Does not modify node1, node2, or node3; Modifies only the nodes reference
          * Note: "order" of nodes 1, 2, and 3 is clockwise when the path from point
          * 1 to 2 to 3 back to 1 travels clockwise on the circumcircle of points 1,
          * 2, and 3.
         private void orderNodes(Point[] points){
              //the K component (z axis) of the cross product a x b
              double xProductK = crossProduct(points[0],points[0], points[1], points[2]);
              /*        (3)
               *          +
               *        ^
               *      B
               * (1)+             + (2)
               *       ------A-->
               * Graphical representation of vector A and B. 1, 2, and 3 are not in
               * clockwise order, and the x product of A and B is positive.
              if(xProductK > 0)
                   //the cross product is positive so B is oriented as such with
                   //respect to A and 1, 2, 3 are not clockwise in order.
                   //swapping any 2 points in a triangle changes its "clockwise order"
                   Point temp = points[0];
                   points[0] = points[1];
                   points[1] = temp;
    class TriangleTest
         private double delta = 1e-6;
         public static void main(String[] args)  {
                    Point a = new Point(-294.183483785282, -25.498196740397056);
              Point b = new Point(-294.18345625812026, -25.49859505161433);
              Point c = new Point(-303.88217906116796, -63.04183512930035);
              Edge aa = new Edge (a, b);
              Edge bb = new Edge (c, a);
              Edge cc = new Edge (b, c);
              Triangle aaa = new Triangle(aa, bb, cc);
              Point point = new Point(-294.18294451166435,-25.496614108304477);
              System.out.println(aaa.enclosesPointDetailed(point));
          * Check if a point is inside this triangle
          * @param point The test point
          * @return     1 if the point is inside the triangle, 0 if the point is on a triangle, -1 if the point is not is the triangle
          * @throws MalformedTriangleException
         public int enclosesPointDetailed(LocalPose point, boolean verbose) throws Exception
              Point[] points = getOrderedPoints();          
              int cp1 = crossProduct(points[0], points[0], points[1], point);
              int cp2 = crossProduct(points[1], points[1], points[2], point);
              int cp3 = crossProduct(points[2], points[2], points[0], point);
              if (cp1 < 0 && cp2 <0  && cp3 <0)
                   return 1;
              else if (cp1 <=0 && cp2 <=0  && cp3 <=0)
                   return 0;
              else
                   return -1;
             public static int crossProduct(Point start1, Point start2, Point end1, POint end2){
              double crossProduct = (end1.getX()-start1.getX())*(end2.getY()-start2.getY())-(end1.getY()-start1.getY())*(end2.getX()-start2.getX());
              if (crossProduct>floatingPointDelta){
                   return 1;
              else if (Math.abs(crossProduct)<floatingPointDelta){
                   return 0;
              else{
                   return -1;
    }

  • Floating Point Error

    Hi all!
    Does anybody understands the following Error Message or does anybody had it allready?
    I <u>tried</u> to write a little 3D-Engine just for fun, but the kvm doesn�t wantme to.
    Please help.
    ERROR: floating-point constants should not appear
    Error preverifying class J2mewtk.apps.DDD_Engine.src.DDD_Engine.Matrix_Operation
    com.sun.kvem.ktools.ExecutionException: Preverifier returned 1
    Build failed
    Thx in prev..

    Ok, after years it even came to me that the KVM doesn�t support floatingpoint numbers. :-)
    I found the MathFP package to be usefull for me, but can someone tell me where i have to put the package, so that i can import it? I am trying since hours ... ;-)

  • TS3694 I need help to fix error message -69

    I am having problem with syncing my ipod classic (160gb). I have this error message -69, that I need help with. I have already restored my ipod, but cannot add my anything (audiobooks-my music) to my ipod.

    see if you have any friend have a Mac computer, do a restore there before syncing with your PC

  • Need Help!! Errors during Local Client Copy

    Doing a Local Client Copy and getting these error messages in the log:
    Table Name       Component          Package
    /1CN/CMFSAPH0FOR                    DDIC Error        (See SE14)
    /1CN/CMFSAPH1FDT                    DDIC Error        (See SE14)
    /1CN/CMFSAPH1FFX                    DDIC Error        (See SE14)
    /1CN/CMFSAPH2TGR                    DDIC Error        (See SE14)
    /1CN/CMFSAPH2TRM                    DDIC Error        (See SE14)
    /1CN/CMFSAPH3TCT                    DDIC Error        (See SE14)
    /1CN/CMFSAPH3TUS                    DDIC Error        (See SE14)
    /1CN/CMFSAPH4TFX                    DDIC Error        (See SE14)
    /1CN/CMFSAPH4TQU                    DDIC Error        (See SE14)
    Then I go to SE14 then put the name of the tables then click CHECK >> DATABASE OBJECT and then as the result I get:
    "Table is not created in the database"
    If I go down to the database level and look within the Oracle database dba_tables the tables and objects exists within the database but SAP is unable to recognize them.  All objects were imported with a Oracle Data Pump dump file and now I just need help in getting SAP to recognize the tables.
    Edited by: Adam Gendle on Feb 19, 2010 12:29 AM

    Hi,
    Its showing inconsistency between ABAP Dictionary and the database.
    Have you run Test-Run before performing actual client copy ?
    Please check the Consistency of affected Tables.
    SE11 -> Display Table -> Utilities -> Database Object -> Check
    (check DB Object as well as Run time Object)
    Please refer this [SAP Note 686357 - Table pool length incorrect after Unicode conversion|https://service.sap.com/sap/support/notes/686357] to get more information. The relevant solution is mentioned there if the pool tables having inconsistency with VARDATA field.
    Also refer SAP Note 1171306 - Error with pooled tables when copying a client.
    Regards,
    Bhavik G. Shroff

  • Need help asap with Error #2109!

    Need major help in an error that is driving me crazy! I have a movie clip button, however, once you click on it the output will say:
    ArgumentError: Error #2109: Frame label instance15 not found in scene Scene 1.
    at flash.display::MovieClip/gotoAndStop()
    at index_fla::MainTimeline/goLabel()
    i am new in flash and trying to learn as3.  i've looked at what error this is but i cant get my head around it.  what i m trying to do it if you click on a button, a swf file will load on the the page. but it is not loading and the error comes up!
    my code is:
    function goLabel(e:MouseEvent):void
    gotoAndStop(e.target.name);
    if anyone knows how to solve this problem please help! let me know if i need any other codes, but this should be it!
    thanks. i am about to go bald.

    Do you have a frame on your timeline that is labeled as "instance15"?
    The code you show will do nothing in the way of loading an swf.... gotoAndStop is a timeline command, not a file loading command.

  • [solved] my C code gives floating point errors.

    I've tried to create a simple function to determine if a number is prime or not.. whenever I compile and try to run I get a floating point exception and can't quite figure out why, I'm very new to C and compiling manually using gcc so any help is appreciated.
    here's my code: http://pastebin.com/m2f19dbac
    Last edited by zandaa (2008-10-01 06:36:35)

    I'm quite useless at programming:
    for (i=0; i <= x; i++) {
    if (x%i == 0 && i != 1) {
    result = 0;
    //break;
    if (i == x) {
    result = 1;
    //printf("%d\n", x);
    break;
    This loop always ends with result=1 because the last loop has i=x and therefore it changes the result value to 1.
    There are also many checks you could avoid with a "smart" for cycle:
    for (i=2; i <= x; i++) {
    if (x%i == 0) {
    return 0;
    return 1
    I was able to remove the "i != 1" part by having the for loop starting from 2.
    I removed all the if (i == x) clause because that only happens at the end of the for cycle.
    Also you could be smart and eliminate some values from the loop: for example you could avoid checking all the numbers higher than n/2 or than sqrt(n), but that's more related to the mathematics behind than to the programming
    Hope this helps
    edit: beaten
    Last edited by carlocci (2008-09-25 21:36:04)

  • Need help correcting message error number

    Hello, i need help correcting message number for running archiving test runs.
    05.08.2011 08:31:42 Message number 999999 reached. Log is full                                BL           252          E
    05.08.2011 08:31:42 Job cancelled after system exception ERROR_MESSAGE                        00           564          A
    Any help wopuld be appreciated.
    Regards.

    Summary
    Symptom
    One or several database tables of the application log contain too many entries.
    The following database tables belong to the application log:
    - BALHDR (all releases)
    - BALHDRP(< 4.6C)
    - BALM   (< 4.6C)
    - BALMP  (< 4.6C)
    - BALC   (< 4.6C)
    - BALDAT  (>= 4.6C)
    - BAL_INDX (all releases)
    Other terms
    RSSLG200,
    RSSLGK90,
    SLG2,
    application log,
    log
    delete,
    performance
    Reason and Prerequisites
    The application log is a tool to collect, save and display logs.
    Many different applications collect messages in the application log which contain information or messages for the end user. The application automatically log serves as a temporary storage for messages. The logs are written on the database but they are not automatically deleted.
    There is no general procedure for switching the application log on or off. Some applications provide this option or they offer the option of reducing the number of entries created. (See Notes 91519, 183960, 141244).
    The expiration date of application logs
    A log usually has an expiration date, which is set by the application, that calls the 'Application log' tool. If the application log does not set an expiration date, the 'Application log' tool sets the expiration date as 12/31/2098 or 12/31/9999,depending on the release, which allows the logs to stay in the system for as long as possible. The end user cannot set the expiration date. The expiration date does not mean that logs which have reached that date will automatically be deleted. It is used to control the deletion of logs when you call the Deletion report. The DEL_BEFORE flag in the BALHDR table determines whether or not the log can be deleted even before the expiration date is reached.
    DEL_BEFORE= SPACE means that the log can be deleted before the expiration date is reached. (Default value)
    DEL_BEFORE='X' means that the log can only be deleted after the expiration date.
    Solution
    Deleting the logs of the application log.
    Releases >= 4.6A:
    =====================================================================
    In Releases >= 4.6A, use Transaction SLG2.
    On the selection screen you can restrict the amount of logs to be deleted:
    The 'Object' and 'Subobject' fields specify the application area in which the logs were written (see F4 Help).
    The 'External Identification' field specifies the number which was          provided for this log by the application.
    o  If you also want to delete logs which have not reached the expiration date you must set the option "Also logs which can be deleted before the expiration date".
    Select 'Help with application' in Transaction SLG2 for further explanation of the procedure for deleting.
    SLG2 is a report transaction. The corresponding report is SBAL_DELETE. At regular intervals, this can be scheduled as a background job.
    Releases < 4.6A:
    =====================================================================
    For Releases < 4.6A, note the following instructions:
    In general, the deletion of application logs can be carried out in two steps:
    1. Report RSSLG200: Deletion of all logs which expired:
    Use report RSSLG200 to delete all logs whose expiration date is reached or exceeded. (This report is not yet available in the standard in Release 3.0F. In this case, the report can be installed in advance; see corrections attached to this note).
    As of Release 3.1H, Report RSSLG210 is also available. This report allows the definition of a job that runs regularly and deletes such logs.
    2. Report RSSLGK90: Deleting all logs for which a deletion is allowed before expiration:
    Sometimes, step 1 does not delete enough logs. The reason for this might be that the expiration date of the logs is too far in the future or that no expiration date has been defined at all (in this case, depending
    on the release, the assumed expiration date is 12/31/2098 or 12/31/9999)
    Use report RSSLGK90 for these logs.
    When you execute this report, you can restrict the logs to be deleted in a selection screen:
    The fields 'Object' and 'Subobject' specify the application area which wrote the logs (see F4 help).
    The field 'External number' indicates the number which was assigned by the application for this log.
    Field 'Log class' indicates the importance of the log.
    NOTE: By default, this field contains the value '4', this means only logs with additional information. If you want to delete all logs, enter the value '1' in this field. All logs with log class '1' or higher will then be deleted.
    The fields 'To date' and 'Until time' refer to the creation date of a log.
    If you enter 12/31/1998 and 23:59:59, you get all logs created in and before 1998
    NOTES:
    Client-dependency:
    Note that the application log tables are client-dependent. Therefore, you must delete data in each client.
    Which applications create entires in the application log:
    To determine which applications create the logs, look in Table BALHDR to see which objects the logs were created for ( Transaction SE16, Table BALHDR, Field OBJECT). You can find the text description for the object in Table BALOBJT. The application is usually derived from the name and text of the object. The log is displayed in Transaction SL61. The display is restricted to certain objects, among other things.
    Database error:
    If very many data exists on the DB, Report RSSLGK90 might cause problems. In this case, implement Note 138715.
    In very rare cases a dump is created even after Note 138715 was implemented:
        ABAP/4 runtime error  DBIF_RSQL_SQL_ERROR
        SQL error 1555 occurred accessing table "BALHDR "
        Database error text...: "ORA-01555: snapshot too old
    If you cannot correct the error by means of database utilities, Note 368700 provides a way to bypass this error.
    Report RSSLG200 can also run into problems. In this case, use the correction for Report RSSLG200 attached to this Note.
    Expiration date in Report RSSLGK90:
    There are logs on the database which may only be deleted explicitly after the expiration date (flag DEL_BEFORE = 'X' in table BALHDR). These logs are not deleted in advance by report RSSLGK90. Since, however, this flag is used very rarely, you can ignore this data.
    Restriction of the quantity of log data by the application:
    To avoid large quantities of logs from different applications, also refer to the following notes:
    - 91519
    - 183960
    - 141244
    Archiving logs:
    As of Release 6.20, it has been possible to archive logs.
    The logs are archived via archiving object BC_SBAL.
    The archiving programs are started via Transaction SARA (archive administration).
    Via Support Packages, the archiving of application logs has been made available for Releases 4.6C (SAPKB46C27), 4.6D (SAPKB46D17), and 6.10 (SAPKB61011) as well.
    Header Data
    Release Status: Released for Customer
    Released on: 04.08.2005  13:55:45
    Master Language: German
    Priority: Recommendations/additional info
    Category: Consulting
    Primary Component: BC-SRV-BAL Basis Application Log
    Affected Releases
    Software
    Component Release From
    Release To
    Release And
    subsequent
    SAP_APPL 30 30F 31I  
    SAP_APPL 40 40A 40B  
    SAP_APPL 45 45A 45B  
    SAP_BASIS 46 46A 46D X
    SAP_BASIS 60 610 640 X
    Corrections Instructions
    Correction
    Instruction Valid
    from Valid
    to Software
    Component Last
    Modifcation
    158903 30F 30F SAP_APPL 16.05.2000  07:13:08
    162069 31H 45B SAP_APPL 16.05.2000  07:16:07
    Related Notes
    1009281 - LAW: Runtime error CONNE_IMPORT_WRONG_COMP_TYPE
    856006 - Mass processing saves unnecessary logs
    737696 - Add. info on upgrade to SAP R/3 Enterprise 4.70 Ext. 2 SR1
    706478 - Preventing Basis tables from increasing considerably
    637683 - Add info about upgrade to SAP R/3 Enterprise Core 4.70 Ext 2
    587896 - Add. info on upgrade to SAP R/3 Enterprise Core 4.70 SR1
    540019 - Report RJBTPRLO does not work correctly
    400687 - Delete application log: DBIF_RSQL_INVALID_CURSOR
    390062 - Additional information about upgrading to 4.6C SR2
    370601 - Composite SAP note: APO 3.0 and 3.1 performance
    365602 - M/AM: Sales agent determination log - perf.
    327285 - Additions to upgrade to 4.6C SR1
    183960 - ALE: Deactivating application logs for data transfers
    141244 - Deactivating the application log during data transfer
    138715 - RSSLGK90: Too many lock entries in the database
    118314 - Installing the interface to a separate EH&S
    91519 - Deleting logs of the application log
    Print Selected Notes (PDF) 
    Attributes
    Attribute Value
    Transaction codes BALC
    Transaction codes BALM
    Transaction codes CLEAR
    Transaction codes HIER
    Transaction codes SARA
    Transaction codes

  • Floating-point Error (Win XP Pro, Win XP Home, Win Server 2003)

    I have installed Safari on three machines. All three are have the same issue. When I load Safari, it comes up fine. If I wait for the initial page to load completely, I will get the error below. If I hit the X (stop) before the page loads completely, I get no error. I can type a new URL (www.google.com for example) and go to the new page. But, the same thing will happen if I wait for the entire page to load. This is happening on Windows XP Home, Windows XP Professional, and Windows Server 2003 Standard. All three machines have a similiar software configuration.
    All have the following installed:
    - Skype
    - Visual Studio 2005
    - SQL Server 2005 Client Tools
    - SonicWall VPN Client
    - uTorrent
    The error is:
    The exception Floating-point invalid operation.
    (0xc0000090) occurred in the application at location 0x6dc29f5c.
    Anyone have a work-around? Is this a known issue?

    ttt

  • Need help determining compiling error

    Good morning,
    I need help finding the cause of a compiling error I receive. I have reviewed my code numerous times without any luck. I hope you guys might see something I am not! The entire file exceeds the limit I can post, so I am attaching it in 2 posts. Sorry for the inconvenience. The error and my code are posted below. Thank you for your help!
    C:\StockTrackerDB.java:382: cannot find symbol
    symbol : method add(java.lang.Boolean)
    location: class java.util.ArrayList<java.lang.String>
                   aList.add(new Boolean(rs.getBoolean("admin")));
    ^
    1 error
    Tool completed with exit code 1
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class StockTrackerDB
         private Connection con = null;
         //Constructor; makes database connection
         public StockTrackerDB() throws ClassNotFoundException,SQLException
              if(con == null)
                   String url = "jdbc:odbc:StockTracker";
                   try
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   catch(ClassNotFoundException ex)
                        throw new ClassNotFoundException(ex.getMessage() +
                                    "\nCannot locate sun.jdbc.odbc.JdbcOdbcDriver");
                   try
                        con = DriverManager.getConnection(url);
                   catch(SQLException ex)
                        throw new SQLException(ex.getMessage()+
                                    "\nCannot open database connection for "+url);
         // Close makes database connection; null reference to connection
         public void close() throws SQLException,IOException,ClassNotFoundException
              con.close();
              con = null;
         // Method to serialize object to byte array
         private byte[] serializeObj(Object obj) throws IOException
              ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
              ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
              objOStream.writeObject(obj); // object must be Serializable
              objOStream.flush();
              objOStream.close();
              return baOStream.toByteArray(); // returns stream as byte array
         // Method to deserialize bytes from a byte array into an object
         private Object deserializeObj(byte[] buf) throws IOException, ClassNotFoundException
              Object obj = null;
              if(buf != null)
                   ObjectInputStream objIStream = new ObjectInputStream(new ByteArrayInputStream(buf));
                   obj = objIStream.readObject(); //IOException, ClassNotFoundException
              return obj;
         // Methods for adding a record to a table
         // add to the Stocks Table
         public void addStock(String stockSymbol, String stockDesc) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO Stocks VALUES ('"
                                    +stockSymbol+"'"
                                    +",'"+stockDesc+"')");
              stmt.close();
         // add to the Users table
         public boolean addUser(User user) throws SQLException,IOException,ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) == null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("INSERT INTO Users VALUES (?,?,?,?,?)");
                   pStmt.setString(1, dbUserID);
                   pStmt.setString(2, dbLastName);
                   pStmt.setString(3, dbFirstName);
                   pStmt.setBytes(4, serializeObj(pswd));
                   pStmt.setBoolean(5, isAdmin);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User exists - cannot add.");
              return result;
         // add to the UserStocks table
         public void addUserStocks(String userID, String stockSymbol)
                        throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO UserStocks VALUES ('"
                                    +userID+"'"
                                    +",'"+stockSymbol+"')");
              stmt.close();
         // Methods for updating a record in a table
         // updating the Users table
         public boolean updUser(User user) throws SQLException, IOException, ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) != null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("UPDATE Users SET lastName = ?," + " firstName = ?, pswd = ?, admin = ? WHERE userID = ?");
                   pStmt.setString(1, dbLastName);
                   pStmt.setString(2, dbFirstName);
                   pStmt.setBytes(3, serializeObj(pswd));
                   pStmt.setBoolean(4, isAdmin);
                   pStmt.setString(5, dbUserID);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User does not exist - cannot update.");
              return result;
         }

         // Methods for deleting a record from a table
         // delete a record from the Stocks table
         private void delStock(String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("DELETE FROM Stocks WHERE "
                                    +"symbol = '"+stockSymbol+"'");
              stmt.close();
         // delete a record from the Users table
         public void delUser(User user) throws SQLException,IOException,ClassNotFoundException
              String dbUserID;
              String stockSymbol;
              Statement stmt = con.createStatement();
              try
                   con.setAutoCommit(false);
                   dbUserID = user.getUserID();
                   if(getUser(dbUserID) != null) // verify user exists in database
                        ResultSet rs1 = stmt.executeQuery("SELECT userID, symbol "
                                              +"FROM UserStocks WHERE userID = '"+dbUserID+"'");
                        while(rs1.next())
                             try
                                  stockSymbol = rs1.getString("symbol");
                                  delUserStocks(dbUserID, stockSymbol);
                             catch(SQLException ex)
                                  throw new SQLException("Deletion of user stock holding failed: " +ex.getMessage());
                        } // end of loop thru UserStocks
                        try
                        {  // holdings deleted, now delete user
                             stmt.executeUpdate("DELETE FROM Users WHERE "
                                              +"userID = '"+dbUserID+"'");
                        catch(SQLException ex)
                             throw new SQLException("User deletion failed: "+ex.getMessage());
                   else
                        throw new IOException("User not found in database - cannot delete.");
                   try
                        con.commit();
                   catch(SQLException ex)
                        throw new SQLException("Transaction commit failed: "+ex.getMessage());
              catch (SQLException ex)
                   try
                        con.rollback();
                   catch (SQLException sqx)
                        throw new SQLException("Transaction failed then rollback failed: " +sqx.getMessage());
                   // Transaction failed, was rolled back
                   throw new SQLException("Transaction failed; was rolled back: " +ex.getMessage());
              stmt.close();
         // delete a record from the UserStocks table
         public void delUserStocks(String userID, String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              ResultSet rs;
              stmt.executeUpdate("DELETE FROM UserStocks WHERE "
                                    +"userID = '"+userID+"'"
                                    +"AND symbol = '"+stockSymbol+"'");
              rs = stmt.executeQuery("SELECT symbol FROM UserStocks "
                                         +"WHERE symbol = '"+stockSymbol+"'");
              if(!rs.next()) // no users have this stock
                   delStock(stockSymbol);
              stmt.close();
         // Methods for listing record data from a table
         // Ordered by:
         //          methods that obtain individual field(s),
         //          methods that obtain a complete record, and
         //          methods that obtain multiple records
         // Methods to access one or more individual fields
         // get a stock description from the Stocks table
         public String getStockDesc(String stockSymbol) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              String stockDesc = null;
              ResultSet rs = stmt.executeQuery("SELECT symbol, name FROM Stocks "
                                                      +"WHERE symbol = '"+stockSymbol+"'");
              if(rs.next())
                   stockDesc = rs.getString("name");
              rs.close();
              stmt.close();
              return stockDesc;
         // Methods to access a complete record
         // get User data from the Users table
         public User getUser(String userID) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              byte[] buf = null;
              User user = null;
              ResultSet rs = stmt.executeQuery("SELECT * FROM Users WHERE userID = '" +userID+"'");
              if(rs.next())
                   dbUserID = rs.getString("userID");
                   dbLastName = rs.getString("lastName");
                   dbFirstName = rs.getString("firstName");
                   // Do NOT use with JDK 1.2.2 using JDBC-ODBC bridge as
                   // SQL NULL data value is not handled correctly.
                   buf = rs.getBytes("pswd");
                   dbPswd=(Password)deserializeObj(buf);
                   isAdmin = rs.getBoolean("admin");
                   user = new User(dbUserID,dbFirstName,dbLastName,dbPswd,isAdmin);
              rs.close();
              stmt.close();
              return user; // User object created for userID
         // Methods to access a list of records
         // get a list of selected fields for all records from the Users Table
         public ArrayList listUsers() throws SQLException,IOException,ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT userID, firstName, lastName, admin "
                                                 +"FROM Users ORDER BY userID");
              while(rs.next())
                   aList.add(rs.getString("userID"));
                   aList.add(rs.getString("firstName"));
                   aList.add(rs.getString("lastName"));
                   aList.add(new Boolean(rs.getBoolean("admin")));
              rs.close();
              stmt.close();
              return aList;
         // get all fields in all records for a given user from the UserStocks table
         public ArrayList listUserStocks(String userID) throws SQLException, IOException, ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT * FROM UserStocks "
                                                      +"WHERE userID = '"+userID+"' ORDER BY symbol");
              while(rs.next())
                   aList.add(rs.getString("symbol"));
              rs.close();
              stmt.close();
              return aList;
    }

  • Need help with an Error

    Hello, im using this class to query a table from my database. everything is ok, but when i write the closing } of the Main class the Program gives an error. In the main class ive wrote here at the bottom, the main class has no ending } . Now only the final } gives an error but everything else is ok, ive double checked all brackets, they are all in good place, what is going wrong?
    package DBandQueryHandler;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    class Main {
        public static void main(String[] args){
            Class driver_class=null;
                    try{    
                        driver_class=Class.forName("com.mysql.jdbc.Driver");         }
                    catch(ClassNotFoundException e){ 
                        e.printStackTrace(); 
                        return;
            System.out.println("Found Driver"+ driver_class);
            Connection connection=null;
            try{
                connection= DriverManager.getConnection("jdbc:mysql://localhost:3306/....", ".....", "........");
            catch(SQLException e){
                e.printStackTrace();
                return;
            try{
                System.out.println("Established connection to"+ connection.getMetaData().getURL());
            catch(SQLException e1){
                e1.printStackTrace();
            Statement statement=null;
            try{
                statement= connection.createStatement();
                statement.execute("SELECT * FROM KLANTEN");
                Resultset resset= statement.getResultSet();
                System.out.println("Row user_id, username, password, abbonement1, abbonement2, openstaand");
                while(resset.next()){
                    System.out.println(resset.getRow());
                    System.out.println("" + resset.getSring("user_id"));
                    System.out.println("" + resset.getSring("username"));
                    System.out.println("" + resset.getSring("password"));
                    System.out.println("" + resset.getSring("abbonement1"));
                    System.out.println("" + resset.getSring("abbonement2"));
                    System.out.println("" + resset.getSring("openstaand"));
                resset.close();
            catch(SQLException e){
                e.printStackTrace();
            finally{
                if(statement=null){
                    try{
                    statement.close();
                    catch(SQLException e){
                e.printStackTrace();
                if(connection=null){
                    try{
                    connection.close();
                    catch(SQLException e){
                e.printStackTrace();
       }

    javaboy2 wrote:
    Like i said, when i write all brackets correctly, the program gives errors, but when i delete the the last bracket, the program doesnt give errors(except for the last bracket=> '}' expected). I dont understand this.
    The errors of the program with correct amount of brackets are these: Yes, the errors come up with correct brackets because you have errors . When you take out the bracket, the structure is too bad so it doesn't look for the rest of the errors. This problem has absolutely nothing to do with brackets at all. That's why you needed to post the errors in your first post, rather than ignoring them and pretending your code is perfect and blaming it on brackets.
    And these errors would be fixed if you read them.
    Cannot find symbol ResultsetThat's because there is no class called Resultset. It's called ResultSet.
    Your if statements are using assignment instead of equality
    statement=null; //that assigns null to the statement object
    statement==null; //that checks to see if statement equals nullAgain, read your errors. They don't lie.

  • Need help in runtime error

    I try to run the ausp dbtable.
    with entries of object: 00001019680 and more that 1300 entries
    Inter char. sr_code
    classtype: z01
    the problem is display in a short dump with this message
    There is no help text for this runtime error either the text was inadvertently deleted or the release of the kernel differs from that of that of the database.
    Thanks.
    I hope you could help me. I need it urgent

    Hi rhym,
    Thta soounds like a memory issue to me. At least that is what causes that to happen to me.
    The 'slice' of data you are requesting, based on your criteria, may be more mega bytes than the memory buffer. Too much data perhaps.
    When this happens to me I have to take smaller chuncks of data, multiple extractions, then paste them all together.
    Try half the number of entries, and see.
    RS

  • Need help in returning error condition from web service

    Hi,
    I need one help regarding webservice. Currently my web service is returning "true" value when it works fine without any issues but it returns "false" when any any error is encountered. So my question is, can we return error instead of string "false". I dont know how to return exact error from webservice. If you any idea then please mail me.
    Below is a small code snippet:
    System.out.println("User "+ userFullName + usrKey + " end date has been updated to "+usrEndDate +" in IDM DB");
    result = true;
    catch (tcAPIException e) {
    log.error("Error in finding the user" + e.getMessage());
    result = false;
    } catch (tcUserNotFoundException e) {
    log.error("Error in getting user status" + e.getMessage());
    result = false;
    } catch (tcStaleDataUpdateException e) {
    log.error("Error in updating end date of user" + e.getMessage());
    result = false;
    }catch (Exception e1) {
    e1.printStackTrace();
    result =false;
    return result;
    Here i want to return error instead of false. Can we do that?
    Thanks,
    Kalpana.

    instead of storing false store below
    use result=e1.getMessage();
    Edited by: Nishith Nayan on Feb 23, 2012 8:07 PM

Maybe you are looking for

  • Inputstream.java.io.IOException  ,  applet connection

    I'm working on a problem with the failure of a java applet connection to a java servlet. The connection is via the internet, and over port 80. the java console loggin reports the following There was an attempt to redirect a url request, but the attem

  • After 4.2 upgrade iPad keyboard not working where it used to

    Before installing 4.2.1 on my iPad I was able to go online and play soduku on the Times website Now I cannot get the keyboard to appear I did download the Times app, it was complementary with my subscription, that doesn't seem to have soduku in it. W

  • 3d files/ size limit in CS5?

    Anyone know if theres a 3d file quantity / size limit within a photoshop document? What would any limit be dependant on, e.g, VRAM? Running Photoshop 64bit Cs5 Extended, all updates, on a dual xeon, 12gb ram, 64bit win 7, NVidia Quadro FX 3800 (1gb),

  • Need an idea about performance ..

    I want to know as whether filtering more in a query increases performance of a query or decreases it .. Actually i executed a query which taken 5 mins around and so i did some filterings taking a point in a mind as filtering will not access whole tab

  • PowerMac G5 and Diamond ATI Radeon HD 2600PRO not working?

    Recently bought and restored a 1.8GHz DP PCI-X PowerMac G5 off Craigslist. In the process of restoration, I decided to upgrade the original 64mb AGP card to a Diamond ATI Radeon HD 2600PRO 256MB AGP card. While ordering said card, I did not realize i