Skip to main content

dbVisitor

One APIs Access Any DataBase

Acknowledge and manage differences rather than eliminate them — access supported databases through unified APIs and a dual-layer adapter architecture.

Start with practical guides to vector search, multiple data sources, and object mapping.

Broad Database Support

Supports multiple relational database dialects, plus NoSQL and vector databases through JDBC driver adapters

MySQL
MariaDB
PostgreSQLOracleSQL ServerDB2DM
Xugu
Informix
TiDB
OceanBase
H2
SQLite
Derby
HSQLDB
ClickHouse
Greenplum
SAP HANA
Hive
Impala
StarRocks
Doris
RedisMongoDBElasticsearchMilvus

5 API Styles

Choose the best API for your scenario — all styles share the same underlying runtime mechanism.

⌨️

JdbcTemplate

Native SQL operations, the most direct way to access databases

View Docs →
JdbcTemplate.java
JdbcTemplate jdbc = new JdbcTemplate(dataSource);

// Query and map to Bean
List<User> users = jdbc.queryForList(
    "select * from users where age > ?",
    new Object[] { 18 },
    User.class
);

// Query single value
Long total = jdbc.queryForObject(
    "select count(*) from users",
    Long.class
);

Same APIs, Different Databases

Reuse APIs within driver capabilities; SQL, field mappings, and transaction support still depend on the data source

MySQL / PostgreSQL
// Connect to relational database
Configuration config = new Configuration();
LambdaTemplate t = config.newLambda(ds);

// Lambda query
List<User> users = t
    .query(User.class)
    .eq(User::getAge, 18)
    .queryForList();
MongoDB / Elasticsearch
// Connect to NoSQL database (same API)
Configuration config = new Configuration();
LambdaTemplate t = config.newLambda(ds);

// Exact same Lambda query
List<User> users = t
    .query(User.class)
    .eq(User::getAge, 18)
    .queryForList();

Dual-Layer Adapter Architecture

Application layer manages query differences, Protocol layer manages communication differences

Use different levels of API to solve different levels of problems — respect and manage data source differences.

Dual-Layer Adapter Architecture

Quick Start

Add the core library and your JDBC driver; the example uses the latest release

pom.xml
<dependency>
  <groupId>net.hasor</groupId>
  <artifactId>dbvisitor</artifactId>
  <version>6.8.2</version>
</dependency>

Join the Community

Share your experience, report issues, and help improve dbVisitor.