Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- 단축키
- maVen
- Quartz
- profile
- Eclipse
- JavaScript
- web.xml
- bash
- 네트워크
- Windows 10
- lsof
- vscode
- Mac
- plugin
- GIT
- VirtualBox
- port
- import
- xargs
- tomcat
- netsh
- Windows
- ssh
- 줄바꿈 문자
- context
- resource
- IntelliJ
- grep
- Source
- find
Archives
- Today
- Total
develog
iBatis, MySQL insert 후 insert Id 가져오기 본문
- TEST1 테이블의 Primary Key 컬럼명은 SEQ
- SEQ 컬럼은 AUTO_INCREMENT 사용중
- iBatis
<insert id="insTest" parameterClass="HashMap"> INSERT INTO TEST1 (TITLE) VALUES (#TITLE#) <selectKey keyProperty="SEQ" resultClass="Integer"> SELECT LAST_INSERT_ID() </selectKey> </insert> |
- Java
Map<String, Object> map = new HashMap<String, Object>(); map.put("TITLE", title); int insertId = (Integer) sqlMapClient.insert("TestMap.insTest", map); System.out.println("insertId : " + insertId); |
'DB > MySQL' 카테고리의 다른 글
| MySql, SQL Error (1267): Illegal mix of collations (0) | 2014.04.05 |
|---|---|
| MySql CharSet 관련 (0) | 2014.04.05 |
| [MySql] Transaction Test (0) | 2013.12.12 |
| [MySql] CREATE TABLE ENGINE (0) | 2013.12.12 |
| MySQL insert 시 한글 깨질 때 해결방법 (0) | 2013.12.12 |
Comments