Geotools-PG空间库(Crud,属性查询,空间查询)

news2025/1/11 9:51:57

建立连接

经过测试,这套连接逻辑除了支持纯PG以外,也支持人大金仓,凡是套壳PG的都可以尝试一下。我这里的测试环境是Geosence创建的pg SDE,数据库选用的是人大金仓。

/**
  * 获取数据库连接资源
  *
  * @param connectConfig
  * @return
  * {@link PostgisNGDataStoreFactory} PostgisNGDataStoreFactory还有跟多的定制化参数可以进去看看
  * @throws Exception
  */
 public static DataStore ConnectDatabase(GISConnectConfig connectConfig) throws Exception {
     if (pgDatastore != null) {
         return pgDatastore;
     }
     //数据库连接参数配置
     Map<String, Object> params = new HashMap<String, Object>();
     // 数据库类型
     params.put(PostgisNGDataStoreFactory.DBTYPE.key, connectConfig.getType());
     params.put(PostgisNGDataStoreFactory.HOST.key, connectConfig.getHost());
     params.put(PostgisNGDataStoreFactory.PORT.key, connectConfig.getPort());
     // 数据库名
     params.put(PostgisNGDataStoreFactory.DATABASE.key, connectConfig.getDataBase());
     //用户名和密码
     params.put(PostgisNGDataStoreFactory.USER.key, connectConfig.getUser());
     params.put(PostgisNGDataStoreFactory.PASSWD.key, connectConfig.getPassword());
     // 模式名称
     params.put(PostgisNGDataStoreFactory.SCHEMA.key, "sde");
     // 最大连接
     params.put( PostgisNGDataStoreFactory.MAXCONN.key, 25);
     // 最小连接
     params.put(PostgisNGDataStoreFactory.MINCONN.key, 10);
     // 超时时间
     params.put( PostgisNGDataStoreFactory.MAXWAIT.key, 10);
     try {
         pgDatastore = DataStoreFinder.getDataStore(params);
         return pgDatastore;
     } catch (IOException e) {
         LOG.error("获取数据源信息出错");
     }
     return null;
 }

查询

  • 查询所有的表格
/**
  * 查询所有的表格
  * @return
  * @throws IOException
  */
 public List<String> getAllTables() throws IOException {
     String[] typeNames = this.dataStore.getTypeNames();
     List<String> tables = Arrays.stream(typeNames).collect(Collectors.toList());
     return tables;
 }

属性查询&&空间查询通用

 /**
    * 查询要素
    * @param layerName
    * @param filter
    * @return
    * @throws IOException
    */
   public  SimpleFeatureCollection queryFeatures(String layerName, Filter filter) throws IOException {
       SimpleFeatureCollection features = null;
       try {
           SimpleFeatureSource featureSource = dataStore.getFeatureSource(layerName);
           features = featureSource.getFeatures(filter);
           return features;
       } catch (Exception e) {
           e.printStackTrace();
       }
       return features;
   }
  • 属性筛选查询
    用数据库查:
    在这里插入图片描述
SELECT *FROM demoWHERE xmbh = '3308812023104'  AND zzdybh = '3308812023104003' AND zzlx = '10'

在这里插入图片描述
用代码查:

 SimpleFeatureCollection simpleFeatureCollection = pgTemplate.queryFeatures("demo", CQL.toFilter("xmbh = '3308812023104'  AND zzdybh = '3308812023104003' AND zzlx = '10'"));

在这里插入图片描述

  • 空间筛选
Geometry geometry = new WKTReader().read("Polygon ((119.13571152004580256 29.96675730309299368, 119.14239751148502933 29.62242874397260195, 119.49341206204465493 29.84975245290645063, 119.23265839591465465 30.0670471746814556, 119.13571152004580256 29.96675730309299368))");
// 直接写SQL
Filter filter = CQL.toFilter("INTERSECTS(shape," + geometry .toString() + ")");
// 或者使用FilterFactory 
Within within = ff.within(ff.property("shape"), ff.literal(geometry));
SimpleFeatureCollection simpleFeatureCollection = pgTemplate.queryFeatures("demo", within);

如果不知道使用的什么关键字就比如相交INTERSECTS,可以点进对应的这个空间关系里去看这个Name,和这个保持一致。
在这里插入图片描述

总结:这里就在于怎么去写这个Filter,可以直接使用SQL语法。也可以自己去构造,需要借助这两个类

private static FilterFactory2 spatialFilterFc = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
private static FilterFactory propertyFilterFc = CommonFactoryFinder.getFilterFactory(null);

添加要素

/**
 * 
 * @param type 
 * @param features 需要追加的要素
 * @throws IOException
 */
public  void appendFeatures(SimpleFeatureType type, List<SimpleFeature> features) throws IOException {
    ListFeatureCollection featureCollection = new ListFeatureCollection(type, features);
    String typeName = type.getTypeName();
    FeatureStore featureStore = (FeatureStore) dataStore.getFeatureSource(typeName);
    try {
        featureStore.addFeatures(featureCollection);
    } catch (IOException e) {
        e.printStackTrace();
    }
    Transaction transaction = new DefaultTransaction("appendData");
    featureStore.setTransaction(transaction);
    transaction.commit();
}

测试代码:

Geometry geometry = new WKTReader().read("Polygon ((118.41044123299997182 29.89092741100000694, 118.42024576499994737 29.83296547499998042, 118.30907619399994246 29.75101510400003235, 118.19200671200002262 29.74673207400002184, 118.41044123299997182 29.89092741100000694))");
    SimpleFeature build = CustomFeatureBuilder.build(new HashMap<String, Object>() {{
        put("xmbh", "ceshiceshi");
        put("zxmmc", "测试一把");
        put("shape", geometry);
    }}, "demo" , geometry);
    SimpleFeatureType simpleFeatureType = dataStore.getSchema("demo");
    pgTemplate.appendFeatures(simpleFeatureType, Arrays.asList(build));

构建要素的代码如下:

/**
   *  构建一个Feature
   * @param fieldsMap
   * @param typeName
   * @return
   */
  public static SimpleFeature build(Map<String, Object> fieldsMap, String typeName) {
      SimpleFeatureTypeBuilder simpleFeatureTypeBuilder = new SimpleFeatureTypeBuilder();
      List<Object> values = new ArrayList<>();
      fieldsMap.forEach((key, val) -> {
          simpleFeatureTypeBuilder.add(key, val.getClass());
          values.add(val);
      });
      simpleFeatureTypeBuilder.setName(typeName);
      SimpleFeatureType simpleFeatureType = simpleFeatureTypeBuilder.buildFeatureType();
      SimpleFeatureBuilder builder = new SimpleFeatureBuilder(simpleFeatureType);
      builder.addAll(values);
      SimpleFeature feature = builder.buildFeature(null);
      return feature;
  }

在这里插入图片描述
图形也能正常展示:
在这里插入图片描述

/**
  * 通过FeatureWriter 追加要素
  * @param type
  * @param features
  * @throws IOException
  */
 public  void appendFeatureByFeatureWriter(SimpleFeatureType type, List<SimpleFeature> features) throws IOException {
     String typeName = type.getTypeName();
     FeatureWriter<SimpleFeatureType, SimpleFeature> featureWriter = dataStore.getFeatureWriterAppend(typeName, new DefaultTransaction("appendData"));
     for (SimpleFeature feature : features) {
         SimpleFeature remoteNext = featureWriter.next();
         remoteNext.setAttributes(feature.getAttributes());
         remoteNext.setDefaultGeometry(feature.getDefaultGeometry());
         featureWriter.write();
     }
    featureWriter.close();
 }

使用FeatureWriter这个时候要注意啦,你插入的时候必须每个字段都设置值,追进源码里面发现它的SQL是写了所有字段的
源码路径:JDBCDataStore#insertNonPS

在这里插入图片描述
所以下面这种方式是不会成功的,要成功的话必须设置所有的字段对应上,我懒得弄了原理就是上面源码那样的:

// 错误示范 需要填所有字段
Geometry geometry = new WKTReader().read("Polygon ((118.41044123299997182 29.89092741100000694, 118.42024576499994737 29.83296547499998042, 118.30907619399994246 29.75101510400003235, 118.19200671200002262 29.74673207400002184, 118.41044123299997182 29.89092741100000694))");
SimpleFeature build = CustomFeatureBuilder.build(new HashMap<String, Object>() {{
    put("xmbh", "writer");
    put("zxmmc", "demo");
    put("zzdybh", "fdsa");
    put("shape", geometry);
}}, "demo" );
SimpleFeatureType simpleFeatureType = dataStore.getSchema("demo");
pgTemplate.appendFeatureByFeatureWriter(simpleFeatureType, Arrays.asList(build));

追加要素的原理都是借助于空间函数,我们如果调试源码就会发现最终生成了一个SQL类似于下面这个SQL

INSERT INTO "sde"."demo" ( "xmbh","zzdybh","zxmmc","zzlx","zxmlx","zxmbh","zgbm","jsgm","jhtz","xzgdmj","xzgddb","lxrq","wcrq","bz","txmj","bsm","czzj","shzj","gdb_geomattr_data","shape","objectid" ) VALUES ( 'ces','11111','update',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,ST_GeomFromText('POLYGON ((119.1357115200458 29.966757303092994, 119.14239751148503 29.622428743972602, 119.49341206204465 29.84975245290645, 119.23265839591465 30.067047174681456, 119.1357115200458 29.966757303092994))', 4490),2)

源码如下:

{@link JDBCDataStore#insertNonPS}
try {
  for (SimpleFeature feature : features) {
      String sql = insertSQL(featureType, feature, keysFetcher, cx);

      ((BasicSQLDialect) dialect).onInsert(st, cx, featureType);

      LOGGER.log(Level.FINE, "Inserting new feature: {0}", sql);
      if (keysFetcher.hasAutoGeneratedKeys()) {
          st.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS);
      } else {
          st.executeUpdate(sql);
      }

      keysFetcher.postInsert(featureType, feature, cx, st);
  }
} finally {
  closeSafe(st);
}

更新

  • 更新属性
/**
   * 更新属性
   * @param type
   * @param fieldsMap
   * @param filter
   * @throws IOException
   */
  public  void updateFeatures(SimpleFeatureType type, Map<String, Object> fieldsMap, Filter filter) throws IOException {
      String typeName = type.getTypeName();
      List<Name> names =new ArrayList<>();
      FeatureStore featureStore = (FeatureStore) dataStore.getFeatureSource(typeName);
      Set<String> keys = fieldsMap.keySet();
      for (String field : keys) {
          Name name = new NameImpl(field);
          names.add(name);
      }
      featureStore.modifyFeatures(names.toArray(new NameImpl[names.size()]), fieldsMap.values().toArray(), filter);
  }

测试代码:

HashMap<String, Object> fieldsMap = new HashMap<String, Object>() {{
    put("xmbh", "testupdate");
    put("zxmmc", "update");
    put("zzdybh", "3308812023104003");
}};
SimpleFeatureType simpleFeatureType = dataStore.getSchema("demo");
pgTemplate.updateFeatures(simpleFeatureType, fieldsMap, CQL.toFilter(" xmbh = 'ceshiceshi'"));

在这里插入图片描述
如果你需要更新几何,只需要设置几何字段即可:

HashMap<String, Object> fieldsMap = new HashMap<String, Object>() {{
     put("xmbh", "ces");
     put("zxmmc", "update");
     put("zzdybh", "3308812023104003");
     put("shape", geometry);
 }};

我们还可以这样写

/**
 * 覆盖更新
 * @param type
 * @param fieldsMap
 * @param filter
 * @throws IOException
 */
public  void updateFeatureFeatureReader(SimpleFeatureType type, Map<String, Object> fieldsMap, Filter filter) throws IOException {
    String typeName = type.getTypeName();
    FeatureStore featureStore = (FeatureStore) dataStore.getFeatureSource(typeName);
    SimpleFeature simpleFeature = CustomFeatureBuilder.build(fieldsMap, typeName);
    // 设置一个 FeatureReader
    FeatureReader<SimpleFeatureType, SimpleFeature> featureReader = new CollectionFeatureReader(simpleFeature);
    featureStore.setFeatures(featureReader);
    featureReader.close();
}

这里还需要注意一点,featureReaders 是覆盖更新的逻辑,所以使用的时候要谨慎一点
在这里插入图片描述

下面有这么多实现类,具体怎么组合使用就看你的想象力了:
在这里插入图片描述

删除要素

/**
 * 删除数据
 *
 * @param layerName 图层名称
 * @param filter 过滤器
 */
public  boolean deleteData(String layerName, Filter filter) {
    try {
        SimpleFeatureSource featureSource = dataStore.getFeatureSource(layerName);
        FeatureStore featureStore = (FeatureStore) featureSource;
        featureStore.removeFeatures(filter);
        Transaction transaction = new DefaultTransaction("delete");
        featureStore.setTransaction(transaction);
        transaction.commit();
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
    return true;
}

完整DEMO

Demo 代码难免写的比较草率,不要喷我奥,哈哈哈哈哈

public class PgTemplate {
private final DataStore dataStore;

public PgTemplate(DataStore dataStore) {
    this.dataStore = dataStore;
}

/**
 * @param type
 * @param features 需要追加的要素
 * @throws IOException
 */
public void appendFeatures(SimpleFeatureType type, List<SimpleFeature> features) throws IOException {
    ListFeatureCollection featureCollection = new ListFeatureCollection(type, features);
    String typeName = type.getTypeName();
    FeatureStore featureStore = (FeatureStore) dataStore.getFeatureSource(typeName);
    try {
        featureStore.addFeatures(featureCollection);
    } catch (IOException e) {
        e.printStackTrace();
    }
    Transaction transaction = new DefaultTransaction("appendData");
    featureStore.setTransaction(transaction);
    transaction.commit();
}

/**
 * 更新属性
 *
 * @param type
 * @param fieldsMap
 * @param filter
 * @throws IOException
 */
public void updateFeatures(SimpleFeatureType type, Map<String, Object> fieldsMap, Filter filter) throws IOException {
    String typeName = type.getTypeName();
    List<Name> names = new ArrayList<>();
    FeatureStore featureStore = (FeatureStore) dataStore.getFeatureSource(typeName);
    Set<String> keys = fieldsMap.keySet();
    for (String field : keys) {
        Name name = new NameImpl(field);
        names.add(name);
    }
    featureStore.modifyFeatures(names.toArray(new NameImpl[names.size()]), fieldsMap.values().toArray(), filter);
}

/**
 * 覆盖更新
 *
 * @param type
 * @param fieldsMap
 * @param filter
 * @throws IOException
 */
public void updateFeatureFeatureReader(SimpleFeatureType type, Map<String, Object> fieldsMap, Filter filter) throws IOException {
    String typeName = type.getTypeName();
    FeatureStore featureStore = (FeatureStore) dataStore.getFeatureSource(typeName);
    SimpleFeature simpleFeature = CustomFeatureBuilder.build(fieldsMap, typeName);
    FeatureReader<SimpleFeatureType, SimpleFeature> featureReader = new CollectionFeatureReader(simpleFeature);
    featureStore.setFeatures(featureReader);
    featureReader.close();
}

/**
 * 通过FeatureWriter 追加要素
 *
 * @param type
 * @param features
 * @throws IOException
 */
public void appendFeatureByFeatureWriter(SimpleFeatureType type, List<SimpleFeature> features) throws IOException {
    String typeName = type.getTypeName();
    FeatureWriter<SimpleFeatureType, SimpleFeature> featureWriter = dataStore.getFeatureWriterAppend(typeName, new DefaultTransaction("appendData"));
    for (SimpleFeature feature : features) {
        SimpleFeature remoteNext = featureWriter.next();
        remoteNext.setAttributes(feature.getAttributes());
        remoteNext.setDefaultGeometry(feature.getDefaultGeometry());
        featureWriter.write();
    }
    featureWriter.close();
}

/**
 * 删除数据
 *
 * @param
 * @param
 * @param
 */
public boolean deleteData(String layerName, Filter filter) {
    try {
        SimpleFeatureSource featureSource = dataStore.getFeatureSource(layerName);
        FeatureStore featureStore = (FeatureStore) featureSource;
        featureStore.removeFeatures(filter);
        Transaction transaction = new DefaultTransaction("delete");
        featureStore.setTransaction(transaction);
        transaction.commit();
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
    return true;
}

/**
 * 查询要素
 *
 * @param layerName
 * @param filter
 * @return
 * @throws IOException
 */
public SimpleFeatureCollection queryFeatures(String layerName, Filter filter) throws IOException {
    SimpleFeatureCollection features = null;
    try {
        SimpleFeatureSource featureSource = dataStore.getFeatureSource(layerName);
        features = featureSource.getFeatures(filter);
        return features;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return features;
}

/**
 * 查询要素
 *
 * @param layerName
 * @param filter
 * @return
 * @throws IOException
 */
public SimpleFeatureCollection queryFeaturesByFeatureReader(String layerName, Filter filter) throws IOException {
    FeatureReader<SimpleFeatureType, SimpleFeature> featureReader = dataStore.getFeatureReader(new Query(layerName, filter), new DefaultTransaction("query"));
    SimpleFeatureType featureType = featureReader.getFeatureType();
    List<SimpleFeature> features = new ArrayList<>();
    while (featureReader.hasNext()) {
        SimpleFeature next = featureReader.next();
        features.add(next);
    }
    return new ListFeatureCollection(featureType, features);
}

/**
 * 查询所有的表格
 *
 * @return
 * @throws IOException
 */
public List<String> getAllTables() throws IOException {
    String[] typeNames = this.dataStore.getTypeNames();
    List<String> tables = Arrays.stream(typeNames).collect(Collectors.toList());
    return tables;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1373483.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

深入理解 Flink(五)Flink Standalone 集群启动源码剖析

前言 Flink 集群的逻辑概念&#xff1a; JobManager(StandaloneSessionClusterEntrypoint) TaskManager(TaskManagerRunner) Flink 集群的物理概念&#xff1a; ResourceManager(管理集群所有资源&#xff0c;管理集群所有从节点) TaskExecutor(管理从节点资源&#xff0c;接…

Oracle 19c OCP 1z0 082考场真题解析第27题

考试科目&#xff1a;1Z0-082 考试题量&#xff1a;90 通过分数&#xff1a;60% 考试时间&#xff1a;150min本文为云贝教育郭一军&#xff08;微信&#xff1a;guoyJoe&#xff09;原创&#xff0c;请尊重知识产权&#xff0c;转发请注明出处&#xff0c;不接受任何抄袭、演绎…

道路拆除的题解

目录 原题描述&#xff1a; 题目描述 输入格式 输出格式 样例 #1 样例输入 #1 样例输出 #1 样例 #2 样例输入 #2 样例输出 #2 提示 题目大意&#xff1a; 主要思路&#xff1a; 至于dis怎么求&#xff1f; 代码code&#xff1a; 原题描述&#xff1a; 题目描述 …

我为什么注销了知乎的账号

在谈论这个话题前&#xff0c;大家先看看这篇知乎的讨论&#xff01;回答感觉比较经典&#xff01; 我大概有几年没上知乎了&#xff0c;因为一直感觉知乎上是一群爱讨论假大空理论的群体或者一群无聊的杠精&#xff01;与咱这撸袖子埋头干的人不合拍&#xff01;昨天没事上了一…

出版实务 | 出版物的成本及其构成

文章目录 出版物成本的总体构成直接成本开发成本制作成本 间接成本期间费用 本量利分析原则特点和作用变动成本项目固定成本项目本量利分析的基本公式及其应用定价发行折扣率销售数量单位销售收入销售收入总额单位销售税金销售税金总额变动成本总额单位变动成本固定成本总额单位…

如何对制作好的查询进行编辑和导出?

发布者已经创建好了查询&#xff0c;如发现数据有误&#xff0c;想要进行修改&#xff0c;或者想要将收集好的表格进行导出&#xff0c;应该如何操作&#xff1f;本次就来介绍如何使用此功能。 &#x1f4d6;案例&#xff1a;教师荣誉核对系统 在开启可修改列功能的教师荣誉核对…

IO进程线程day5

1.实现互斥机制 #include <head.h>char buf[128]; //全局数组&#xff0c;临界资源//1、创建一个互斥锁 pthread_mutex_t mutex;//定义分支线程 void *task(void *arg) {while(1){//3、获取锁资源pthread_mutex_lock(&mutex);printf("分支线程中&…

Oracle-探究统计信息收集自动采样AUTO_SAMPLE_SIZE

前言&#xff1a; Oracle数据库进行统计信息收集时&#xff0c;可以通过ESTIMATE_PERCENT参数指定采样方式或者比例&#xff0c;有以下4种指定的方式 1 统计信息收集时不指定值&#xff0c;这时候ESTIMATE_PERCENT值为默认值DBMS_STATS.AUTO_SAMPLE_SIZE&#xff0c;自动采样 …

ApolloCarla联合仿真基本操作

Apollo 系统架构 CANBus&#xff1a;对接车辆的底盘&#xff0c;做一些数据的收发&#xff0c;如油门&#xff0c;方向盘转角 HDMap&#xff1a; 给localization提供定位图层的信息给perception一些车道线、道路拓扑、红绿灯的信息&#xff08;超时空感知&#xff09;&#x…

一台Linux服务jdk1.6 与 jdk1.8 并存,tomcat6+tomcat8 并存

Linux jdk1.6,1.8 tomcat6 tomcat8 并存 需求场景&#xff1a; 有一个项目 原来是 jdk1.6tomcat6 部署的&#xff0c;现在需要进行项目架构升级 项目需要适配jdk1.8 然后用 jdk.8 tomcat 8进行部署&#xff0c;然后下架 jdk1.6 的linux服务 现在有一台 jdk.8 tomcat 8的linu…

【办公软件】手机当电脑摄像头Iriun Webcam软件安装与试用

家里电脑是台式的没有摄像头&#xff0c;但老安卓手机有一台。本来想用小爱摄像头做电脑摄像头&#xff0c;但是发现像素有点差&#xff0c;捣鼓了半天没成功。看网上别人都用旧手机来当电脑摄像头&#xff0c;并且也能使用音频&#xff0c;所以还是用旧手机做摄像头比较香。 …

Java 常见缓存详解以及解决方案

一. 演示Mybatis 一级缓存 首先我们准备一个接口 两个实现的方法&#xff0c; 当我们调用这个queryAll&#xff08;&#xff09;方法时我们需要调用selectAll&#xff08;&#xff09;方法来查询数据 调用此接口实现效果 这个时候我们就可以发现了问题&#xff0c;我们调用方法…

车速预测 | Matlab基于RBF径向基神经网络的车速预测模型(多步预测,尾巴图)

目录 效果一览基本介绍程序设计参考资料 效果一览 基本介绍 车速预测 | Matlab基于RBF径向基神经网络的车速预测模型&#xff08;多步预测&#xff0c;尾巴图&#xff09; 程序设计 完整程序和数据获取方式&#xff1a;私信博主回复Matlab基于RBF径向基神经网络的车速预测模型…

电脑重装系统有什么好处和坏处?利弊分析

在数字时代&#xff0c;电脑已成为我们日常生活和工作中不可或缺的工具。随着时间的推移&#xff0c;电脑可能会出现各种问题&#xff0c;如运行缓慢、软件冲突、病毒侵入等。此时&#xff0c;许多人会选择重装系统作为解决问题的方法。重装系统既有好处也有坏处。本文将深入探…

GC6109——双通道5V低电压步进电机驱动芯片,低噪声、低振动,应用摄像机,机器人等产品中

GC6109是双通道5V低电压步进电机驱动器&#xff0c;具有低噪声、低振动的特点&#xff0c;特别适用于相机的变焦和对焦系统&#xff0c;万向节和其他精密、低噪声的STM控制系统。该芯片为每个通道集成了256微步驱动器。带SPl接口&#xff0c;用户可以方便地调整驱动器的参数。内…

Java版直播商城:电商源码、小程序、三级分销及 免 费 搭 建 方案

一、技术选型 java开发语言&#xff1a;java是一种跨平台的编程语言&#xff0c;适用于大型企业级应用开发。使用java开发直播商城可以保证系统的稳定性和可扩展性。 spring boot框架&#xff1a;spring boot是一个快速构建spring应用的框架&#xff0c;简化了开发过程&#xf…

Elasticsearch windows开箱即用【记录】

一、准备工作 安装ES之前要在本机安装好JDK&#xff0c;对应的兼容性见官网链接&#xff1a;https://www.elastic.co/cn/support/matrix ES官网链接&#xff1a;https://www.elastic.co/cn/, 我本机安装的是JDK8&#xff0c;测试使用的是7.3.0版本的ES和Kibana。 1、首先去…

【2024最新-python3小白零基础入门】No3.python六大数据类型学习

文章目录 前言一、 Number&#xff08;数字&#xff09;1.1 数字类型分类1.2 数字类型转换1.3 数字运算 二、 String&#xff08;字符串&#xff09;2.1 字符串的创建&#xff1a; 2.2 字符串的基本操作&#xff1a;2.3 字符串常用方法&#xff1a; 三、 List&#xff08;列表&…

Vulnhub靶机:Corrosion 2

一、介绍 运行环境&#xff1a;Virtualbox 攻击机&#xff1a;kali&#xff08;10.0.2.15&#xff09; 靶机&#xff1a;corrosion:2&#xff08;10.0.2.13&#xff09; 目标&#xff1a;获取靶机root权限和flag 靶机下载地址&#xff1a;https://www.vulnhub.com/entry/c…

Python教程39:使用turtle画美国队长盾牌

---------------turtle源码集合--------------- Python教程36&#xff1a;海龟画图turtle写春联 Python源码35&#xff1a;海龟画图turtle画中国结 Python源码31&#xff1a;海龟画图turtle画七道彩虹 Python源码30&#xff1a;海龟画图turtle画紫色的小熊 Python源码29&a…