3.2 Plain Java Projects
“Plain Java project” means a project without any framework or container—just a simple Java app.
Tip
dbVisitor integrates well with any Java project, including Spring Boot and Quarkus, so you can also create dbVisitor entry points manually in those projects.
Dependencies
See Add Dependency for dependency configuration.
the dependency, guide version: 6.8.2
Maven dependencies
<dependency>
<groupId>net.hasor</groupId>
<artifactId>dbvisitor</artifactId>
<version>6.8.2</version>
</dependency>
How to use
To use dbVisitor in a plain project, just provide a DataSource or Connection.
Create common entry points
DataSource dataSource = ...;
JdbcTemplate jdbc = new JdbcTemplate(dataSource);
Configuration config = new Configuration();
Session session = config.newSession(dataSource);
LambdaTemplate lambda = new LambdaTemplate(dataSource);
dbVisitor APIs you can choose from:
- Use raw SQL via the Programmatic API.
- Use the unified Builder API across supported databases.
- Organize data access as Java interfaces via the Mapper API, including BaseMapper CRUD methods.
- Use Mapper File to centrally manage SQL.