What to do so that the data remains recorded in the program with Eclipse without having to install MySQL [closed]

-3

So far I've used MySQL to save the data locally from my program in Java using Eclipse and WindowsBuilder .

But, I would like to know how to save the data in the same program without installing MySQL in the computer, I doubt very much that all my users want to install MySQL .

There are millions of programs that you install and everything you do or change stays stored in the same program, that is, the programmer does not say: hey, you must install MySQL to use my program.

What are the options for saving the data in the same program?

And answering comments: I've heard about SQLite but, no idea what it is or how it works.

    
asked by Robert Gomez 15.01.2017 в 03:25
source

1 answer

2

By saying Eclipse and not specifying any particular language, I'm going to give you my answer from the point of view of Java, which is the programming language that you surely use (although the answer will be the same for all languages):

A program is just a code sequence (a recipe), so when started correctly send all lines of code to the processor in a language that he understands to run one after another until you reach the end . Once reached the end he follows his own and forgets you forever. The possibility that when you re-run the program in the future, remembering something that has happened necessarily means that you read the data somewhere.

Is there a side that is not a database, in your case MySQL, so that these data can be stored there, and that once the program starts read and update them so you can always access them ? The answer is clear: YES. Of course there are ways to save data that does not pass through MySQL, proof of this is that there are different types of database servers as it can be also, SQLite, etc ... that save data in very different ways.

The answer you are looking for from all of them is simpler, and I think I speak from experience since you reminded me when I began my career in Computer Engineering (But where do I keep this so I do not forget it?), in files that you yourself believe in a directory that you have controlled beforehand (probably inside the program folder or in folders like / var or / tmp in UNIX environments)

Saving everything in folders and files so that you know how the data has been saved so you know how to read it will get that home database we are looking for. Entering this topic and answering your question with as much information as possible about it, object serialization deals with exactly this: convert an object into a sequence of bytes to be able to write / read about them without problems.

    
answered by 15.01.2017 в 04:30