My data storage application uses Java classes with arrays of data. So, I have a question, does it make sense to transfer data from Java classes to a SQLite database? Will there be any speed advantage or anything else over the usual Java class?
Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants free_ze , Bald , Kirill Stoianov , HamSter , rjhdby 8 Oct '16 at 8:39 .
The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .
2 answers
In the first case, your data is available only during program execution . After completion of the program, your data, with this approach, disappear.
In the second case, you can write data to the database, terminate the program, and the next time you start to read this data from the database. This option is suitable for long-term data storage .
- why can't the next time you start the application to read from the same Java class? In a class of initialized arrays with constant values, where can they disappear? - Maxgmer
- And how are you going to "read from the same Java class"? And what are “constant value arrays”? - post_zeew
- simply, the name of the class. The name of the array with the data. And I'm not going to, I have already done everything this way, I think, whether there will be a plus from the fact that I will use the DB. - Maxgmer
- and the constant-value array is public static final - Maxgmer
- oneThis question is very general and the answer to it depends on the specific situation. If you have something like
int a = 5, then please. But in my understanding of the term data storage, it has nothing to do with your first case. - post_zeew
Finally I found the answer, what I need. Can someone come in handy, leave here, because I did not find stackoverflow in Russian.
In short, the bottom line is that the inner class has a very small advantage in speed, so if you can transfer the application to the database is time consuming, you can not translate.