Im trying to learn as much as I can on my own by reading lots of examples, documentations, and asking here. I would like to improve my style to write efficient code and adhere to Java standards.In this small sample of code I would like to get feedback on a few things:Exception throwingOpening/closing database connectionAny other comments in general styleThere are two classes, Database and Main.My Database class:public class Database {    private String dbName = ;    private SqlJetDb db = null;    public Database(String dbName) {        this.dbName = dbName;    }    public void CreateDatabase() throws SqlJetException {...}    public void OpenDatabaseConnection() throws SqlJetException {...}    public void CloseDatabaseConnection() throws SqlJetException {...}    private void InsertRecord(String file) throws SqlJetException {...}    public void GetDirectoryContent(String dir) {        File directory = new File(dir);        if (directory.isDirectory()) {            String[] content = directory.list();            for (String s : content) {                GetDirectoryContent(dir + \\ + s);            }        } else {            String file = directory.toString();            String extension = file.substring(file.lastIndexOf(.));            if (extension.equals(.h)) {                try {                    InsertRecord(file);                } catch (SqlJetException e) {                    e.printStackTrace();                }            }        }    }}Call in main:Database db = new Database(test.db);    try {        db.CreateDatabase();        db.OpenDatabaseConnection();        db.GetDirectoryContent(C:\\test);             } catch (SqlJetException e) {        e.printStackTrace();    } finally {        try {            db.CloseDatabaseConnection();        } catch (SqlJetException e) {            e.printStackTrace();        }               }}
Storing .h files in SQLite using SQLJet
java;file system;error handling;database;sqlite
Personally I wouldalways log rather than use e.printStackTrace. You can log to console if you require. By logging you can then change it easily to file logging and include your own commentsuse File.seperator instead of \. This gives a system independent way of separating your file paths.Consider making dbName final. You do not need to initialise it first and then in the ctor. Just do it in the ctor. Things like dbName should not be mutable.