jeecgboot/JeecgBoot · error · JeecgBootException
不支持的数据库驱动【{driverClassName}】,如需支持请联系管理员
Error message
不支持的数据库驱动【{driverClassName}】,如需支持请联系管理员 What it means
Thrown by JdbcSecurityUtil.validateDriver() when the provided driverClassName does not match any entry in the ALLOWED_DRIVERS whitelist (15 supported drivers: MySQL, Oracle, SQLServer, MariaDB, PostgreSQL, DM, KingBase, Oscar, SQLite, DB2, HSQLDB, Derby, H2). The whitelist uses exact String equals matching (case-sensitive). This prevents loading arbitrary JDBC driver classes that could enable RCE or other attacks.
Source
Thrown at jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/JdbcSecurityUtil.java:133
}
}
/**
* 校验驱动类名是否在白名单中
*
* @param driverClassName JDBC 驱动类名
* @throws JeecgBootException 驱动不在白名单时抛出
*/
public static void validateDriver(String driverClassName) {
if (oConvertUtils.isEmpty(driverClassName)) {
throw new JeecgBootException("数据库驱动类名不能为空");
}
for (String allowed : ALLOWED_DRIVERS) {
if (allowed.equals(driverClassName)) {
return;
}
}
throw new JeecgBootException("不支持的数据库驱动【" + driverClassName + "】,如需支持请联系管理员");
}
}View on GitHub (pinned to 96fb33f5ec)
Solutions
- Verify the exact driver class name against the ALLOWED_DRIVERS array in JdbcSecurityUtil.java — matching is case-sensitive and exact.
- If you need an unsupported database, add its driver class name to the ALLOWED_DRIVERS array and rebuild.
- Check for common typos: 'Driver' vs 'driver', missing package prefixes, extra whitespace.
Example fix
// before — typo in driver class name
sysDataSource.setDbDriver("com.mysql.cj.jdbc.driver"); // lowercase 'd'
JdbcSecurityUtil.validateDriver(sysDataSource.getDbDriver()); // throws
// after — exact match
sysDataSource.setDbDriver("com.mysql.cj.jdbc.Driver"); // capital 'D'
JdbcSecurityUtil.validateDriver(sysDataSource.getDbDriver()); // passes
// If you need a new driver, add to JdbcSecurityUtil.ALLOWED_DRIVERS:
// "com.clickhouse.jdbc.ClickHouseDriver" Defensive patterns
Strategy: validation
Validate before calling
// Verify driver class name is in ALLOWED_DRIVERS before calling validateDriver
Set<String> allowed = new HashSet<>(Arrays.asList(
"com.mysql.cj.jdbc.Driver", "org.postgresql.Driver", "oracle.jdbc.OracleDriver"/*...*/));
if (!allowed.contains(driverClassName)) {
return Result.error("不支持的驱动: " + driverClassName);
} Try / catch
try {
JdbcSecurityUtil.validateDriver(driverClassName);
} catch (JeecgBootException e) {
log.warn("Driver not in whitelist: {}", driverClassName);
return Result.error(e.getMessage());
} Prevention
- Use the exact driver class name from the ALLOWED_DRIVERS list — matching is case-sensitive.
- If a new database type is needed, add its driver to ALLOWED_DRIVERS and rebuild.
- Copy driver class names directly from the JdbcSecurityUtil source to avoid typos.
When it happens
Trigger: Providing a driver class name not in the whitelist — e.g., a custom driver, a newer/older driver with a different class name, or a third-party driver. Also triggered by typos in the driver class name (e.g., 'com.mysql.cj.jdbc.driver' instead of 'com.mysql.cj.jdbc.Driver' — note case).
Common situations: Using a database not in the whitelist (e.g., ClickHouse, Redis JDBC, Neo4j); driver class name has a typo or wrong case; using a new driver version with a relocated class name; admin copy-pastes a driver name from an outdated tutorial.
Related errors
- 连接地址有安全风险,包含不安全参数【{unsafeParam}】
- 数据库驱动类名不能为空
- 非法存储路径,路径包含遍历字符: {storePath}
- 请注意,值可能存在SQL注入风险!--->{value}
- 请注意,SQL中不允许含注释,有安全风险!
AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14).
Data as JSON: /api/errors/b5d8746fe07ab1c3.
Report an issue: GitHub.