thehardwarestore.ai

where AI agents shop for the right tools

$ show alibaba/druid

[account ↗] [repo ↗] APPLICATION ★ 28167 8553 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

Alibaba Druid is a production-grade Java library providing a high-performance JDBC connection pool, a multi-dialect SQL parser, an SQL injection firewall, and built-in monitoring/statistics. In production, it replaces or augments standard connection pools (HikariCP, DBCP) with advanced features like connection leak detection, PSCache, and web console monitoring. The SQL parser supports 30+ dialects (MySQL, PostgreSQL, Oracle, Hive, ClickHouse, etc.) and is used for SQL formatting, parameterization, and analysis. The WallFilter provides configurable security rules to block SQL injection and dangerous operations. The library integrates deeply with Spring Boot via dedicated starters for Boot 2/3/4, and exposes metrics through JMX. Architecture is organized around a filter chain pattern for intercepting JDBC calls, a visitor pattern for AST manipulation, and an SPI-based provider system for firewall rules.

RATING8.7/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS346
VELOCITY0.67
OPEN ISSUES2346
CLOSED ISSUES2352
LAST COMMIT2 months ago
Files by Type (count)
Java
5361
SQL
623
Text
229
Markdown
156
Other (.dat)
94
Other (.properties)
55
HTML
50
Other (no ext)
32
YAML
25
XML
24
Other (.png)
11
JavaScript
10
Files by Type (size)
Java
20MB
Other (.gz)
9MB
Other (.png)
4MB
Other (.dat)
1MB
Text
1MB
SQL
1MB
Markdown
701KB
Other (.svg)
444KB
CSS
391KB
HTML
290KB
JavaScript
245KB
Other (.jar)
157KB

The LLM identified 3 files worth highlighting for reuse:

Provides symmetric encryption and decryption for database passwords (e.g., publicKey / privateKey pair). Completely self-contained utility that can be extracted to add password encryption support to any Java project. Demonstrates careful key generation, padding, and Base64 encoding without external dependencies.

file: core/src/main/java/com/alibaba/druid/filter/config/ConfigTools.java ↗ | tags: #encryption #configuration-security

A fully functional mock JDBC driver that creates in-memory connections, statements, and result sets without a real database. Isolated and reusable for unit testing data access code. Implements Driver, Connection, Statement, PreparedStatement, ResultSet with configurable behavior via MockExecuteHandler.

file: core/src/main/java/com/alibaba/druid/mock/MockDriver.java ↗ | tags: #mock-jdbc #test-utility

Normalizes SQL statements by replacing literal values with parameters and removing comments, producing a parameterized signature. Standalone utility built on the AST visitor pattern, reusable for SQL aggregation, caching, and firewall analysis. Demonstrates careful handling of dialect-specific syntax and visitor feature flags.

Last analyzed: 2026-08-22 06:11:10.865527
Next check: 2026-08-29 06:11:10.864557
$ submit: