use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalTabelDaoShardByTableMySqlTest method tearDown.
@After
public void tearDown() throws Exception {
String sql = "DELETE FROM " + TABLE_NAME;
StatementParameters parameters = new StatementParameters();
DalHints hints = new DalHints();
try {
for (int i = 0; i < mod; i++) {
clientMySql.update(sql + "_" + i, parameters, hints);
}
} catch (SQLException e) {
e.printStackTrace();
fail();
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalTableDaoShardByDbOracleTest method tearDown.
@After
public void tearDown() throws Exception {
String sql = "DELETE FROM " + TABLE_NAME;
StatementParameters parameters = new StatementParameters();
DalHints hints = new DalHints();
try {
for (int i = 0; i < mod; i++) {
client.update(sql, parameters, hints.inShard(i));
}
} catch (SQLException e) {
e.printStackTrace();
fail();
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalTableDaoShardByDbSqlSvrTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws Exception {
DalClientFactory.initClientFactory();
clientSqlSvr = DalClientFactory.getClient(DATABASE_NAME_SQLSVR);
DalHints hints = new DalHints();
String[] sqls = null;
// For SQL server
hints = new DalHints();
StatementParameters parameters = new StatementParameters();
for (int i = 0; i < mod; i++) {
sqls = new String[] { DROP_TABLE_SQL_SQLSVR_TPL, CREATE_TABLE_SQL_SQLSVR_TPL };
for (int j = 0; j < sqls.length; j++) {
clientSqlSvr.update(sqls[j], parameters, hints.inShard(i));
}
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalTableDaoShardByDbSqlSvrTest method tearDownAfterClass.
@AfterClass
public static void tearDownAfterClass() throws Exception {
DalHints hints = new DalHints();
String[] sqls = null;
//For Sql Server
hints = new DalHints();
StatementParameters parameters = new StatementParameters();
for (int i = 0; i < mod; i++) {
clientSqlSvr.update(DROP_TABLE_SQL_SQLSVR_TPL, parameters, hints.inShard(i));
}
}
use of com.ctrip.platform.dal.dao.StatementParameters in project dal by ctripcorp.
the class DalQueryDaoTest method queryForObjectInAllShard.
//////////////////////////////////////////////////////////////////////////////
// QueryForObject Tests
//////////////////////////////////////////////////////////////////////////////
/**
* The template method under test
* @throws SQLException
*/
private ClientTestModel queryForObjectInAllShard(DalHints hints) throws SQLException {
StatementParameters parameters = new StatementParameters();
parameters.set(1, 1);
return dao.queryForObject(sqlObject, parameters, hints.inAllShards(), new ClientTestDalRowMapper());
}
Aggregations