当前位置: 首页 > news >正文

apache commons-dbcp Apache Commons DBCP 软件实现数据库连接池 commons-dbcp2

DBCP组件

许多Apache项目支持与关系型数据库进行交互。为每个用户创建一个新连接可能很耗时(通常需要多秒钟的时钟时间),以执行可能需要毫秒级时间的数据库事务。对于一个公开托管在互联网上的应用程序,在同时在线用户数量可能非常大的情况下,为每个用户打开一个连接可能是不可行的。因此,开发人员通常希望在所有当前应用程序用户之间共享一组“池化”的打开连接。在任何给定时间实际执行请求的用户数量通常只是活跃用户总数的非常小的百分比,在请求处理期间是唯一需要数据库连接的时间。应用程序本身登录到DBMS,并在内部处理任何用户账户问题。

已经有几个数据库连接池可用,包括Apache产品内部和其他地方。这个Commons包提供了一个机会,来协调创建和维护一个高效、功能丰富的包,以Apache许可证发布。

commons-dbcp2依赖于commons-pool2中的代码,以提供底层的对象池机制。

不同版本

DBCP现在有四个不同的版本,支持不同版本的JDBC。

它的工作原理如下:

开发中

DBCP 2.5.0及以上版本在Java 8(JDBC 4.2)及以上版本下编译和运行。

DBCP 2.4.0在Java 7(JDBC 4.1)及以上版本下编译和运行。

运行中

应用程序运行在Java 8及以上版本的情况下,应使用DBCP 2.5.0及以上版本的二进制文件。 应用程序在Java 7下运行时应使用DBCP 2.4.0的二进制文件。 DBCP 2基于Apache Commons Pool,并提供了与DBCP 1.x相比性能增强、JMX支持以及许多其他新功能。升级到2.x的用户应该注意到Java包名称已更改,以及Maven坐标已更改,因为DBCP 2.x与DBCP 1.x不是二进制兼容的。用户还应该注意,一些配置选项(例如maxActive到maxTotal)已更名以与Commons Pool使用的新名称对齐。

入门例子

您可以从我们的下载页面下载源代码和二进制文件。

或者,您可以从中央 Maven 存储库中提取它:

maven 引入

<dependency><groupId>org.apache.commons</groupId><artifactId>commons-dbcp2</artifactId><version>2.9.0</version>
</dependency>

代码

https://github.com/apache/commons-dbcp/tree/HEAD/doc

BasicDataSourceExample

这个是最基本的例子,不涉及任何池化能力。

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;import javax.sql.DataSource;//
// Here are the dbcp-specific classes.
// Note that they are only used in the setupDataSource
// method. In normal use, your classes interact
// only with the standard JDBC API
//
import org.apache.commons.dbcp2.BasicDataSource;//
// Here's a simple example of how to use the BasicDataSource.
////
// Note that this example is very similar to the PoolingDriver
// example.//
// To compile this example, you'll want:
//  * commons-pool-2.3.jar
//  * commons-dbcp-2.1.jar 
// in your classpath.
//
// To run this example, you'll want:
//  * commons-pool-2.3.jar
//  * commons-dbcp-2.1.jar 
//  * commons-logging-1.2.jar
// in your classpath.
//
//
// Invoke the class using two arguments:
//  * the connect string for your underlying JDBC driver
//  * the query you'd like to execute
// You'll also want to ensure your underlying JDBC driver
// is registered.  You can use the "jdbc.drivers"
// property to do this.
//
// For example:
//  java -Djdbc.drivers=org.h2.Driver \
//       -classpath commons-pool2-2.3.jar:commons-dbcp2-2.1.jar:commons-logging-1.2.jar:h2-1.3.152.jar:. \
//       BasicDataSourceExample \
//       "jdbc:h2:~/test" \
//       "SELECT 1"
//
public class BasicDataSourceExample {public static void main(String[] args) {// First we set up the BasicDataSource.// Normally this would be handled auto-magically by// an external configuration, but in this example we'll// do it manually.//System.out.println("Setting up data source.");DataSource dataSource = setupDataSource(args[0]);System.out.println("Done.");//// Now, we can use JDBC DataSource as we normally would.//Connection conn = null;Statement stmt = null;ResultSet rset = null;try {System.out.println("Creating connection.");conn = dataSource.getConnection();System.out.println("Creating statement.");stmt = conn.createStatement();System.out.println("Executing statement.");rset = stmt.executeQuery(args[1]);System.out.println("Results:");int numcols = rset.getMetaData().getColumnCount();while(rset.next()) {for(int i=1;i<=numcols;i++) {System.out.print("\t" + rset.getString(i));}System.out.println("");}} catch (SQLException e) {e.printStackTrace();} finally {try {if (rset != null)rset.close();} catch (Exception e) {}try {if (stmt != null)stmt.close();} catch (Exception e) {}try {if (conn != null)conn.close();} catch (Exception e) {}}}public static DataSource setupDataSource(String connectURI) {BasicDataSource ds = new BasicDataSource();ds.setDriverClassName("org.h2.Driver");ds.setUrl(connectURI);return ds;}public static void printDataSourceStats(DataSource ds) {BasicDataSource bds = (BasicDataSource) ds;System.out.println("NumActive: " + bds.getNumActive());System.out.println("NumIdle: " + bds.getNumIdle());}public static void shutdownDataSource(DataSource ds) throws SQLException {BasicDataSource bds = (BasicDataSource) ds;bds.close();}
}

PoolingDataSourceExample

这里的 datasource 是池化的。

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;//
// Here are the dbcp-specific classes.
// Note that they are only used in the setupDataSource
// method. In normal use, your classes interact
// only with the standard JDBC API
//
import org.apache.commons.pool2.ObjectPool;
import org.apache.commons.pool2.impl.GenericObjectPool;
import org.apache.commons.dbcp2.ConnectionFactory;
import org.apache.commons.dbcp2.PoolableConnection;
import org.apache.commons.dbcp2.PoolingDataSource;
import org.apache.commons.dbcp2.PoolableConnectionFactory;
import org.apache.commons.dbcp2.DriverManagerConnectionFactory;//
// Here's a simple example of how to use the PoolingDataSource.
////
// Note that this example is very similar to the PoolingDriver
// example.  In fact, you could use the same pool in both a
// PoolingDriver and a PoolingDataSource
////
// To compile this example, you'll want:
//  * commons-pool2-2.3.jar
//  * commons-dbcp2-2.1.jar
// in your classpath.
//
// To run this example, you'll want:
//  * commons-pool2-2.3.jar
//  * commons-dbcp2-2.1.jar
//  * commons-logging-1.2.jar
//  * the classes for your (underlying) JDBC driver
// in your classpath.
//
// Invoke the class using two arguments:
//  * the connect string for your underlying JDBC driver
//  * the query you'd like to execute
// You'll also want to ensure your underlying JDBC driver
// is registered.  You can use the "jdbc.drivers"
// property to do this.
//
// For example:
//  java -Djdbc.drivers=org.h2.Driver \
//       -classpath commons-pool2-2.3.jar:commons-dbcp2-2.1.jar:commons-logging-1.2.jar:h2-1.3.152.jar:. \
//       PoolingDataSourceExample \
//       "jdbc:h2:~/test" \
//       "SELECT 1"
//
public class PoolingDataSourceExample {public static void main(String[] args) {//// First we load the underlying JDBC driver.// You need this if you don't use the jdbc.drivers// system property.//System.out.println("Loading underlying JDBC driver.");try {Class.forName("org.h2.Driver");} catch (ClassNotFoundException e) {e.printStackTrace();}System.out.println("Done.");//// Then, we set up the PoolingDataSource.// Normally this would be handled auto-magically by// an external configuration, but in this example we'll// do it manually.//System.out.println("Setting up data source.");DataSource dataSource = setupDataSource(args[0]);System.out.println("Done.");//// Now, we can use JDBC DataSource as we normally would.//Connection conn = null;Statement stmt = null;ResultSet rset = null;try {System.out.println("Creating connection.");conn = dataSource.getConnection();System.out.println("Creating statement.");stmt = conn.createStatement();System.out.println("Executing statement.");rset = stmt.executeQuery(args[1]);System.out.println("Results:");int numcols = rset.getMetaData().getColumnCount();while(rset.next()) {for(int i=1;i<=numcols;i++) {System.out.print("\t" + rset.getString(i));}System.out.println("");}} catch (SQLException e) {e.printStackTrace();} finally {try {if (rset != null)rset.close();} catch (Exception e) {}try {if (stmt != null)stmt.close();} catch (Exception e) {}try {if (conn != null)conn.close();} catch (Exception e) {}}}// 这里的 datasource 是池化的。public static DataSource setupDataSource(String connectURI) {//// First, we'll create a ConnectionFactory that the// pool will use to create Connections.// We'll use the DriverManagerConnectionFactory,// using the connect string passed in the command line// arguments.//ConnectionFactory connectionFactory =new DriverManagerConnectionFactory(connectURI, null);//// Next we'll create the PoolableConnectionFactory, which wraps// the "real" Connections created by the ConnectionFactory with// the classes that implement the pooling functionality.//PoolableConnectionFactory poolableConnectionFactory =new PoolableConnectionFactory(connectionFactory, null);//// Now we'll need a ObjectPool that serves as the// actual pool of connections.//// We'll use a GenericObjectPool instance, although// any ObjectPool implementation will suffice.//ObjectPool<PoolableConnection> connectionPool =new GenericObjectPool<>(poolableConnectionFactory);// Set the factory's pool property to the owning poolpoolableConnectionFactory.setPool(connectionPool);//// Finally, we create the PoolingDriver itself,// passing in the object pool we created.//PoolingDataSource<PoolableConnection> dataSource =new PoolingDataSource<>(connectionPool);return dataSource;}
}

PoolingDriverExample.java

这里用的是 dbcp 的驱动实现池化的?

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;import org.apache.commons.dbcp2.ConnectionFactory;
import org.apache.commons.dbcp2.DriverManagerConnectionFactory;
import org.apache.commons.dbcp2.PoolableConnection;
import org.apache.commons.dbcp2.PoolableConnectionFactory;
import org.apache.commons.dbcp2.PoolingDriver;
//
// Here are the dbcp-specific classes.
// Note that they are only used in the setupDriver
// method. In normal use, your classes interact
// only with the standard JDBC API
//
import org.apache.commons.pool2.ObjectPool;
import org.apache.commons.pool2.impl.GenericObjectPool;//
// Here's a simple example of how to use the PoolingDriver.
//// To compile this example, you'll want:
//  * commons-pool-2.3.jar
//  * commons-dbcp-2.1.jar 
// in your classpath.
//
// To run this example, you'll want:
//  * commons-pool-2.3.jar
//  * commons-dbcp-2.1.jar 
//  * commons-logging-1.2.jar
// in your classpath.
//
// Invoke the class using two arguments:
//  * the connect string for your underlying JDBC driver
//  * the query you'd like to execute
// You'll also want to ensure your underlying JDBC driver
// is registered.  You can use the "jdbc.drivers"
// property to do this.
//
// For example:
//  java -Djdbc.drivers=org.h2.Driver \
//       -classpath commons-pool2-2.3.jar:commons-dbcp2-2.1.jar:commons-logging-1.2.jar:h2-1.3.152.jar:. \
//       PoolingDriverExample \
//       "jdbc:h2:~/test" \
//       "SELECT 1"
//
public class PoolingDriverExample {public static void main(String[] args) {//// First we load the underlying JDBC driver.// You need this if you don't use the jdbc.drivers// system property.//System.out.println("Loading underlying JDBC driver.");try {Class.forName("org.h2.Driver");} catch (ClassNotFoundException e) {e.printStackTrace();}System.out.println("Done.");//// Then we set up and register the PoolingDriver.// Normally this would be handled auto-magically by// an external configuration, but in this example we'll// do it manually.//System.out.println("Setting up driver.");try {setupDriver(args[0]);} catch (Exception e) {e.printStackTrace();}System.out.println("Done.");//// Now, we can use JDBC as we normally would.// Using the connect string//  jdbc:apache:commons:dbcp:example// The general form being://  jdbc:apache:commons:dbcp:<name-of-pool>//Connection conn = null;Statement stmt = null;ResultSet rset = null;try {System.out.println("Creating connection.");conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:example");System.out.println("Creating statement.");stmt = conn.createStatement();System.out.println("Executing statement.");rset = stmt.executeQuery(args[1]);System.out.println("Results:");int numcols = rset.getMetaData().getColumnCount();while(rset.next()) {for(int i=1;i<=numcols;i++) {System.out.print("\t" + rset.getString(i));}System.out.println("");}} catch (SQLException e) {e.printStackTrace();} finally {try {if (rset != null)rset.close();} catch (Exception e) {}try {if (stmt != null)stmt.close();} catch (Exception e) {}try {if (conn != null)conn.close();} catch (Exception e) {}}// Display some pool statisticstry {printDriverStats();} catch (Exception e) {e.printStackTrace();}// closes the pooltry {shutdownDriver();} catch (Exception e) {e.printStackTrace();}}public static void setupDriver(String connectURI) throws Exception {//// First, we'll create a ConnectionFactory that the// pool will use to create Connections.// We'll use the DriverManagerConnectionFactory,// using the connect string passed in the command line// arguments.//ConnectionFactory connectionFactory =new DriverManagerConnectionFactory(connectURI, null);//// Next, we'll create the PoolableConnectionFactory, which wraps// the "real" Connections created by the ConnectionFactory with// the classes that implement the pooling functionality.//PoolableConnectionFactory poolableConnectionFactory =new PoolableConnectionFactory(connectionFactory, null);//// Now we'll need a ObjectPool that serves as the// actual pool of connections.//// We'll use a GenericObjectPool instance, although// any ObjectPool implementation will suffice.//ObjectPool<PoolableConnection> connectionPool =new GenericObjectPool<>(poolableConnectionFactory);// Set the factory's pool property to the owning poolpoolableConnectionFactory.setPool(connectionPool);//// Finally, we create the PoolingDriver itself...//Class.forName("org.apache.commons.dbcp2.PoolingDriver");PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");//// ...and register our pool with it.//driver.registerPool("example", connectionPool);//// Now we can just use the connect string "jdbc:apache:commons:dbcp:example"// to access our pool of Connections.//}public static void printDriverStats() throws Exception {PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");ObjectPool<? extends Connection> connectionPool = driver.getConnectionPool("example");System.out.println("NumActive: " + connectionPool.getNumActive());System.out.println("NumIdle: " + connectionPool.getNumIdle());}public static void shutdownDriver() throws Exception {PoolingDriver driver = (PoolingDriver) DriverManager.getDriver("jdbc:apache:commons:dbcp:");driver.closePool("example");}
}

相关文章:

apache commons-dbcp Apache Commons DBCP 软件实现数据库连接池 commons-dbcp2

DBCP组件 许多Apache项目支持与关系型数据库进行交互。为每个用户创建一个新连接可能很耗时&#xff08;通常需要多秒钟的时钟时间&#xff09;&#xff0c;以执行可能需要毫秒级时间的数据库事务。对于一个公开托管在互联网上的应用程序&#xff0c;在同时在线用户数量可能非…...

8.2K star!史上最强Web应用防火墙

&#x1f6a9; 0x01 介绍 长亭雷池SafeLine是长亭科技耗时近 10 年倾情打造的WAF(Web Application Firewall)&#xff0c;一款敢打出口号 “不让黑客越雷池一步” 的 WAF&#xff0c;我愿称之为史上最强的一款Web应用防火墙&#xff0c;足够简单、足够好用、足够强的免费且开源…...

浅谈RPC的理解

浅谈RPC的理解 前言RPC体系Dubbo架构最后 前言 本文中部分知识涉及Dubbo&#xff0c;需要对Dubbo有一定的理解&#xff0c;且对源码有一定了解 如果不了解&#xff0c;可以参考学习我之前的文章&#xff1a; 浅谈Spring整合Dubbo源码&#xff08;Service和Reference注解部分&am…...

JDK发布信息、历史及未来规划

1.未来规划 发布日期类型版本其它信息2026-01-20CPU25.0.2, 21.0.10, 17.0.18, 11.0.30, 8u4812025-10-21CPU25.0.1, 21.0.9, 17.0.17, 11.0.29, 8u4712025-09-16Feature*25 LTS2025-07-15CPU24.0.2, 21.0.8, 17.0.16, 11.0.28, 8u4612025-04-15CPU24.0.1, 21.0.7, 17.0.15, 1…...

帅帅密码管理系统使用教程

在这个账号满天飞的大环境&#xff0c;密码太多&#xff0c;又容易遗忘&#xff0c;又不方便管理&#xff0c;存在记事本上&#xff0c;又担心泄漏。帅帅密码管理系统就是帮助你解决以上烦恼&#xff0c;用来帮助个人或团队管理众多的登陆密码&#xff0c;能够快速的查询、新增…...

漫谈5种注册中心

01 注册中心基本概念 1.1 什么是注册中心&#xff1f; 注册中心主要有三种角色&#xff1a; 服务提供者&#xff08;RPC Server&#xff09;&#xff1a;在启动时&#xff0c;向 Registry 注册自身服务&#xff0c;并向 Registry 定期发送心跳汇报存活状态。 服务消费者&…...

Vulnhub靶机:Kioptrix_2014

一、介绍 运行环境&#xff1a;Virtualbox和vmware 攻击机&#xff1a;kali&#xff08;192.168.56.101&#xff09; 靶机&#xff1a;Kioptrix: 2014&#xff08;192.168.56.108&#xff09; 目标&#xff1a;获取靶机root权限和flag 靶机下载地址&#xff1a;https://ww…...

Spring Boot整合Spring Security

Spring Boot 专栏&#xff1a;Spring Boot 从零单排 Spring Cloud 专栏&#xff1a;Spring Cloud 从零单排 GitHub&#xff1a;SpringBootDemo Gitee&#xff1a;SpringBootDemo Spring Security是针对Spring项目的安全框架&#xff0c;也是Spring Boot底层安全模块的默认技术…...

Rust字符串深入理解

一、概述 Rust是一种系统级语言&#xff0c;进行操作系统等底层应用开发&#xff0c;同时又具合理的抽象处理能力。在进行Rust编程时&#xff0c;字符串处理是程序员经常碰到的工作。本文深入解析Rust语言中字符串的使用&#xff0c;包括 static string&#xff0c;String与&a…...

TSINGSEE青犀AI智能分析网关V4酿酒厂安全挂网AI检测算法

在酿酒行业中&#xff0c;安全生产一直是企业经营中至关重要的一环。为了确保酒厂生产过程中的安全&#xff0c;TSINGSEE青犀AI智能分析网关V4的安全挂网AI检测算法发挥了重要作用。 TSINGSEE青犀AI智能分析网关V4的安全挂网检测算法是针对酒厂里酒窖挂网行为进行智能检测与识…...

LeetCode第126场双周赛个人题解

目录 100262. 求出加密整数的和 原题链接 思路分析 AC代码 3080. 执行操作标记数组中的元素 原题链接 思路分析 AC代码 100249. 替换字符串中的问号使分数最小 原题链接 思路分析 AC代码 100241. 求出所有子序列的能量和 原题链接 思路分析 AC代码 100262. 求出…...

牛客NC403 编辑距离为一【中等 模拟法 Java,Go,PHP】

题目 题目链接&#xff1a; https://www.nowcoder.com/practice/0b4b22ae020247ba8ac086674f1bd2bc 思路 注意&#xff1a;必须要新增一个&#xff0c;或者删除一个&#xff0c;或者替换一个&#xff0c;所以不能相等1.如果s和t相等&#xff0c;返回false,如果s和t长度差大于1…...

C# SetWindowPos函数

在C#中&#xff0c;SetWindowPos函数用于设置窗口的位置和大小。 原型&#xff1a; [DllImport("user32.dll", SetLastError true)] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int …...

zookeeper快速入门五:用zookeeper实现服务注册与发现中心

系列&#xff1a; zookeeper快速入门一&#xff1a;zookeeper安装与启动-CSDN博客 zookeeper快速入门二&#xff1a;zookeeper基本概念-CSDN博客 zookeeper快速入门三&#xff1a;zookeeper的基本操作 zookeeper快速入门四&#xff1a;在java客户端中操作zookeeper-CSDN博客…...

Java 中 BitSet 类的用法

Java 中 BitSet 类的用法 API构造置位为 true清除为 false查找位反转长度运算流其他 原理底层数据结构如何工作 API 构造 无参构造 &#xff1a;默认为 64 个 bit 的容量 BitSet bitset new BitSet();有参构造 &#xff1a;设置为 n 个 bit 的容量 BitSet bitset new BitSe…...

Jenkins-pipeline流水线构建完钉钉通知

添加钉钉机器人 在钉钉群设置里添加机器人拿出Webhook地址&#xff0c;设置关键词 Jenkins安装钉钉插件 Dashboard > 系统管理 > 插件管理&#xff0c;搜索构建通知&#xff0c;直接搜索Ding Talk也行 安装DingTalk插件&#xff0c;重启Jenkins 来到Dashboard > 系…...

汽车制造业供应商管理会面临哪些问题?要如何解决?

汽车行业的供应链是及其复杂的&#xff0c;并且呈全球化分布&#xff0c;企业在知识产权方面的优势很可能是阶段性的。企业需要持续保持领先&#xff0c;将面临巨大的挑战&#xff0c;尽快地将产品推向市场是保持领先的唯一途径。然而&#xff0c;如果没有正确的方式去实现安全…...

day28|93. 复原 IP 地址|Leetcode 78. 子集|90.子集II

Leetcode 93. 复原 IP 地址 链接&#xff1a;93. 复原 IP 地址 class Solution { public:vector<string> res;string path;int pointNum 0;vector<string> restoreIpAddresses(string s) {backtracking(0, s);return res;}void backtracking(int start, string …...

怎样提升小程序日活?签到抽奖可行吗?

一、 日活运营策略 小程序应该是即用即走的&#xff0c;每个小程序都在用户中有自己的独特定位&#xff0c;可能是生活日常必备&#xff08;美食、团购、商城&#xff09;&#xff0c;也可能是工作办公必备&#xff08;文档、打卡、工具&#xff09;。 如果你想要让自己的小程…...

hive语法树分析,判断 sql语句中有没有select *

pom依赖参考以下博文java 通过 IMetaStoreClient 取 hive 元数据信息-CSDN博客1 节点处理器类 import lombok.Getter; import org.apache.hadoop.hive.ql.lib.Dispatcher; import org.apache.hadoop.hive.ql.lib.Node; import org.apache.hadoop.hive.ql.parse.ASTNode; impor…...

2025年能源电力系统与流体力学国际会议 (EPSFD 2025)

2025年能源电力系统与流体力学国际会议&#xff08;EPSFD 2025&#xff09;将于本年度在美丽的杭州盛大召开。作为全球能源、电力系统以及流体力学领域的顶级盛会&#xff0c;EPSFD 2025旨在为来自世界各地的科学家、工程师和研究人员提供一个展示最新研究成果、分享实践经验及…...

相机Camera日志实例分析之二:相机Camx【专业模式开启直方图拍照】单帧流程日志详解

【关注我&#xff0c;后续持续新增专题博文&#xff0c;谢谢&#xff01;&#xff01;&#xff01;】 上一篇我们讲了&#xff1a; 这一篇我们开始讲&#xff1a; 目录 一、场景操作步骤 二、日志基础关键字分级如下 三、场景日志如下&#xff1a; 一、场景操作步骤 操作步…...

QMC5883L的驱动

简介 本篇文章的代码已经上传到了github上面&#xff0c;开源代码 作为一个电子罗盘模块&#xff0c;我们可以通过I2C从中获取偏航角yaw&#xff0c;相对于六轴陀螺仪的yaw&#xff0c;qmc5883l几乎不会零飘并且成本较低。 参考资料 QMC5883L磁场传感器驱动 QMC5883L磁力计…...

【JVM】- 内存结构

引言 JVM&#xff1a;Java Virtual Machine 定义&#xff1a;Java虚拟机&#xff0c;Java二进制字节码的运行环境好处&#xff1a; 一次编写&#xff0c;到处运行自动内存管理&#xff0c;垃圾回收的功能数组下标越界检查&#xff08;会抛异常&#xff0c;不会覆盖到其他代码…...

ETLCloud可能遇到的问题有哪些?常见坑位解析

数据集成平台ETLCloud&#xff0c;主要用于支持数据的抽取&#xff08;Extract&#xff09;、转换&#xff08;Transform&#xff09;和加载&#xff08;Load&#xff09;过程。提供了一个简洁直观的界面&#xff0c;以便用户可以在不同的数据源之间轻松地进行数据迁移和转换。…...

MySQL用户和授权

开放MySQL白名单 可以通过iptables-save命令确认对应客户端ip是否可以访问MySQL服务&#xff1a; test: # iptables-save | grep 3306 -A mp_srv_whitelist -s 172.16.14.102/32 -p tcp -m tcp --dport 3306 -j ACCEPT -A mp_srv_whitelist -s 172.16.4.16/32 -p tcp -m tcp -…...

.Net Framework 4/C# 关键字(非常用,持续更新...)

一、is 关键字 is 关键字用于检查对象是否于给定类型兼容,如果兼容将返回 true,如果不兼容则返回 false,在进行类型转换前,可以先使用 is 关键字判断对象是否与指定类型兼容,如果兼容才进行转换,这样的转换是安全的。 例如有:首先创建一个字符串对象,然后将字符串对象隐…...

鸿蒙DevEco Studio HarmonyOS 5跑酷小游戏实现指南

1. 项目概述 本跑酷小游戏基于鸿蒙HarmonyOS 5开发&#xff0c;使用DevEco Studio作为开发工具&#xff0c;采用Java语言实现&#xff0c;包含角色控制、障碍物生成和分数计算系统。 2. 项目结构 /src/main/java/com/example/runner/├── MainAbilitySlice.java // 主界…...

Reasoning over Uncertain Text by Generative Large Language Models

https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...

2025季度云服务器排行榜

在全球云服务器市场&#xff0c;各厂商的排名和地位并非一成不变&#xff0c;而是由其独特的优势、战略布局和市场适应性共同决定的。以下是根据2025年市场趋势&#xff0c;对主要云服务器厂商在排行榜中占据重要位置的原因和优势进行深度分析&#xff1a; 一、全球“三巨头”…...