https://repo1.maven.org/maven2/com/alibaba/druid/1.1.10/
@Test
public void test01() throws Exception {
Properties properties = new Properties();
properties.load(new FileInputStream("src\\druid.properties"));
DataSource dataSource = DruidDataSourceFactory.createDataSource(properties);
Connection connection = dataSource.getConnection();
System.out.println(connection);
}
配置文件druid.properties
driverClassName=com.mysql.cj.jdbc.Driver
username=root
password=root
url=jdbc:mysql://localhost:3306/practice?rewriteBatchedStatements=true
initialSize=10
minIdle=5
maxActive=50
maxWait=5000