1: …… 2: public class U9102 implements ContactDAO { 3: public List listContacts() { 4: PersistenceManager pm = getPersistenceManagerFactory().getPersistenceManager(); 5: String query = "select from " + Contact.class.getName(); 6: try { 7: Properties props = new Properties(); 8: String fileName = "contacts.txt"; 9: FileInputStream in = new FileInputStream(fileName); 10: if( in != null ) { props.load(in); } 11: in.close(); 12: // 외부로 부터 입력을 받는다 13: String name = props.getProperty("name"); 14: if( name != null ) { 15: query += " where name = '" + name + " '" ; 16: } 17: } catch (IOException e) { …… } 18: 19: // 와부 입력값이 JDO 객체의 인자로 사용된다. 20: return (List) pm.newQuery(query).execute(); 21: } 22: ……