What is the best data type for wallet application?

Hi Friends..
I want to know what is the best data type for wallet application..
Assume that, i want to the Total of money saved digitally in Applet Wallet..
And then if there's any transaction the Total of money which saved digitally in Applet Wallet would be Subtracted or Added depends on how much money that spent or saved..
Which one is the best implementation of these scenarios :
1. I save the User ID and Total of money in the Java Card, and then if there's any transactions, it would be added or subtracted directly and then saved again in the Java Card
2. Or.. I save the User ID in the Java Card whereas Total of money in the Database, and then if there's any transactions, the ID would be read from the Card, and then select the Database based on that ID, and then Add or Subtract the money depends on how much money spent in the Transaction
Please help me regarding this
Thanks in advance

Hi,
Personally I would choose to store the total amount stored on the card. You could use two shorts (short[] perhaps) to store an integer (add more shorts to increase precision) and simply handle overflow your self. You could even look into using a third party library (or class) that treats a byte array as a big integer etc. There were some posts recently on floating point arithmetic that could be helpful for you since you will probably want to use decimals and JC does not natively support floats.
Cheers,
Shane

Similar Messages

  • What is the best data type to store XML string

    Hello all,
    If we want to store a XML string in oracle database table for some other program use what is the best data type that we can use in the table to store this XML string..
    Is it VARCHAR? or can we use BLOB type
    Anybody to help please
    Message was edited by:
    user483578

    If your XML data will not be larger than 4000 characters then use VARCHAR2 else CLOB. I don't see a need to use BLOB (unless your XML data contains binary information).

  • WHat is the best index type for non uniqueness / Varchar columns in SQL 2008 R2

    Hello All Greetings,
    Please help me here with my doubt,
    in my table i have two columns about a million rows, it has about 20 columns in it, three columns with name as Period, Gender so most of the time these two columns use in where clause,
    Gender  will contain Either M or F , Period contains YYYY-Month (2013-December, 2013-August) etc so i would like to add a Index to these two columns so that in will increase the performance, so please let me know what type of indexes i need to add to
    these columns in the table,
    please note that only one time we will add data to the table which will take only 2 minutes but we query the table every day
    so my question what is the best index type that i need to create on columns with non uniqueness values in the column.,
    Thank you In Advance,
    Milan

    There is nothing whatever wrong with creating an index on a VARCHAR column, or set of columns.
    Regarding the performance of VARCHAR/INT, as with everything in a RDBMS, it depends on what you are doing. What you may be thinking of is the fact that clustering a table on a VARCHAR key is (in SQL Server) marginally less efficient than clustering on a monotonically
    increasing numerical key, and can introduce fragmentation.
    Or you may be thinking of what you have heard about writing JOINs on VARCHAR columns - it is true, it is a little less efficient than a JOIN on numeric type, but it is only a little less efficient, nothing that would lead you to never join on varchar cols.
    None of this does not mean that you should not create indexes on VARCHAR columns. A needed index on a VARCHAR column will boost query performance, often by orders of magnitude. If you need an index on a VARCHAR, create it. It makes no sense to try to find an
    integer column to create the index on - the engine will never use it.
    Check this reference: http://stackoverflow.com/questions/14041481/is-it-good-to-create-a-nonclustered-index-on-a-column-of-type-varchar
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • What is the best data program for the iPad to keep costs at a minimum?

    My daughter needs to get a data program from Verizon to supplement her iPhone 5 when traveling without wi-fi. Her current usage is a lot of youtube streaming. What is the best option to keep things under control? Prepaid? Thanks.

    This would be speech recognition software. There is only one satisfactory product for this available on Macs - Dragon Dictate. From my limited experience it works exceptionally well given the state of the technology.
    It will require an appropriate microphone for best results plus the willingness to commit several hours to train the program to your voice. It can be used in most word processors/editors as well as work with many different applications' commands and OS commands.

  • What is the best data structure for loading an enterprise Power BI site?

    Hi folks, I'd sure appreciate some help here!
    I'm a kinda old-fashioned gal and a bit of a traditionalist, building enterprise data warehouses out of Analysis Service hypercubes with a whole raft of MDX for analytics.  Those puppies would sit up and beg when you asked them to deliver up goodies
    to SSRS or PowerView.
    But Power BI is a whole new game for me.  
    Should I be exposing each dimension and fact table in the relational data warehouse as a single Odata feed?  
    Should I be running Data Management Gateway and exposing each table in my RDW individually?
    Should I be flattening my stars and snowflakes and creating a very wide First Normal Form dataset with everything relating to each fact? 
    I guess my real question, folks, is what's the optimum way of exposing data to the Power BI cloud?  
    And my subsidiary question is this:  am I right in saying that all the data management, validation, cleansing, and regular ETTL processes are still required
    before the data is suitable to expose to Power BI?  
    Or, to put it another way, is it not the case that you need to have a clean and properly structured data warehouse
    before the data is ready to be massaged and presented by Power BI? 
    I'd sure value your thoughts and opinions,
    Cheers, Donna
    Donna Kelly

    Dear All,
    My original question was: 
    what's the optimum way of exposing data to the Power BI cloud?
    Having spent the last month faffing about with Power BI – and reading about many people’s experiences using it – I think I can offer a few preliminary conclusions.
    Before I do that, though, let me summarise a few points:
    Melissa said “My initial thoughts:  I would expose each dim & fact as a separate OData feed” and went on to say “one of the hardest things . . . is
    the data modeling piece . . . I think we should try to expose the data in a way that'll help usability . . . which wouldn't be a wide, flat table ”.
    Greg said “data modeling is not a good thing to expose end users to . . . we've had better luck with is building out the data model, and teaching the users
    how to combine pre-built elements”
    I had commented “. . . end users and data modelling don't mix . . . self-service so
    far has been mostly a bust”.
    Here at Redwing, we give out a short White Paper on Business Intelligence Reporting.  It goes to clients and anyone else who wants one.  The heart
    of the Paper is the Reporting Pyramid, which states:  Business intelligence is all about the creation and delivery of actionable intelligence to the right audience at the right time
    For most of the audience, that means Corporate BI: pre-built reports delivered on a schedule.
    For most of the remaining audience, that means parameterised, drillable, and sliceable reporting available via the web, running the gamut from the dashboard to the details, available on
    demand.
    For the relatively few business analysts, that means the ability for business users to create their own semi-customised visual reports when required, to serve
    their audiences.
    For the very few high-power users, that means the ability to interrogate the data warehouse directly, extract the required data, and construct data mining models, spreadsheets and other
    intricate analyses as needed.
    On the subject of self-service, the Redwing view says:  Although many vendors want tot sell self-service reporting tools to the enterprise, the facts of the matter are these:
    v
    80%+ of all enterprise reporting requirement is satisfied by corporate BI . . . if it’s done right.
    v Very few staff members have the time, skills, or inclination to learn and employ self-service business intelligence in the course of their activities.
    I cannot just expose raw data and tell everyone to get on with it.  That way lies madness!
    I think that clean and well-structured data is a prerequisite for delivering business intelligence. 
    Assuming that data is properly integrated, historically accurate and non-volatile as well, then I've just described
    a data warehouse, which is the physical expression of the dimensional model.
    Therefore, exposing the presentation layer of the data warehouse is – in my opinion – the appropriate interface for self-service business intelligence.
    Of course, we can choose to expose perspectives as well, which is functionally identical to building and exposing subject data marts.
    That way, all calculations, KPIs, definitions, and even field names, and all consistent because they all come from the single source of the truth, and not from spreadmart hell.
    So my conclusion is that exposing the presentation layer of the properly modelled data warehouse is – in general - the way to expose data for self-service.
    That’s fine for the general case, but what about Power BI?  Well, it’s important to distinguish between new capabilities in Excel, and the ones in Office 365.
    I think that to all intents and purposes, we’re talking about exposing data through the Data Management Gateway and reading it via Power Query.
    The question boils down to what data structures should go down that pipe. 
    According to
    Create a Data Source and Enable OData Feed in Power BI Admin Center, the possibilities are tables and views.  I guess I could have repeating data in there, so it could be a flattened structure of the kind Melissa doesn’t like (and neither do I). 
    I could expose all the dims and all the facts . . . but that would mean essentially re-building the DW in the PowerPivot DM, and that would be just plain stoopid.  I mean, not a toy system, but a real one with scores of facts and maybe hundreds of dimensions?
    Fact is, I cannot for the life of me see what advantages DMG/PQ
    has over just telling corporate users to go directly to the Cube Perspective they want, that has already all the right calcs, KPIs, security, analytics, field names . . . and most importantly, is already modelled correctly!
    If I’m a real Power User, then I can use PQ on my desktop to pull mashup data from the world, along with all my on-prem data through my exposed Cube presentation layer, and PowerPivot the
    heck out of that to produce all the reporting I’d ever want.  It'd be a zillion times faster reading the data directly from the Cube instead of via the DMG, as well (I think Power BI performance sucks, actually).
    Of course, your enterprise might not
    have a DW, just a heterogeneous mass of dirty unstructured data.  If that’s the case,
    choosing Power BI data structures is the least of your problems!  :-)
    Cheers, Donna
    Donna Kelly

  • What is the best field type for currency calculations?

    Hiya,
    I am doing a load of currency calculations e.g. here's one line of it
    The 'Total' fields I am using for doing/totalling my calculations has been defined as a local variable that reference an amount field setup in the data dictionary as:
    So in my program I am using these 2 decimal field.
    Of course I now realize this is a problem, as lots of rounding occurs and my values are way out when you deal with amounts in the millions.
    Does anyone know what type of variable they think is best for doing currency calculations?
    And could you provide a simple example?
    Many thanks!

    Hello Robert,
    I guess you can go ahead with ATFLV, incase if you want to display as a currency, you can use the function module  KKEK_CONVERT_FLOAT_TO_CURR.
    DATA: c_lv_float TYPE ATFLV VALUE '4.4500000000000000E+02',
          c_lv_curr TYPE WAERS VALUE 'EUR',
          c_lv_currval TYPE NETWR_AP.
    CALL FUNCTION 'KKEK_CONVERT_FLOAT_TO_CURR'
      EXPORTING
        float_imp          = c_lv_float
        curr_imp            = c_lv_curr
    IMPORTING
      CURR_FIELD_EXP      = c_lv_currval
    EXCEPTIONS
      OVERFLOW            = 1
      OTHERS              = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE:/ c_lv_currval.
    Output: 445,00
    Regards,
    TP

  • What is the Best Safari Version for OS 10.9.5 Maverick on a MacBookPro, 2.4Ghz, 8 GB Mem.?

    What is the best Safari Version for OS 19.9.5 Maverick on a MacBook Pro. 2.4 Ghz, with 8 gb memory?

    The best version for Mavericks, in fact the only version, is an integral part of OS X. In other words you already have it.
    Its version number is 7.1.5.
    Keep OS X up to date: Update OS X and App Store apps on your Mac - Apple Support

  • What are the master data tables for 'Plant'?

    Hi friends,
    What are the master data tables for 'Plant' that contain below data?:
    PLANT
    NAME1
    NAME2
    LANGUAGE
    HOUSE_NUM_STREET
    PO_BOX
    POSTAL_CODE
    CITY
    COUNTRY_KEY
    REGION
    COUNTRY_CODE
    CITY_CODE
    TIME_ZONE
    TAX_JURISDICTION
    FACTORY_CALENDAR
    Thanks a lot!

    Hi,
    Plz try out following tables for your requirement.
    TOO1W
    ADRC
    J_1IMOCOMP
    T001W :  werks TYPE t001w-werks, "PLANT
            name1 TYPE t001w-name1, "PLANT DESCRIPTION
            adrnr TYPE t001w-adrnr, "PLANT ADDRESS NUMBER
    ADRC:  addrnumber TYPE adrc-addrnumber,  "ADDRESS NUMBER
             str_suppl1 TYPE adrc-str_suppl1,  "STREET2
             str_suppl2  TYPE adrc-str_suppl2, "STREET3
             street TYPE adrc-street,          "STREET
             city1 TYPE adrc-city1,            "CITY
             post_code1 TYPE adrc-post_code1,  "CITY POSTAL CODE
             post_code2 TYPE adrc-post_code2,  "PO Box postal code
             tel_number TYPE adrc-tel_number,  "TELEPHONE NUMBER
             fax_number TYPE adrc-fax_number,  "FAX NUMBER
             str_suppl3 TYPE adrc-str_suppl3,  "STREET4
             location TYPE adrc-location,      "STREET5
             city2 TYPE adrc-city2,  
    For Tax Details :
    J_1IMOCOMP :   werks TYPE j_1imocomp-werks,
                              j_1icstno TYPE j_1imocomp-j_1icstno,
                              j_1ilstno TYPE j_1imocomp-j_1ilstno,
    Hope this will help.
    Regards,
    Archana

  • What is the best font size for text when making a book in iBooks Author? My present font is Baskerville at 20 pt.

    What is the best font size for text when making a book in iBooks Author? My present font is Baskerville at 20 pt.

    For what audience? What reading level? Which Flesch-Kincaid index? What type of content? How much white space? What language(s)?

  • What is the best charging cable for the iPad Air (that is not made by Apple)? I need a long cable (over 6ft or more). I also need the cable to be of high quality and the cord part of the cable to be made of strong material.

    What is the best charging cable for the iPad Air (that is not made by Apple)? I need a long cable (over 6ft or more). I also need the cable to be of high quality and the cord part of the cable to be made of strong material. Apple does not make one this long. Is there a cable out there that is sturdy like this and is safe to use?

    yes, but I'm trying to use my iPad to type notes (using pages) and I have the smart case which I use as a stand. I need a cable long enough to fit through the back of my desk and the charging brick for the iPad won't fit behind the desk. I have to put it on the floor and then the apple cables aren't long enough to reach.

  • WHAT IS THE BEST ANTIVIRUS SOFTWARE FOR OSX YOSEMITE?

    WHAT IS THE BEST ANTIVIRUS SOFTWARE FOR OSX YOSEMITE?

    Here are some more thoughts to consider.
    There will always be threats to your information security associated with using any Internet - connected communications tool:
    You can mitigate those threats by following commonsense practices
    Delegating that responsibility to software is an ineffective defense
    Assuming that any product will protect you from those threats is a hazardous attitude that is likely to result in neglecting point #1 above.
    OS X already includes everything it needs to protect itself from viruses and malware. Keep it that way with software updates from Apple.
    A much better question is "how should I protect my Mac":
    Never install any product that claims to "clean up", "speed up",  "optimize", "boost" or "accelerate" your Mac; to "wash" it, "tune" it, or to make it "shiny". Those claims are absurd.Such products are very aggressively marketed. They are all scams.
    Never install pirated or "cracked" software, software obtained from dubious websites, or other questionable sources.
    Illegally obtained software is almost certain to contain malware.
    "Questionable sources" include but are not limited to spontaneously appearing web pages or popups, download hosting sites such as C net dot com, Softonic dot com, Soft pedia dot com, Download dot com, Mac Update dot com, or any other site whose revenue is primarily derived from junk product advertisements.
    If you need to install software that isn't available from the Mac App Store, obtain it only from legitimate sources authorized by the software's developer.
    Don’t supply your password in response to a popup window requesting it, unless you know what it is and the reason your credentials are required.
    Don’t open email attachments from email addresses that you do not recognize, or click links contained in an email:
    Most of these are scams that direct you to fraudulent sites that attempt to convince you to disclose personal information.
    Such "phishing" attempts are the 21st century equivalent of a social exploit that has existed since the dawn of civilization. Don’t fall for it.
    Apple will never ask you to reveal personal information in an email. If you receive an unexpected email from Apple saying your account will be closed unless you take immediate action, just ignore it. If your iCloud, iTunes, or App Store account becomes disabled for valid reasons, you will know when you try to buy something or log in to this support site, and are unable to.
    Don’t install browser extensions unless you understand their purpose. Go to the Safari menu > Preferences > Extensions. If you see any extensions that you do not recognize or understand, simply click the Uninstall button and they will be gone.
    Don’t install Java unless you are certain that you need it:
    Java, a non-Apple product, is a potential vector for malware. If you are required to use Java, be mindful of that possibility.
    Java can be disabled in System Preferences.
    Despite its name JavaScript is unrelated to Java. No malware can infect your Mac through JavaScript. It’s OK to leave it enabled.
    Beware spontaneous popups: Safari menu > Preferences > Security > check "Block popup windows".
    Popup windows are useful and required for some websites, but unsolicited popups are commonly used to deceive people into installing unwanted software they would never intentionally install.
    Popups themselves cannot infect your Mac, but many contain resource-hungry code that will slow down Internet browsing.
    If you ever receive a popup window indicating that your Mac is infected with some ick or that you won some prize, it is 100% fraudulent. Ignore it.
    The same goes for a spontaneously appearing dialog insisting that you upgrade your video player right this instant. Such popups are frequently associated with sites that promise to deliver movies or other copyrighted content that is not normally "free".
    The more insistent it is that you upgrade or install something, the more likely it is to be a scam. Close the window or tab and forget it.
    Ignore hyperventilating popular media outlets that thrive by promoting fear and discord with entertainment products arrogantly presented as "news". Learn what real threats actually exist and how to arm yourself against them:
    The most serious threat to your data security is phishing. Most of these attempts are pathetic and are easily recognized, but that hasn't stopped prominent public figures from recently succumbing to this age-old scam.
    OS X viruses do not exist, but intentionally malicious or poorly written code, created by either nefarious or inept individuals, is nothing new.
    Never install something without first knowing what it is, what it does, how it works, and how to get rid of it when you don’t want it any more.
    If you elect to use "anti-virus" software, familiarize yourself with its limitations and potential to cause adverse effects, and apply the principle immediately preceding this one.
    Most such utilities will only slow down and destabilize your Mac while they look for viruses that do not exist, conveying no benefit whatsoever - other than to make you "feel good" about security, when you should actually be exercising sound judgment, derived from accurate knowledge, based on verifiable facts.
    Do install updates from Apple as they become available. No one knows more about Macs and how to protect them than the company that builds them.
    Summary: Use common sense and caution when you use your Mac, just like you would in any social context. There is no product, utility, or magic talisman that can protect you from all the evils of mankind.

  • What is the best antivirus software for a Macbook Pro...I recently received a message from Google that someone made an attempt to hack into my mail account so I needed to change my PW and verify myself as the user.  The message suggested that I run a scan

    What is the best antivirus software for a Macbook Pro...I recently received a message from Google that someone made an attempt to hack into my mail account and I needed to change my PW and verify myself as the user.  The message suggested that I run a virus scan to check for sny malware or other types of viruses.  I do not have any software for this and up until now have not had a problem....any help is appreciated.  I would like a simple but effective solution!

    It's worth noting that if your Gmail has been hacked, it would likely have nothing to do with your MacBook.  Hacking web based email is fairly common and it doesn't require any access to your machine whatsoever.  In the same way that you can simply go to the Gmail webpage through any browser, any hacker can use the same method.  It doesn't mean your machine has been compromised in any way (and it has likely not been).  I have never received an email from Google of this nature.  I have received notifications when someone has attempted to create an account with my name in which they basically say that there is no action required if you're the rightful owner.

  • What are the best AirPlay speakers for Apple devices?

    What are the best AirPlay speakers for Apple devices? I would like to get some good speakers to be used with my iPod, iPhone and iPad. Ideally, they should be able to play using AirPlay and be quite powerful, but with a good design if possible.
    I am particularly interested in the Fidelio range of speakers by Philips.
    Thank you for your help in advance.

    Best is going to be a matter of opinion.  What environment are the speakers going to be used in? How large is the room? What type of music are you going to play? What features/functions would you like in the speakers? What price range are you looking for?  All of these are going to effect which speakers will best fit your needs.

  • What's the best protective shield for my 3GS?

    Hi Everyone,
    Sorry to bother, but I just got a new iPhone 3GS and I'm wondering what's the best protector to put on the phone. I understand the 3GS has a new type of "coating" on the screen so I don't want to do any damage to it. I also heard the 3GS has these proximity sensors so I don't want to get a case that will interfere with that. Anyhow, I wanted to get an Invisible Shield, a full body one, but wanted to make sure I don't do damage to the phone. I've read the forums and it seems there is no definitive answer on whether or not the Invisible Shield is the best one. Any iPhone experts know what's the best protective shield for the 3GS? And will the Invisible Shield do any damage to the screen or coating on the new 3GS? I talked to a person at Apple and they didn't think it would do any damage, but to be honest, she didn't sound as knowledgeable as I would like. I'm sorry for being paranoid. Can you guys chime in?
    Thanks!

    The reason for no definite answer is that it matters what YOU are looking for in a case or protective screen cover...
    To answer your shield question...the shield product itself will not damage the phone and that coating is not to prevent scratches...it's to help prevent fingerprints...since you plan to put a screen cover on then that coating doesn't really matter...HOWEVER, the way that the shield can harm the phone is IF it's not properly installed by YOU...since the design of that product calls for a liquid solution agent to be used to adhere the cover to the case of the phone, others have gone overboard with that liquid and then ended up with water damaged phones due to the faulty install...If you install properly then it's not an issue
    Personally I used a full shield cover on a previous phone and hated it...so again it's all up to your taste...
    What I currently have now is the simple Apple sold Anti-Glare screen cover you can buy two to a pack for 15.00 at Apple store...I have used since first Gen iPhone and loved it...
    I have a Case-Mate leather hard plastic case but am not thrilled with it since the edges are raised around the edges of the screen and sometimes prevent me from hitting a button right up against the screen edge...so I don't use it much...
    Other covers made by Case-Mate like the Barely There cover don't have that problem...so you really need to shop around and see what case you like and what you dislike...
    Cases specifically sold to be compatible with 3GS will not interfere with either the proximity or any other sensor on the phone face...

  • What is the best GPS app for an iPhone 4s?

    What is the best GPS app for an iPhone 4s?

    There are several things to consider.  For instance many GPS apps download maps on the fly.  If you don't have an unlimited cellular data plan this can use a lot of your data allotment.  Other apps like Tom Tom and CoPilot Live save all the maps on the device.  The maps will take up a lot of memory on your iPhone.  I use CoPilot Live Premium and the maps take up about 2GB of memory. 
    Then there is a matter of cost.  Most apps that download maps on the fly are free or a very low cost.  The ones that store the maps on the iPhone generally cost more.
    I use Copilot Live Premium HD US because it gives me all the features I need for a relatively low cost, about $20 USD.

Maybe you are looking for