게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
찾다가 도저히 실력이 딸려서 질문드립니다.
게시물ID : programmer_14772짧은주소 복사하기
작성자 : 맞다!
추천 : 0
조회수 : 623회
댓글수 : 15개
등록시간 : 2015/12/03 22:09:33
옵션
  • 본인삭제금지
public CustomVO ClickCustomcu(String custom_name){
StringBuffer tml = new StringBuffer();
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
CustomVO retval = null;
tml.append("select busi_num,"
+ "custom_name,"
+ "short_name,"
+ "ceo,"
+ "charge_person,busi_condition,"
+ "item,"
+ "post_num,"
+ "addr1,"
+ "addr2,"
+ "tel,"
+ "fax,"
+ "homepage,"
+ "co_yn,"
+ "foreign_yn,"
+ "tax_yn,"
+ "country_eng,"
+ "country_kor,"
+ "special_relation,"
+ "trade_stop,"
+ "contract_period_s,"
+ "contract_period_e,"
+ "regi_info_man,"
+ "regi_info_date,"
+ "modi_info_man,"
+ "modi_info_date");
tml.append(" from custom where custom_name LIKE ?||'%'");
try {
con = DBUtil.getConnection();
pstmt = con.prepareCall(tml.toString()); // 1개 레코드만 반환(중복된 이름이 저장된
// 경우)
pstmt.setString(1, custom_name);
rs = pstmt.executeQuery();
if (rs.next()) {
logger.info(rs.getString("busi_num"));
logger.info(rs.getString("regi_info_date").toString());
retval = new CustomVO(rs.getString("busi_num") //"no" 대신 1로 해도 된다.
,rs.getString("custom_name")//위에 select한 순서대로 번호 매겨도 된다.   
,rs.getString("short_name")
,rs.getString("ceo")
,rs.getString("charge_person")
,rs.getString("busi_condition")
,rs.getString("item")
,rs.getString("post_num")
,rs.getString("addr1")
,rs.getString("addr2")
,rs.getString("tel")
,rs.getString("fax")
,rs.getString("homepage")
,rs.getInt("co_yn")
,rs.getInt("foreign_yn")
,rs.getInt("tax_yn")
,rs.getString("country_eng")
,rs.getString("country_kor")
,rs.getInt("special_relation")
,rs.getInt("trade_stop")
,rs.getString("contract_period_s").substring(0, 10)
,rs.getString("contract_period_e")
,rs.getString("regi_info_man")
,rs.getString("regi_info_date")
,rs.getString("modi_info_man")
,rs.getString("modi_info_date")
);
}
logger.info(retval);
} catch (SQLException se) {
System.out.println("se=[" + se + "]");
} catch (Exception e) {
System.out.println("e=[" + e + "]");
} finally {
try {
if (rs != null)
rs.close();
if (pstmt != null)
pstmt.close();
if (con != null)
con.close();
} catch (SQLException se) {
System.out.println("se=[" + se + "]");
}
}
return retval;
}

여기에서 retval이 계속 널이 떨어지는데 도대체 원인을 찾을 수가 없습니다.

rs.getString값들은 다 잘 넘어옵니다.. 저 retval에 값이 안담기는데 이건 왜 그런건지 도저히 이해가 안됩니다...
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호