1: …… 2: public void listHoney() { 3: Session session = new Configuration().configure().buildSessionFactory().openSession(); 4: try { 5: Properties props = new Properties(); 6: String fileName = "Hibernate.properties"; 7: FileInputStream in = new FileInputStream(fileName); 8: if (in == null || in.available() <= 0) return; 9: props.load(in); 10: …… 11: // 외부로 부터 입력을 받는다. 12: String idValue = props.getProperty("idLow"); 13: // 입력값에 대한 유효성을 검사한다. 14: if (idValue == null || " " .equals(idValue)) idValue = "defaultID"; 15: // SQL query 문장을 작성한다. 16: Query query = session.createSQLQuery("select h from Honey as h where h.id '= :idVal‘"); 17: query.setParameter(" idVal", idValue); 18: query.list(); 19: } catch (IOException e) { …… } 20: ……