Best Way to Save Data

Hi all, I'm relatively new to Java, and have a quick question.
What is the best way to save data in an application, and what is a good rule of thumb when to dive into a database to hold the information. For example a directory of people and their information. I want the program to be able to add/update/delete the information with ease.
I was reading in Core Java Vol II how to save object data to a file, but it seems tedious if I have to run through a list of objects and save each one. I just want to be able to save records, and retrieve them to edit later.
Thanks in advance,
\\//

UnknownSector wrote:
Hi all, I'm relatively new to Java, and have a quick question.Hy there, when you find some time, go read [How To Ask Questions The Smart Way|http://www.catb.org/~esr/faqs/smart-questions.html], it will help you in the future.
What is the best way to save data in an applicationThere is almost never a "best way" to do anything. At least not if you don't define your requirements exactly. It depends on tons of things, that's why there are so many ways to "save data".
Writing to files and saving to databases are just two of those, and even among those, there are thousand of different ways to handle it.
, and what is a good rule of thumb when to dive into a database to hold the information.When the data is structured and you want to do queries on it, then you can probably look into a database. When the data is structured and you've got lots of it, then you really should look into databases.
For example a directory of people and their information. I want the program to be able to add/update/delete the information with ease.Too little information, but I'd tend to go with a database. But then again, I'm going for a DB rather quickly.
I was reading in Core Java Vol II how to save object data to a file, but it seems tedious if I have to run through a list of objects and save each one.I don't know what exactly you're talking about. Are you talking about serialization? What makes you feel that it is tedious? Can you describe it?
I just want to be able to save records, and retrieve them to edit later.Well, that can be done in many, many ways. That alone doesn't force you to go one way or another. It's pretty much the definition of "save data".

Similar Messages

  • What is the best way to save data from GPIB Device in a file?

    HI!
    I have a Keithley SourceMeter and want to save readings in a File along with settings on the front panel and timestamps plus several other infos. What is the best way to do this? Which file type? Any recommendations or hints could help me?
    Thanks

    Hi Andy,
    There are 3 main file formats that you can consider writing your data out to in LabVIEW:
    ASCII
    Binary
    Datalog
    ASCII
    ASCII files are useful because every operating system and almost every application can read/write ASCII format files. Use ASCII files when:
    Other users or applications will need to access the data file.
    You will not need to perform random access file I/O
    File I/O speed is not crucial
    Disk space is not crucial
    Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write to Text File.vi and Read from Text File.vi
    Binary
    Binary byte stream files are more specific to data storage and retrieval. Use b
    inary files when:
    File I/O will remain in LabVIEW only -- no other applications will be needing to write/read that file. There is no standard formatting for binary files and thus other applications or operating systems may be unable to read the file.
    Files are smaller than ASCII files
    Easier and faster random access to data
    Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write Binary File.vi and Read Binary File.vi
    Datalog
    When to use datalog:
    If you need to record data with a mixture of types, it can be cumbersome to convert everything to ASCII or to keep track of the binary formatting.
    Datalog format is binary and internal to LabVIEW, so again only use this format if no other applications or operating systems will be needing to perform file I/O on the file.
    Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write Datalog File
    Example.vi and Read Datalog File Example.vi
    Good luck!
    Kileen C.
    Applications Engineer
    National Instruments

  • Whats the best way to save large folders/files on multiple dvds?

    hi,
    A quick question about the best way to save to dvd(4.7gb disc) a large number of folders/files.I've got about 30-40gb of stuff to save from mp3 sample files through to logic audio files.I already have them saved to another HD but i just want to be extra safe and have another back up.In the past i've just saved it disc by disc creating each folder as i go dragging the appropriate folder across.I was just wondering whether there was an easier way than this.May be an application where i can drag all the files and it will sort and save everything for me much like the way itunes now saves/backups files.
    thanks
    darren

    Hi darrenz,
    if you have Toast you can save your stuff using Toast. There's a great option within Toast. You need to select the Data tab and choose "Mac only". Then just drag all the stuff you want to burn to the Toast window and it will automatically ask for another DVD until everything is burnt. After that all your DVDs will have a Toast Restore app on them. It lets you select what you want to restore and will tell you which DVDs to insert. Here's a screenshot I found by googling: http://www.macworld.com/images/content/2005/08/19/toast7restore.jpg
    Have fun!
    Björn

  • Best way to read data sources in parallel

    Hi,
    I'm looking for conceptual help as I start a project. I am trying to figure out the best way to get data from several sources at different timings and deliver them to a main vi.
    I have 4 systems, which each work well on their own (OK, one doesn't work yet, but let's assume that can be fixed
    One system reads from 2 pH meters on serial ports. The meters are slow to respond, so it takes about 2 minutes to read 4 channels of data. I save these data to a file every 10 minutes
    One system reads from a CO2 meter on the USB port. It reads the data every second, and does some averaging. Every 2-10 minutes, it saves the average to a file and then sends a command to the parallel port to switch the input to the meter.
    The third system reads from 6 valves, each on a serial port. These also take time, probably several minutes to poll all 6. These data will also be saved to a file.
    The 4th system reads a bank of temperature probes on the USB port. These get polled every few seconds and saved to a file every few minutes.
    Now that these individual routines are working, I am trying to create a front end that will display all the data in one place and allow me to set all the parameters from a single place. I would also like the possibility of using the data from one source at another place (for instance, having the output of the temperature probes sent to the pH meters to adjust their calibration). At this point, I get confused as to the best way to proceed.
    It seems like if I just want to read the data from each source, I could simply put all 4 routines together in a single vi (oh, what a mess that would be to read). Maybe I should start this way?
    However, if I want to have any communication between the different data sources, it seems like I will either need to use queues or VI server. I sort of envision a vi that lets me configure the various ports and the file operations and then can turn on monitoring of any or all of the various inputs. Each of them will do their thing at their own time and the main routine will simply display whatever data they deliver whenever they have new data. Fortunately, nothing is particularly time-critical, nor does it need to run fast.
    My questions: Am I correct in how I'm thinking about getting this to work?   Is there a clear choice between queues or vi server? I've looked at several examples of each, but without having done something like this before, it is hard for me to tell which is better.
    Thanks for any suggestions.
    mike

    Hi Mike,
    I think that you are on the right track with your thinking process. You might be able to implement this using queues. I'm not exactly sure how you would do it with VI server since it is just a set of functions that allows you to dynamically control front panel objects, VIs, and the LabVIEW environment. However, there are some great resources available with using queues for this type of application. I'm including the link to another discussion forum that had a very similar question to yours. There is a good example of using queues within this forum post. Also, there is a great example in NI Developer Zone about using queues and some other good ones in the NI Example Finder (just search 'queues' and you should get a few results). I hope this helps!
    Carla
    National Instruments
    Applications Engineer

  • Best way to pass data sets to another program

    Hey
    I want to connect another (maths) program with my java application. Therefore I need to paste data (some kind of tab separated table) to this program.
    I try now to save these data in a separate newly generated file and to pass a command with Java's Runtime.exec() method to this program to read these data. Is this a good idea or might there be better ways?
    If I do so, is there a way in Java to generate some kind of a "temporary" file which will be deleted automatically after usage or is this nothing else than to save it in a common file and delete it afterwards. What's the best way to pass data generally?

    Well, the connection will not be over a network, so I'd rather think it's not a Socket or RMI problem (unless someone convinces me).
    Yes it's very external, it's a C or C++ written program, I don't have any source codes. So far I generated a file for Input command and data, I passed that on to the maths program and returned the output into another file.
    Now I would like to separate the output and like to obtain some tables and graphical things like charts at the output. Do I have to generate three different types of outputfiles? How to store some graphics e.g. some distributions. I thought even of generating a database. I never thought about XML, I don't know if this works for that kind of problem?!

  • What's the best way to save battery life on ios 7

    What's the best way to save battery life on ios 7

    Turn off services that you are using, e.g., bluetooth, cellular data, etc.
    See also here:
    https://www.apple.com/batteries/ipad.html
    http://ipod.about.com/od/ipad/a/conserve-ipad-battery-life.htm
    http://www.ibtimes.com/apple-ios-7-release-15-ways-improve-battery-life-your-iph one-or-ipad-1413218

  • I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show a

    I have lightroom 5.7. Now I have apple TV to connect my Mac to the TV scree. I wish to do a slide show on the TV. However, on the Mac, using ITunes to share photos with the TV, I cannot locate all photo files. What is the best way to save the slide show and put it where the Mac sharing can find it? So far, I made on one folder in Lightroom, put some photos there and I found them easily. Can this be done with a slide show? Please help quickly! Also worried that the photos I put on the new folder are hard to find afterwards, when the show is done. Where do they go when I delete from from the new folder?I am not alone

    Not that I'm aware of. You just export JPEG copies to a folder that you can point iTunes to. For instance, I have created a folder in my Pictures folder called Apple TV. And within that folder I have other folders of pictures that I can choose from in iTunes to share with Apple TV. But there doesn't seem to be any way to share a Lightroom slideshow. If you have laid to create a video file that would probably work. Apple TV is a little clunky in my opinion. Some things are a little more difficult to do now than they were a while back. I probably haven't provided you with much help, but just keep experimenting and I think you will figure it out.

  • How is the best way to save photos on vacation?

    While traveling I will use my iPhone 6 as my main camera.  What is the best way to save my photos & videos before I return home?
    Do I need to use Google+, Mylio, dropbox, Evernote or will all remain in iCloud?  I"m not sure how this works.

    One option is iCloud Photo Library:
    https://www.apple.com/icloud/photos/
    iCloud Photo Library beta FAQ - Apple Support

  • How is the best way to read data from an iphone if you lost your itunes data after a crash?

    How is the best way to read data from an iphone if you lost your itunes data after a crash?

    How is the best way to read data from an iphone if you lost your itunes data after a crash?

  • Best way to import data to multiple tables in oracle d.b from sql server

    HI All am newbie to Oracle,
    What is the Best way to import data to multiple tables in Oracle Data base from sql server?
    1)linked server?
    2)ssis ?
    If possible share me the query to done this task using Linked server?
    Regards,
    KoteRavindra.

    check:
    http://www.mssqltips.com/sqlservertip/2011/export-sql-server-data-to-oracle-using-ssis/
          koteravindra     
    Handle:      koteravindra 
    Status Level:      Newbie
    Registered:      Jan 9, 2013
    Total Posts:      4
    Total Questions:      3 (3 unresolved)
    why so many unresolved questions? Remember to close your threads marking them as answered.

  • What could be the best way to Export data from 11.5.8 instance to 12.1.2?

    Hi All
    What could be the best way to Export data from 11.5.8 instance to 12.1.2?
    Release: 11.5.8
    OS: Oracle Solaris on SPARC (32-bit) verison 9
    DB: 9.2.0.1
    Thanks in advance

    What kind of data you are looking to move?
    Database export/import is only supported for full database export/import and the application release should be the same on the source/target nodes.
    You can move the setup using iSetup or FNDLOAD.
    Thanks,
    Hussein

  • What is the best way to save an ai file so it can be opened in corel draw

    I have an ai file that needs to be opened in corel draw by a client. It needs to remain editable all paths and colors ect.
    Whats the best way to save it so it can be.
    yes I know corel is not as good as Illustrator but its what they have.

    Moving files back and forth between Adobe Illustrator and CorelDRAW is tricky. There's quite a bit more to it than knowing what version of CorelDRAW the client is using. If the artwork is fairly simple then there shouldn't be any problem with transferring the artwork into CorelDRAW. If the artwork has gradients, transparency effects, a lot of clipping masks, etc. then it's going to be a lot more dicey getting it to import into CorelDRAW properly. In addition to the .AI file you provide, you should give the client a PDF they can view in Adobe Reader or Acrobat so they can proof how the artwork is really supposed to look.
    I use Adobe Illustrator CC and CorelDRAW X6 in my work. I've used both applications for over 20 years. I don't consider either application better than the other. They both have their own unique strengths and weaknesses. I'll do a good bit of creative work within CorelDRAW to use certain features Illustrator either lacks or just doesn't do as well. Or I may need to design a really big project at full scale and Corel has a much bigger art board than Illustrator. Most of the time I move a lot of the stuff I created in CorelDRAW over to Illustrator for further refinement or moving it into Photoshop as paths or smart objects or just getting it ready to print (I don't like Corel's color engine even though it has improved in recent years).
    Like others have said, you need to know the basics of what the user has -mainly which version of CorelDRAW. The newer versions like the one I'm using can open Illustrator CS5 files. For older versions, you may have to save down to CS2 or even really old versions like Illustrator 8.
    CorelDRAW will not support certain Illustrator-dependent effects. For instance, if you apply a gradient to an object outline it will be lost when opened in CorelDRAW. A lot of other effects won't be maintained when opened in Corel unless they are flattened/expanded. Some effects may even have to be rasterized, and that can create other issues. Out of effects that are maintained, some may have to be adjusted. CorelDRAW and Adobe Illustrator handle things like gradient fills differently and don't understand how to portray gradients from their rival application accurately. Some nice fill that was created in CorelDRAW may have to be tweaked or completely rebuilt when opened in Illustrator.
    I get a lot of customer files in CorelDRAW and also a lot in Illustrator. That reason alone makes it necessary for me to have both CorelDRAW and Adobe Illustrator running on my computer.

  • What is the best way to transfer data from a PC to an iMac?

    What is the best way to transfer data from a PC to an iMac?

    If you know how to set up a computer-to-computer Ethernet network, then you can give that a try, but a hard drive will be faster than Ethernet unless you don't have a lot to transfer.
    Mac OS X 10.6 Help- Creating a computer-to-computer network

  • What's the best way to save an 8.5 x 11 image for use as a page background in a PDF?

    What's the best way to save an 8.5 x 11 image for use as a page background in a PDF? My goal is to have a relatively small final .pdf file size that includes numerous pages with full 8.5 x 11 images as backgrounds in the document. If I save at 8.5 x 11 and 72dpi (example), the image is not 8.5 x 11, and the quality is not good enough. I need help with size, dpi, and file format to save as before I place it in InDesign and then save as a .pdf.
    Thanks,
    Jim

    Do exactly what I said then.  Create the InDesign document of the required dimension, and chose whether it will be high quality print, or Interactive PDF.  It really doesn't mater what format you bring the image into that document.  It can be JPG, PNG, but I usually use native Photoshop PSD.  The image does have to be of high enough resolution, but it can be many times bigger than iis required for the final export.  (InDesign does not import the image, but rather references it on your hard drive.)
    When you have placed your text and finished your page, then export it to PDF, but go through the tabs chosing suitable settings.  If the image needs to be downsized, InDesign will do that at this stage while building the PDF.
    If you can tell us how this presentation will be made (Projector, overhead projector, printed page etc. or just emailed to the end users) we can help you more with the final output settings. 

  • Best ways to view data, total records of an application table ie VBAK

    Hi all,
    What is the best way to view data of an application table in the source system?
    I know about SE16....but are there other ways to know details ie the total no of records and different field information about a
    application table ie VBAK in source R3?
    Also, using SE16 when i checked for VBAK and clicked on the "number of enteries" then it showed 0...however
    when i directly checked from the sqlplus then i found about 5000 records in there in VBAK. I am not sure why
    via SE16 it showed 0. Does anybody have any idea what i missed here?
    Thanks...will give points for ur input.
    ak

    I tried "number of enteried" on se16 and it shows 0 enteries without any selection criterion...i cheked by putting relevant time range as well but it shows 0...
    As i told that when i checked VBAK separately via logging to database directly then i did find 5678 rows there.
    Please note that this is a new demo version....so i thought that i first need to activate the table which i did using tcode SE11. Now the VBAK table is active but still via SE16 shows 0 nuber of enteris....
    Can anybody please advise here..
    Thx
    ak

Maybe you are looking for