JDBC에서 like 문 사용 방법은?

by 별솔아범 posted Mar 01, 2011

java프로그램에서 like문을 사용하면 아래와 같은 오류메세지가 나옵니다.

 

  query = "select *    from t_addr where t_name like   ?    ;";
   
   stmt = conn.createStatement();
   pstmt = conn.prepareStatement(query);
    String in_d = jtf_name.getText();
      in_d = in_d+"%";
         pstmt.setString(1, in_d);
      
     
   ResultSet rs = stmt.executeQuery(query);

 

오류메세지 : Attempt to execute the query when not all the parameters are binded

사용 방법을 알려 주세요...


Articles

13 14 15 16 17 18 19 20 21 22