»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

ÀÚ¹Ù¿¡¼­ SQL °ü·Ã ¿À·ù Áú¹®µå¸³´Ï´Ù ¤Ð6

  • ModernLife
  • µî·ÏÀÏ 2018-04-10 13:09
  • Á¶È¸¼ö 499

sql¹®¿¡¼­ ³ë¶õ»öÀ¸·Î Á¶°Ç¹®À» Ãß°¡Çϸé bbs.setDaft_date(rs.getString(2)); ¿¡¼­ ¿À·ù°¡ ³³´Ï´Ù.

³ë¶õ»öºÎºÐ »©¸é Á¤»óÀÛµ¿Çϱ¸¿ä ¤Ð¤Ð ´Ü¼øÇÑ Á¶°Ç¹® °°Àºµ¥ ¿Ö ¿À·ù°¡ ³ª´ÂÁö ¸ð¸£°Ú½À´Ï´Ù. ¤Ð¤Ð

"java.sql.SQLException: JZ008: 2Àº(´Â) À߸øµÈ ¿­ À妽º °ªÀÔ´Ï´Ù." ÀÌ·±¿À·ù°¡ ¹ß»ýÇÕ´Ï´Ù ¤Ð

jsp¿¡¼­ javaºÎºÐ µð¹ö±ëµµ °¡´ÉÇÑ°¡¿ä ?

   
      public ArrayList<Bbs>getlist(String custCode,int pageNumber){
   
       
   String sql ="select top 10 row_no, convert(char(8),draft_date,112), right('00' + convert(varchar(2), draft_no), 2) , cust_code from order_draft where draft_date is not null and cust_code = ? and row_no < ? group by draft_date, draft_no, cust_code  order by row_no desc, draft_date desc, draft_no desc";
    ArrayList<Bbs> datalist =newArrayList<Bbs>();try{
	pstmt = conn.prepareStatement(sql);
	pstmt.setString(1, custCode);
	pstmt.setInt(2,getNext(custCode)-(pageNumber - 1)* 10);
	rs = pstmt.executeQuery();while(rs.next()){
        	Bbs bbs =newBbs();
		bbs.setRow_no(rs.getInt(1));
		bbs.setDaft_date(rs.getString(2));
		bbs.setDaft_no(rs.getString(3));
		bbs.setCust_code(rs.getString(4));
		datalist.add(bbs);}}catch(Exception e){
     	   e.printStackTrace();}return datalist;}

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 º½-º½

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ModernLife

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 º½-º½

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ModernLife

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¾ÊÀ̾ÊÀÌ

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ModernLife
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â