What is a file based database?

When we refer to file-based databases we mean databases that we interact with/update directly (via an SQL abstraction offered by the JDBC driver) but in essence we just read/write to a file directly. Example would be SQLite No, CSV is a comma separated values file which allows data to be saved in a table structured … Read more

How can I get the count of line in a file in an efficient way?

Update: To answer the performance-question raised here, I made a measurement. First thing: 20.000 lines are too few, to get the program running for a noticeable time. I created a text-file with 5 million lines. This solution (started with java without parameters like -server or -XX-options) needed around 11 seconds on my box. The same with wc … Read more

How to read file from relative path in Java project? java.io.File cannot find the path specified

If it’s already in the classpath, then just obtain it from the classpath instead of from the disk file system. Don’t fiddle with relative paths in java.io.File. They are dependent on the current working directory over which you have totally no control from inside the Java code. Assuming that ListStopWords.txt is in the same package as your FileLoader class, then … Read more