Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exceute Select Query Programmatically in ADF

3207084Sep 20 2017 — edited Sep 21 2017

Hi All,

I am using jdev 11.1.1.7.1

On schedule basis i need to find the rows  based on some filter.. I am using cron4j scheduler.. In that i am unable to filter based on VO's.So I tried to execute with query statement.In that I can able to retrieve only single record.. Kindly help me on this

My Code

            String amDef = "model.AppModuleImpl";
                     String config = "AppModuleLocal";
                   ApplicationModule ami = Configuration.createRootApplicationModule(amDef, config);
                   AppModuleImpl am = (AppModuleImpl)ami;
        System.out.println("Run method new");
        String place="Select * from ALMB_AD_SALARYADVANCE where LOANMONTHS='No'";
                 DBTransaction trans=am.getDBTransaction();
        ResultSet rs;
        int i=0;
                            String tablevalues="";      
                        
        try {
                        rs = trans.createStatement(0).executeQuery(place);
                       System.out.println("trans- count- new-");
              if (rs.next()) {
                
                 System.out.println("--count-"+i);
                 i++;
                           String claimno = ""+rs.getString(1);
                            String Leavestartdate=""+rs.getString(9);
                           Leavestartdate=Leavestartdate.substring(0,10);
                                       String personnoforpay=""+rs.getString(2);
                                       String assignno=""+rs.getString(35);
                                       String tota1l=""+rs.getString(12);
                                       String Leaveenddate=""+rs.getString(10);
                                        Leaveenddate=Leaveenddate.substring(0,10);
                                       String GrossSalary=""+rs.getString(22);
                                       String PensionDeduction=""+rs.getString(23);
                                       String PersLoanDeduct=""+rs.getString(24);
                                       String RentLoanDeduct=""+rs.getString(25);
                                       String HomeMortDedct=""+rs.getString(27);
                                       String CreditCardDedct=""+rs.getString(28);
                                       String NoMonths=""+rs.getString(11);
                                       String CarLoanDeduct=""+rs.getString(26);
                                       String total="Element Entry|Create Element Entry|Advance Salary|"+Leavestartdate+"|"+"|"+personnoforpay+"|"+assignno+"|"+"|"+"|"+"|"+"|"+"|"+"|"+tota1l+"|"+"|"+Leavestartdate+"|"+Leaveenddate+"|"+GrossSalary+"|"+PensionDeduction+"|"+PersLoanDeduct+"|"+RentLoanDeduct+"|"+CarLoanDeduct+"|"+HomeMortDedct+"|"+CreditCardDedct+"|"+NoMonths+"|"+"|"+claimno+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|"+"|";
                                       tablevalues=tablevalues+"@"+total;
                       }
                   } catch (SQLException e) {
                       System.out.println("SQLException1"+e.getCause());
                   }    
      
        System.out.println("Proc called succes----"+tablevalues); 
This post has been answered by 3207084 on Sep 21 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2017
Added on Sep 20 2017
3 comments
547 views