Java编程 - 保存/读取应用程序数据的最佳方法 [英] Java Programming - Best way to save/read data for an application
问题描述
我正在研究Java编程,并试图理解保存/读取我将存储在应用程序中的数据的最佳方式。我会把所有东西都放到一个文本文件中,并在应用程序启动时全部读取,并将其保存在退出程序中?我觉得如果应用程序太大,可能会吃掉太多内存?
如果您需要存储比我建议使用数据库(HSQL,Oracle,Mysql,MSSQL等)的属性更复杂的结构。根据您的需要。
Please forgive this quesiton if it has already been answered, but I have been searching online for the past hour to try to figure it out.
I'm working on getting back into Java programming and I'm trying to understand the best way to save/read data I would be storing in my application. Would I put everything into a text file and read it all in when the application starts and save it all on exit? I figured that might eat up too much memory if the application was too large?
I would say if you need to store few information you can use a properties file.
If you need to store more complex structure than just properties I suggest using a database (HSQL, Oracle, Mysql, MSSQL, etc...). Depending of you needs.
这篇关于Java编程 - 保存/读取应用程序数据的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!