mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
39 lines
866 B
Java
39 lines
866 B
Java
package com.alibaba.druid.pool.oceanbase;
|
|
|
|
import java.sql.Connection;
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
import com.alibaba.druid.pool.DruidDataSource;
|
|
|
|
public class OBTest extends TestCase {
|
|
|
|
private DruidDataSource dataSource;
|
|
|
|
protected void setUp() throws Exception {
|
|
dataSource = new DruidDataSource();
|
|
dataSource.setUrl("jdbc:mysql://10.232.36.171:45447/");
|
|
dataSource.setUsername("admin");
|
|
dataSource.setPassword("admin");
|
|
dataSource.setFilters("log4j");
|
|
}
|
|
|
|
public void test_connect() throws Exception {
|
|
{
|
|
Connection conn = dataSource.getConnection();
|
|
|
|
conn.setAutoCommit(false);
|
|
|
|
conn.close();
|
|
}
|
|
{
|
|
Connection conn = dataSource.getConnection();
|
|
|
|
conn.setAutoCommit(true);
|
|
|
|
conn.close();
|
|
}
|
|
}
|
|
|
|
}
|