code: public static void executeShapefileAttachQueries( final ASpatialDb db, String tableName, String shpPath, String encoding,
              int srid ) throws Exception {
          if (encoding == null || encoding.trim().length() == 0) {
              encoding = "UTF-8";
          }
  
          if (shpPath.endsWith(".shp")) {
              shpPath = shpPath.substring(0, shpPath.length() - 4);
          }
  
          final String sql1 = "CREATE VIRTUAL TABLE " + tableName + " using virtualshape('" + shpPath + "','" + encoding + "',"
                  + srid + ");";
          final String sql2 = "select RegisterVirtualGeometry('" + tableName + "');";
          db.executeInsertUpdateDeleteSql(sql1);
          db.executeInsertUpdateDeleteSql(sql2);
      }
docs: Attach a shapefile into the database using a temporary virtual table.
  
  @param db the database.
  @param tableName the name for the new table.
  @param shpPath the shp to import.
  @param encoding the encoding. If <code>null</code>, UTF-8 is used.
  @param srid the epsg code for the file.
  @throws Exception