Skip to content

can spring-boot support druid connection pool #2301

Closed
@luffyke

Description

@luffyke

i have found from the document, and seems that spring-boot only support tomcat-jdbc,HikariCP and DBCP connection pool, if i want to use druid(https://github.com/alibaba/druid/wiki/FAQ) in my project with spring-boot, may i know how to do?

Activity

philwebb

philwebb commented on Jan 7, 2015

@philwebb
Member

This kind of question is best asked on stackoverflow.com (use the spring-boot tag).

We don't currently offer any auto-configuration support for druid, but you should be able to configure directly as you would any other Spring Bean. Probably something like this:

@Bean
public DruidDataSource dataSource() {
    DruidDataSource ds = new DruidDataSource();
    ds.setUrl(...);
    ds.setUserName(...);
    ds.setPassword(...);
    // any other configuration
    return ds;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.com

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @philwebb@luffyke

        Issue actions

          can spring-boot support druid connection pool · Issue #2301 · spring-projects/spring-boot