게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
(본삭금) JSP 프로그래밍 질문이 있어서 올립니다
게시물ID : programmer_9972짧은주소 복사하기
작성자 : 자바돌이
추천 : 0
조회수 : 642회
댓글수 : 11개
등록시간 : 2015/05/13 03:19:11
옵션
  • 본인삭제금지
pstmt = conn.prepareStatement("insert into article "
+ "(group_id, sequence_no, posting_date, read_count, reply_count, "
+ "writer_name, password, title, content) "
+ "values (?, ?, ?, 0, 0, ?, ?, ?, ?)");
pstmt.setInt(1, article.getGroupId());
pstmt.setString(2, article.getSequenceNumber());
pstmt.setTimestamp(3, new Timestamp(article.getPostingDate()
.getTime()));
pstmt.setString(4, article.getWriterName());
pstmt.setString(5, article.getPassword());
pstmt.setString(6, article.getTitle());
pstmt.setString(7, article.getContent());
int insertedCount = pstmt.executeUpdate();


위 소스를 실행하면

Caused by: java.sql.SQLException: Field 'reply_count' doesn't have a default value

오류가 발생합니다 

create table article (

article_id int not null auto_increment,

group_id int not null,

sequence_no char(16) not null,

posting_date datetime not null,

read_count int not null,

     reply_count int not null,

writer_name varchar(20) not null,

password varchar(10),

title varchar(100),

content text,

primary key (article_id),

index (sequence_no)

) default character set = euckr;

이게 테이블 만드는 쿼리문이구요

도저히 왜 이런 에러 메시지가 뜨는지 이해가 안갑니다
고수님들 도와주시면 감사하겠습니다
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호