Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- join
- update
- 이미지가로길이
- injection
- SPLIT
- tempDB
- sql업데이트
- MSSQL보안
- sql순위
- javascript 한글입력체크
- jdbc driver
- 정규식
- instr
- xmldom
- WML
- inner join
- 이미지세로길이
- 인젝션
- XML
- wap
- FileSystemObject
- 자바기초
- VarType
- sql랭킹
- array
- 한글입력체크
- JavaScript
- ERD
- asp함수
- VARIABLE
Archives
- Today
- Total
3초기억력
Spring) gradle, mybatis mapper.xml 에서 like 쿼리시 주의점 본문
1. Oracle 11g xe : project[EMP]
- build.gradle
dependencies {
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.4'
runtimeOnly 'com.oracle.database.jdbc:ojdbc8'
}
- application.properties
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe
spring.datasource.username=scott
spring.datasource.password=tiger
- EmpMapper.xml
<mapper namespace="com.devtory.emp.dao.EmpDao">
<select id="empList" resultType="com.devtory.emp.vo.Emp" parameterType="com.devtory.emp.vo.Emp">
select * from emp where ename like '%'||#{ename}||'%' and job like '%'||#{job}||'%'
</select>
</mapper>
2. MySql 5.5 : project[gusto]
- build.gradle
dependencies {
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.4'
runtimeOnly 'mysql:mysql-connector-java'
}
- application.properties
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/gusto?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
spring.datasource.username=userid
spring.datasource.password=userpw
- BlogMapper.xml
<mapper namespace="com.devtory.emp.dao.EmpDao">
<select id="empList" resultType="com.devtory.emp.vo.Emp" parameterType="com.devtory.emp.vo.Emp">
select * from blog
where title like CONCAT('%', #{title}, '%')
and short_description like CONCAT('%', #short_description}, %')
</select>
</mapper>
'자바_Spring' 카테고리의 다른 글
intro.jsp 생성 및 서버 설치 (0) | 2021.03.02 |
---|---|
첫 프로젝트 생성하기 (0) | 2021.03.02 |
이클립스 설정 (0) | 2021.03.02 |
자바 설치 및 이클립스 설치 (0) | 2021.03.02 |
Comments