テキストファイルからドメインを取得し、それを1つずつクエリに渡します。初めてクエリが正常に実行されていますが、2番目のドメインを取得してクエリに渡すと、「ORA-00933:SQLコマンドが正しく終了していません」というエラーが発生します。以下はコードです。
sql.append("select person_org_id,profile_type_id as NEXUS, profile_option_id,profile_option_value  from TABLE1 ");
            sql.append(" where profile_type_id=1 and person_org_id in (select person_org_id from TABLE2 where ");
            sql.append(" account_id in (select account_id from TABLE3 where prod_id=10001 and prod_inst_name = ?)) ");
            ps = con.prepareStatement(sql.toString());
            System.out.println("----------checkpoint -----------");
            ps.setString(1,domain_name);
            System.out.println("----------checkpoint 4-----------");
            rs= ps.executeQuery();
            System.out.println("----------checkpoint 5-----------");