Ejemplo n.º 1
0
  public void test_change_connectProperties_2() throws Exception {
    DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);

    conn.close();

    dataSource.setConnectionProperties("x=12;;");
  }
Ejemplo n.º 2
0
  public void test_setConnectionProperties() throws Exception {
    dataSource.setConnectionProperties(null);
    dataSource.setLogWriter(null);
    dataSource.getLogWriter();

    DruidPooledConnection conn = dataSource.getConnection().unwrap(DruidPooledConnection.class);

    conn.close();
  }
  public void test_connect() throws Exception {
    {
      Connection conn = dataSource.getConnection();
      conn.close();
    }

    MySqlValidConnectionChecker checker =
        (MySqlValidConnectionChecker) dataSource.getValidConnectionChecker();
    Assert.assertFalse(checker.isUsePingMethod());

    dataSource.setConnectionProperties("druid.mysql.usePingMethod=true");

    Assert.assertTrue(checker.isUsePingMethod());

    Connection conn = dataSource.getConnection();
    conn.close();
  }