검색결과 리스트
DataBase/MySql에 해당되는 글 5건
- 2019.01.09 java.sql.SQLException: No value specified for parameter 3
- 2018.11.23 [mysql] select 한것 update하기
- 2018.10.30 mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index:
- 2015.05.26 2. mysql process 상태 리스트 보기
- 2015.05.12 1. 테이블 복사하기
글
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
해당 에러는 scala + mysql에서 insert + update를 하고자할 때 났다.
쿼리 스트링은 아래와 같다.
val insertSql =
"""
|insert into 테이블 (name, age )
|values (?,?)
|ON DUPLICATE KEY UPDATE name = ?, age =?
""".stripMargin
java.sql.SQLException: No value specified for parameter 3
에러는 아래에서 코드가 추가되지 않아서였다.
targetList.foreach {
t =>
val name = t._1
val age = t._2
if (age > 20){
insertStmt.setString(1, name)
insertStmt.setInt(2, age)
insertStmt.addBatch()
insertStmt.clearParameters()
}
}
insertStmt.executeBatch()
insertStmt.close()
connection.close()
즉, 2번째 ? 까지는 채워졌는데 3,4 번째 ?는 채워지지 않아서 이다.
그러므로 insertStmt.setString(3, name)와 insertStmt.setInt(4, age)가 필요하다.
- END
'DataBase > MySql' 카테고리의 다른 글
java.sql.SQLException: No value specified for parameter 3 (0) | 2019.01.09 |
---|---|
[mysql] select 한것 update하기 (0) | 2018.11.23 |
mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index: (0) | 2018.10.30 |
2. mysql process 상태 리스트 보기 (0) | 2015.05.26 |
1. 테이블 복사하기 (0) | 2015.05.12 |
글
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
Mysql에서~
SELECT 를 하여 원하는 테이블의 필드에 데이터를 채우고자 했다.
같은 테이블일 경우
UPDATE 테이블명
SET 데이터 들어갈 필드 = 데이터있는필드
WHERE 조건문 블라블라
다른 테이블일 경우
UDATE 테이블1, 테이블2
SET 테이블1.필드 = 테이블2.필드
WHERE 조건문 블라블라
작업전엔~SELECT로 확인 후 작업이 센스~
'DataBase > MySql' 카테고리의 다른 글
java.sql.SQLException: No value specified for parameter 3 (0) | 2019.01.09 |
---|---|
[mysql] select 한것 update하기 (0) | 2018.11.23 |
mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index: (0) | 2018.10.30 |
2. mysql process 상태 리스트 보기 (0) | 2015.05.26 |
1. 테이블 복사하기 (0) | 2015.05.12 |
글
mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index:
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
error
Lock wait timeout exceeded; try restarting transaction: Timeout on record in index:
solution
show processlist;
kill <process id>;
'DataBase > MySql' 카테고리의 다른 글
java.sql.SQLException: No value specified for parameter 3 (0) | 2019.01.09 |
---|---|
[mysql] select 한것 update하기 (0) | 2018.11.23 |
mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index: (0) | 2018.10.30 |
2. mysql process 상태 리스트 보기 (0) | 2015.05.26 |
1. 테이블 복사하기 (0) | 2015.05.12 |
글
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
리스트 보기
SHOW PROCESSLIST;
해당 프로세스 죽이기
KILL 프로세스 번호(ID)
'DataBase > MySql' 카테고리의 다른 글
java.sql.SQLException: No value specified for parameter 3 (0) | 2019.01.09 |
---|---|
[mysql] select 한것 update하기 (0) | 2018.11.23 |
mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index: (0) | 2018.10.30 |
2. mysql process 상태 리스트 보기 (0) | 2015.05.26 |
1. 테이블 복사하기 (0) | 2015.05.12 |
글
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T
몇년만에 db를 만져보는거 같다ㅋㅋㅋ;;
작업을 위해 백업 테이블을 만들자!
1. 테이블 복사! gogo~!
CREATE TABLE [생성할 테이블] SELECT * FROM [원본테이블]
2. 검증
SELECT * FROM [생성된 테이블] LIMIT 100
- 끝 -
'DataBase > MySql' 카테고리의 다른 글
java.sql.SQLException: No value specified for parameter 3 (0) | 2019.01.09 |
---|---|
[mysql] select 한것 update하기 (0) | 2018.11.23 |
mysql Lock wait timeout exceeded; try restarting transaction: Timeout on record in index: (0) | 2018.10.30 |
2. mysql process 상태 리스트 보기 (0) | 2015.05.26 |
1. 테이블 복사하기 (0) | 2015.05.12 |