목록iBatis (5)
특별한딸기이야기
sqlMap-test.xml insert into account(id, name, password, join, address, city, state, country, postcode, version) values (?, ?, ?, ?, ?, ?, ?, ?, ?) main class file Information info = new Information(); info.setId("special0strawberry"); ...//생략해도 알것이라 생각됨 sqlMapClient.insert("insertInline", info); //딱히 별 표시 없어도 알듯...
sqlMap-test.xml insert into account(id, name, password, join, address, city, state, country, postcode, version) values (#id:NUMBER#, #name:VARCHAR#, #password:VARCHAR#, #join:TIMESTAMP#, #address:VARCHAR#, #city:VARCHAR#, #state:VARCHAR#, #country:VARCHAR#, #postcode:VARCHAR#, #version:NUMBER#) main class file Information info = new Information(); info.setId("special0strawberry"); ...//생략해도 알것이라..
밑의 sqlMap-test.xml 파일에는 select id, username, password, firstname, lastname, address, city, state, country from member where id = #value# select id, username, password, firstname, lastname, address, city, state, country from member like '%$value$%' 메인 클래스 에서는 Member member = (Member)sqlMap.queryForObject("getIdValue", 1); // 그럼 1이라는 값이 #value#에 들어가서 결과를 리턴한다. List memberList = sqlMap.queryForList..
밑에서 제시한 sqlMap-test.xml select * from order select count(*) from order where id = carry where id = carry
메인 클래스 import java.io.Reader; import com.ibatis.common.resources.Resources; import com.ibatis.sqlmap.client.SqlMapClient; import com.ibatis.sqlmap.client.SqlMapClientBuilder; public class ibatisTest { public static void main(String[] args) { SqlMapClient sqlMap = null; try { String resource = "SqlMapConfig.xml"; Reader reader = Resources.getResourceAsReader(resource); sqlMap = SqlMapClientBuilde..