测试的SQL
create trigger testxxa after insert on zima_ for each row
begin -- 修正lonlat值,以lonlatWKT值为准 declare fid bigint default 0;begin set fid=0;set fid=2; end; end
使用的测试
public class CreateTriggerTest extends TestCase {
ApplicationContext context;
@Override
public void setUp(){
context=new ClassPathXmlApplicationContext("trigger/create.xml");
}
@Override
public void tearDown(){
}
public void testCreate(){
JdbcTemplate template=(JdbcTemplate) context.getBean("jdbcTemplate");
String trigger="create trigger testxxa after insert on zima_stat for each row\nbegin\n-- 修正lonlat值,以lonlatWKT值为准\ndeclare fid bigint default 0;begin\nset fid=0;set fid=2;end;end";
template.execute(trigger);
}
}
使用的配置
classpath*:monitor/jdbc.properties