Ibatis sqlclient provides "statement" tag to create table in dynamic. "Statement" tag are used in various way.
<ibatis xml file>
<?xml version="1.0" encoding="EUC-KR" standalone="no"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="com.google.collector.test">
<statement id="createJavabasic" parameterClass="map" >
CREATE TABLE exam_$tableid$ (
logid int(11) NOT NULL auto_increment primary key,
projectname varchar(30),
disttype varchar(7),
contents longtext,
isSuccess char(1)
);
</statement>
<statement id="dropJavabasic" parameterClass="map" >
DROP TABLE IF EXISTS exam_$tableid$;
</statement>
</sqlMap>
<java code>
Map<String, String> map = new HashMap<String, String>();
map.put("tableid", "test");
sqlMap.queryForObject("com.google.com.test.createJavabasic", map);
'DB' 카테고리의 다른 글
오라클 Fast Connection Failover (0) | 2009.04.22 |
---|---|
checkng(or seeing) oracle jdbc driver(ojdbc.jar) version (0) | 2009.04.22 |
오라클 10g jdbc driver 특징 중 Fast Connection Fail-Over (0) | 2009.04.10 |
오라클 메가진 (0) | 2009.04.09 |
오라클의 Soft parsing, Hard pasring (2) | 2009.03.26 |