I followed this link to install Spatialite.
How do I use the spatialite installation in my Java code? Which extension do I load for spatialite function
addGeometry()
(Linux / Ubuntu)
In windows I tried this and it worked but not for Ubuntu:
stmt.execute("SELECT load_extension('libspatialite.dll')");
stmt.execute("SELECT InitSpatialMetaData()");