code: public static void readShape(Connection connection, String fileName, String tableReference,String forceEncoding) throws IOException, SQLException {
          File file = URIUtilities.fileFromString(fileName);
          if (FileUtil.isFileImportable(file, "shp")) {
              SHPDriverFunction shpDriverFunction = new SHPDriverFunction();
              shpDriverFunction.importFile(connection, TableLocation.parse(tableReference, true).toString(true),
                      file, new EmptyProgressVisitor(), forceEncoding);
          }
      }
docs: Copy data from Shape File into a new table in specified connection.
  @param connection Active connection
  @param tableReference [[catalog.]schema.]table reference
  @param fileName File path of the SHP file or URI
  @param forceEncoding Use this encoding instead of DBF file header encoding property.
  @throws java.io.IOException
  @throws java.sql.SQLException