code: public static String createTableFromShp( ASpatialDb db, File shapeFile, String newTableName, boolean avoidSpatialIndex )
              throws Exception {
          FileDataStore store = FileDataStoreFinder.getDataStore(shapeFile);
          SimpleFeatureSource featureSource = store.getFeatureSource();
          SimpleFeatureType schema = featureSource.getSchema();
          if (newTableName == null) {
              newTableName = FileUtilities.getNameWithoutExtention(shapeFile);
          }
          return createTableFromSchema(db, schema, newTableName, avoidSpatialIndex);
      }
docs: Create a spatial table using a shapefile as schema.
  
  @param db the database to use.
  @param shapeFile the shapefile to use.
  @param newTableName the new name of the table. If null, the shp name is used.
  @return the name of the created table.
  @param avoidSpatialIndex if <code>true</code>, no spatial index will be created. This is useful if many records
  have to be inserted and the index will be created later manually.
  @return the name of the created table.
  @throws Exception