Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hiwepy/p6spy-spring-boot-starter

spring-boot-starter-p6spy
https://github.com/hiwepy/p6spy-spring-boot-starter

Last synced: 23 days ago
JSON representation

spring-boot-starter-p6spy

Awesome Lists containing this project

README

        

# p6spy-spring-boot-starter
p6spy starter for spring boot

### 说明

> 基于 p6spy 的 Spring Boot Starter 实现

### Maven

``` xml

com.github.hiwepy
p6spy-spring-boot-starter
${project.version}

```

### Sample

```java

import javax.sql.DataSource;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import com.p6spy.engine.spy.P6DriverManagerDataSource;
import com.p6spy.spring.boot.ext.P6spyDataSource;

@EnableP6Spy
@SpringBootApplication
public class Application {

@Bean
@P6spyDataSource
DataSource dataSource() {

// just demo
P6DriverManagerDataSource ds = new P6DriverManagerDataSource();
ds.setUrl("url");
ds.setUser("username");
ds.setPassword("password");

return ds;
};

public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}

}

```