Idatabase code

broken image
broken image

That’s a hard problem to try to solve yourself. That might work, but it makes it harder to update your server, and many server hosts don’t even give you access to the underlying file system! You’ll also run into a problem if your data takes up more memory than your server has. For example, you could read from the file at startup, and write to it whenever your data changes.

broken image

Using what you’ve learned so far, you might start thinking about storing your data in a file. Obviously that’s not going to work for real web applications, which are updated all the time and have to maintain data over multiple years! This is fine for small example projects, but it has a pretty huge downside: whenever your code is restarted (any time you make a change), all of your memory is reset and you lose all of your data. So far, we’ve been keeping all of our data in memory, using data structures like ArrayList and HashMap. Sanitizing Data and Prepared Statements.

broken image