Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.JdbcTemplate.queryForInt()


    String configName = dbType;
    String testSql = TAtomDataSourceUnitTest.TEST_SQL;
    ;
    TAtomDataSource tAtomDataSource = createTAtomDataSource(appName, dbKey, configName);
    JdbcTemplate jtp = new JdbcTemplate(tAtomDataSource);
    int actual = jtp.queryForInt(testSql);
    Assert.assertEquals(actual, 1);
    //���ô����IP��������
    String fileName = "";
    String dataId = "";
    if (type.equals("globa")) {
View Full Code Here


    MockServer.setConfigInfo(dataId, PropLoadTestUtil.convertProp2Str(change.doChange(prop)));
    Thread.sleep(3000);
    //�ڴ����ִ���
    boolean result = false;
    try {
      actual = jtp.queryForInt(testSql);
    } catch (Throwable e) {
      result = true;
    }
    Assert.assertTrue(result);
    MockServer.setConfigInfo(
View Full Code Here

        dataId,
        PropLoadTestUtil.convertProp2Str(restore.doChange(PropLoadTestUtil.loadPropFromFile("conf/"
            + configName + fileName))));
    Thread.sleep(3000);
    //�ڴ��������
    actual = jtp.queryForInt(testSql);
    Assert.assertEquals(actual, 1);
    tAtomDataSource.destroyDataSource();
  }

  private TAtomDataSource createTAtomDataSource(String appName, String dbKey, String configName) throws IOException,
View Full Code Here

    dataSource.setMaxPoolSize(2);
    //��ʼ��
    dataSource.init();
    JdbcTemplate jtp = new JdbcTemplate();
    jtp.setDataSource(dataSource);
    int actual = jtp.queryForInt("select 1 from dual");
    Assert.assertEquals(actual, 1);
    dataSource.destroyDataSource();
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.