How to deserailize BigDecimal in C++

Hi,
I'm not able to deserialize big decimal object in oracle coherence cache by c++?
if I read this big decimal value as object then how I'm going to read this value?
Please share your thoughts..
Thanks and regards,
Sura

I don't think we have an equivalent of BigDecimal in our C++ POF implementation. You probably need to write your own deserializer.
Thanks,
Wei

Similar Messages

  • How to convert BigDecimal to double

    Error Message: {http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1}operationErroredFault
    Fault ID default/BusinessRule2!1.0*b48a0c26-0b59-41e0-8939-55c7589d76f1/BusinessRule2_BPELProcess/10004-BpInv0-BpSeq2.9-4
    Fault Time Jan 15, 2010 11:52:33 AM
    Non Recoverable System Fault :
    <bpelFault><faultType> <message>0</message></faultType><operationErroredFault xmlns="http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1"><part name="payload"><errorInfo xmlns="http://xmlns.oracle.com/OracleRules1/OracleRules1_DecisionService_1"><errorMessage>cannot convert from type 'java.math.BigDecimal' to type 'double' at line 5 column 9 in main</errorMessage></errorInfo></part></operationErroredFault></bpelFault

    >
    > how to convert bigdecimal to double in webdynpro java
    Hi,
    Try this:
    double x = wdContext.currentContextElement().getBigdecimalAttribute().doubleValue();
    Refer methods applicable on Bigdecimal here -
    http://code.google.com/android/reference/java/math/BigDecimal.html
    Regards,
    Anagha
    Edited by: Anagha Jawalekar on Nov 17, 2008 12:08 PM

  • How to pass BigDecimal as currecny to Crystal Reports using JRC 11

    Im using JRC to load and view crystal reports.ie loading crystal reports that are created (not by me) using Crystal Reports v 10. My work is just load those rpt files using JRC thick client.
    rpt files are bound to .mdb (MS Access) database and DB is password protected.  One of the table in database has currency data type. I'm creating a POJO class to implement the table structure. To match with Currency type, Im using BigDecimal type in my pojo class. when i open the .rpt file in crystal report designer, it shows with default currency symbol (i.e $ and  £) But the when i load the same report via JRC, It doesnot show the symbol at all.
    When I change this to String and pass symbol, it is coming up properly. But in some places, the reports use sum function of 2 curency fields. So in this case, string cannot be used.
    Any help would be appreciated.
    Thanks.

    Sorry. I did not get your point directly.
    So I'd recommend not directly relying on internal handling of BigDecimal. You can still report off the value.
    So you are telling me not to use BigDecimal? If not what should I use? Please be bit more explanative.
    Thanks.

  • How to send a bigdecimal by DataOutputStream

    Hi Folks!
    Can anybody tell me how i can send a bigDecimal to my client through DataOutputStream object. There are methods in DataOutputStream class for sending long,int,string,double,short and so on BUT there is nothing for bigDecimal.
    Here is my code.
      Socket cs;
      DataInputStream br;
      DataOutputStream dos;
    public void run(){
    try{
         BigDecimal bd = new BigDecimal ( 12342342.234234 ) ;
         bd = bd.setScale ( 1, BigDecimal.ROUND_DOWN ) ;
         System.out.println ( bd ) ;
       //here how i cant send my BigDecimal those dos object?
       dos.
    }catch(Exception e){}
    }Thanks in Advance

    you are correct there is a method bytevalue() in bigDecimal class. which conver my bigDecimal value into bytevalue. WORKS FINE. but on the client side when i receive "BYTEVALUE()" how can i bring it back to the original. Because ofcurse i am gettin my coverted byte value not the original value of bigDecimal..
    Here's how i convert Bigdecimal into bytevalue
         System.out.println("Original "+bd);
         dos.writeByte(bd.byteValue());
         System.out.println("BigInt byte values. "+bd.byteValue());
         dos.flush();now on client side thats how i read it,, BUT bytevalue not the original
        byte b = br.readByte();   
        System.out.println("I got byte value of bigint " + b);   
    Thanks in advance

  • BigDecimal formatting -- Please Help!!!

    Hi all,
    Could anyone please tell a Java newbie how to format BigDecimal? I have a variable defined as BigDecimal. I am displaying that value in a JTable. I need to format the value with commas but not cents.... i.e. 23,245 not 23,245.24. Is this possible and if so, how?
    Please help!!!
    Thanks in advance.
    Lynn

    Hi,
    try
    java.math.BigDecimal big = new java.math.BigDecimal(23245.24);
    java.text.DecimalFormatSymbols symbols = new java.text.DecimalFormatSymbols();
    symbols.setGroupingSeparator(',');
    java.text.DecimalFormat formatter = new java.text.DecimalFormat("###,###",symbols);
    String res=formatter.format(big);
    you can then put the res String in the JTable
    regards

  • Looking for examples using BigDecimal

    Two newbies to Java are looking for examples of code that use the BigDecimal features for rounding and truncating large numbers to more user-friendly values.
    We are doing some hefty math calculations on values defined as doubles and want to round and truncate to within 1/100th for display purposes.
    We've tried some stuff on our own, but it is not cooperating. Any help would be greatly appreciated!

    Here is a good article of how to use BigDecimal
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0601-cents.html
    Hope this helps

  • DB2 and BigDecimal

    Hi All
    I am trying to insert a Bigdecimal val in to db2 Decimal ue (Ex .. "25.4567444") Column ..I tried the
    setString and setBigDecimal of the prepared statement ..But the fraction part is getting truncated when i do the insertion ...
    My Env is
    DB2 ver 7.1
    OS : Nt 4.o
    Does any know how to insert BigDecimal without getting truncated ....
    Thanks in advance

    Atlast I found out what the problem ...was ... !!!
    If u have any problem like this please check the DB2 or the database that u r using ...
    Any Numeric Coumns in Database would be having a precision and the Scale field ...Check these fields. If the scale is defined as Zero ...then the Numerical Value u r trying to insert will be truncated ...
    Have Fun

  • How to get a BigDecimal from german number (12,34)?

    How can i convert a string "12,34" to a BigDecimal object (value of 12.34)?
    I tried using special locale NumberFormat, but this doesn't work:
         * Convert a string to a BigDecimal object.
         * @param string String to convert.
         * @param pattern Pattern format to parse input string.
         * @param locale Locale to use for text formatting.
         * @return BigDecimal BigDecimal object with value represented by <I>string</I>
         * or null if conversion failed or <I>string</I> is empty.
        public static BigDecimal toBigDecimal(String string, String pattern, Locale locale) {
            BigDecimal result = null;
            if (string != null) {
                if (pattern == null) {
                    pattern = "###,###,###,##0.####"; //default
                if (locale == null) {
                    locale = Locale.getDefault(); //default is GERMANY anyway ...
                DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(locale);
                df.applyPattern(pattern);
                Number num = df.parse(string, new ParsePosition(0));
                if (num != null) {
                    try {
                        string = string.replace(',', '.');
                        result = new BigDecimal(string);
                    } catch (NumberFormatException nfe) { /* ignore */ }
            }//else: input unavailable
            return result;
        }//toBigDecimal()this code only works for string "12.34" but not for "12,34" (german style)... ?

    no, num.doubleValue() is not exact enough (can lead to different numbers after the decimal point). the only way i have found so far to convert exactly is to use the String constructor of BigDecimal.
    the starnge thing is, that the same value as a fixed string works, but not the string value:
        public static BigDecimal toBigDecimal(String string, String pattern) {
            BigDecimal result = null;
            if (string != null) {
                java.text.DecimalFormat df = new java.text.DecimalFormat(pattern);
                Number num = df.parse(string, new java.text.ParsePosition(0));
                if (num != null) {
                    try {
                        string = string.replace(',', '.');
                        System.out.println("1: "+new BigDecimal("12.34"));
                        System.out.println("2: "+new BigDecimal(string)); //thorws NumberFormatException, even though string has the value "12.34" (checked with debugger)
                        result = new BigDecimal(string);
                    } catch (NumberFormatException nfe) {
                        System.err.println("toBigDecimal():"+ nfe);
            return result;
        }//toBigDecimal()output:
    1: 12.34
    toBigDecimal():java.lang.NumberFormatException: 1234
    where is the decimal point? the debugger shows that 'string' has the value "12.34" (with decimal point)????

  • How to call a AS/400 Stored Procedure with a BigDecimal Value?

    Hi,
    Could you pls tell me how to call a stored procedure on the AS/400 which request an input value of packed decimal(10P 4) value.
    I have tried to convert it to a BigDecimal in Java and call the stored procedure as follows but it gave me a decimal point error on the AS/400.
    Could you pls show me where I'm wrong in the following code.
    Thanks
    Jan
    ========Java program to call AS/400 Stored procedure with setBigDecimal()===========
    //Assign the value to String
    string sBDVal = "30"
    //Convert the String value to BigDecimal
    BigDecimal bdAmt = new BigDecimal(sBDVal);
    //Call Stored Procedure with parameters,
    CallableStatement callSP = conn.prepareCall("{call OSCUPDLENS(?,?,?)}");
    // Set in parm values
    callSP.setString(1,"Value 1");
    callSP.setBigDecimal(2,bdAmt);
    callSP.setString(3,"");
    // Register out parameter
    callSP.registerOutParameter(3, Types.CHAR);
    // Execute call to stored procedure
    callSP.execute();
    // Retrieve out parameters
    sErrFlag = callSP.getString(3).trim();
    ========================Create Stored Procedure on AS/400===========================
    c/EXEC SQL
    c+ CREATE PROCEDURE TESTSPROC
    c+ (IN VAL1 CHAR ( 8),
    c+ IN BDAMT DEC (10, 4),
    C+ INOUT ERR CHAR ( 1))
    C+ LANGUAGE RPGLE NOT
    C+ DETERMINISTIC NO SQL EXTERNAL NAME TESTSPROC PARAMETER STYLE
    C+ GENERAL
    c/END-EXEC
    ======RPG program on AS/400 to accept the BigDecimal value to a Packed decimal======
    * Initialize the i/p parameter
    DP#VAL1 S 8A
    DP#AMT S 10P 4
    DP#ERR S 1A
    C*Input parameters
    C *ENTRY        PLIST                          
    C PARM P#VAL1
    C PARM P#AMT
    C PARM P#ERR

    Could you pls show me where I'm wrong in the following codeI don't know, you're doing a lot of things I have never tried. But "decimal data error" most likely means that the stored procedure is expecting packed data and the driver is giving it zoned data, or vice versa. You could confirm that by dumping your variables inside your RPG. If that is your problem, you could work around it by redefining your BDAMT parameter as integer or string and reformatting it in the RPG.

  • How can i convert BigDecimal value in BigInteger

    Hi Folk!
    I am problem i need to change BigDecimal value in BigInteger. Can anybody tell me how can i do it?
    I Know how to change a BigInteger value in BigDecimal. Here is the code.
    BigInteger bint = BigInteger.valueOf(1231231232);
    BigDecimal input2 = new BigDecimal(input);but I have a BigDecimal how can i do the opposite what i have done in code?
    Thanks in Advance

    I am problem... that's not good.
    (Glad to see you got your problem resolved.)

  • How can I validate value of BigDecimal into af:inputText??

    I have a af:inputText which value is binded a BigDecimal value.
    The big decimal value is held in DB with number format NUMBER(10,2),
    to validate this value, what types of validation technique should to be used?
    NUMBER(10,2) , user is able to enter value with format just 10,100 or 10.02 etc.
    The format with comma 10,2 the page automatically validate the value with message "java.lang.NumberFormatException", also how can I change this message.
    <af:inputText value="#{Page1Bean.bank.balance}"/> // balance is BigDecimal

    Hi again,
    I can just point you to these links:
    http://download-uk.oracle.com/docs/html/B25947_01/bcrules006.htm#sm0241
    for the theoretical aspects, and the second from Steve Muench's blog which is more "practical":
    http://radio.weblogs.com/0118231/stories/2005/07/21/recommendedValidationStrategies.html
    Hope that can help,
    Best regards,
    Tif

  • How to deal with bigdecimal in DataProvider getValue method

    Dear Sir/Madam
    Trying
    employeeDataProvider.getValue("EMPLOYEE.NUMBER0")
    gives an error .
    My Database is Oracle. EMPLOYEE.NUMBER0 is NUMBER(5).
    Databound shows EMPLOYEE.NUMBER0 to be bigdecimal.
    please advise how to deal with bigdecimal to be able to execute
    employeeDataProvider.getValue successfully.
    Thanks a lot for your kind assistance
    Salah Beidas

    employeeDataProvider.getValue("EMPLOYEE.NUMBER0")
    gives an error .What is the error? Does red x appears in the margin in the Java source editor? If so, when you place the curson over the red x, the tooltip shows the error. What does it say.
    Is it a runtime error? Does a page show with a stacktrace? If so, what is the error? When you look at the stack trace do you find your page mentioned anywhere. If so, it shows a line number. What does that code look like (that is pointed to by the line number)?

  • How to parse a BigDecimal from a localized number String

    I want to be able to build a BigDecimal instance from a localized String.
    i.e.: From a string like "2.123,45123" I want to get when I get by doing: new BigDecimal("2123.45123");
    The NumberFormat parse(String) method answers doubles, so I lose presition. When I do nf.parse(2,0000000000000000001) y get a Double representing 2. I can't make a BigDecimal from such a string afaik.
    The problem is the localized version on the number (in the string) otherwise it works fine (with the US locale).

    >>
    So you only can't convert a string to a BigDoublethat
    uses the ',' for the decimal place and the '.' forthe
    real number separators? If that's the case, whycan't
    you use a String buffer then to strip out all the
    periods and replace the comma with a period so it
    looks like a US decimal string then use that?Thank you very much for your answer. That would have
    been a workaround. I found a BigDecimal parser that's
    absolutely perfect for the task.
    http://users.belgacombusiness.net/arci/math/
    Gives to BigDecimals what java standard gives to all
    the other Number subclasses. Good! Frankly, I'm usually just lazy enough to hack a solution.... because I like to say that I hack. evil laugh

  • BigDecimal: how to  keep 2 fraction digits, round up.

    Hi,
    To calculate money amount, we need to have 2 fraction digits.
    For example,
    8888.567 --> 8888.57
    99998888.865 ---> 99998888.87
    0.982 --> 0.98
    for method round(MathContext), the mathContext specifies total number of digits, not fraction digits.
    The workaround we have to use:
    amount.divide(new BigDecimal("1"), 2, RoundingMode.HALF_UP);
    what is the right way to achieve 2 fraction digits/half-UP?
    Thanks for help.
    Dave

    When handling money you are better off not using decimals. You can either create your own Money class which has 2 variables: dollars and cents. Or use ints for all calculations and then simply divide by 100 when you want to display. So one dollar fifty is int of 150 and not double of 1.5.

  • How to convert  Erik Anderson to BigDecimal?

    Hi,
    I have a Table field Value Author and the String is 'Erik Anderson'
    I want to convert this intoa BigDecimal. Here is the code::
    BigDecimal bg;
    Object valueObj = getObject(columnIndex);
    String value = valueObj == null ? "" : valueObj.toString();
    bg = new BigDecimal(Integer.parseInt(value));
    I am getting Error
    For input string: "Erik Anderson"
    Please Help!!

    Hi,
    Thank you all for the reply!
    I am using Crystal reports Xi and made a ResultSet Object and set this as ReportSource and when I want this to be viewd through Crystal, it is pulling the Data from the ResultSet and for the column Author, which I defined as a String, it gets the value 'Erik Anderson' correctly and calls for getBigDecimal.
    I have no clue why it should convert a String to BigDecimal to display it
    However
    bg = new BigDecimal("ADHHDJH HDAHKDH HDAHDHA");
    should work as per the API.
    I am not sure what the result should be. Can some one explain?

Maybe you are looking for

  • Issue with secure store key phrase during system copy export

    Hi, We recently upgraded our all production portals to SAP NW 7.31 SP7 (Migrated them from windows to Linux). While taking the export in production portals, we are stuck at a stage while defining parameters. We did not move further if we tried the al

  • GenPrint spitting out Thumbnail size PDFs when using AddMultiPageBitmap

    Hello, I have an odd situation occurring that has me a little stumped, wondering if anybody has any insight. We setup a project to run in one of our test environments. The project uses the AddMultiPageBitmap rule to pull in one or more PDF's from the

  • Problems with RAW & Plug-ins

    Just installed Photoshop CS6 Extended and it won't open RAW files from my Nikon D4, D700 okay. Also, installed NIK software in Plug-in Preferences and they appear there, but not accessible through Filters. Tried a re-install but no change.

  • Twitter in the Tour de Flex no connect

    Hi, I downloaded and installed in FLEX 4 the sample to connect to Twitter existing in the Tour de Flex, and I do not work, when I enter the username and password is put on hold with the clock, if I try to go directly to the Tour de Flex the program m

  • MAJOR EXPORT PROBLEMS! PLEASE HELP!

    Hello. I hope everyone had a nice holiday. I'll try to be brief. I'm having a horrible problem with exporting my films.  I work on a PC. To me, that shouldn't matter, but here's what's been happening.  I shoot my films at 23.976 frames on the 5DMII a