Monday 17 March 2014

Changing Date Fomat Conversion

Hi ,Use the below method to change the date format of expected date format..
\public class TimeFormat{
  
     public Calendar ConvertToCalenderFormat(String stringInstanceRepresentingDate,String Format){
               Calendar cal  = null;
           try{
               if(stringInstanceRepresentingDate!=null && !stringInstanceRepresentingDate.equalsIgnoreCase("")){
               DateFormat df = new SimpleDateFormat(Format);
                   cal  = Calendar.getInstance();
               cal.setTime(df.parse(stringInstanceRepresentingDate));
               System.out.println(cal.getTime());
               }
           }
               catch(Exception e){
                           
                              e.printStackTrace();
                              }
             
       return cal;

         
           }
     
       public String formatCalender(Calendar cal,String Formater){
          SimpleDateFormat format1 = new SimpleDateFormat(Formater);
          String formatted = format1.format(cal.getTime());
          return formatted;
       
       }
     
       public static String covnertToDateFormat(String date)
       {
         
           Calendar cal=this.ConvertToCalenderFormat(date, "yyyy-MM-dd");
           return this.formatCalender(cal, "dd/MM/yyyy");
         
         
        }
     
}
}

Saturday 15 March 2014

Query Panel Bind Variable Value Can be getting using a below process

        DCBindingContainer bindings;
                bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                DCIteratorBinding dcIteratorBindings =
                    bindings.findIteratorBinding("IteratorName");
           date = "" + (dcIteratorBindings.getViewObject().getNamedWhereClauseParam("Bindingparametername"));

             

Batch scheduling in weblogic

Hi Every one today i have time to explain about BatchProcess in WebLogic we need to perform following steps
=>Create java class as follows....
public class SchedulerStartupServlet extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html; charset=UTF-8";

    public void init(ServletConfig config) throws ServletException {          
        super.init(config);
     
    }
   
    public void startScheduler(ServletConfig config) {

        try {
         
         String cronexp = "0 0 21 1/1 * ? *";    //this cron expression will be set at 9pm if any other timings go //www.cronmaker.com it will generate the cronexps.
         


            JobDetail job =
                JobBuilder.newJob(ADF.class).withIdentity("ADFJob", "ADFGroupOne").build();
         
            Trigger trigger =
                TriggerBuilder.newTrigger().withIdentity("ADFTrigger", "ADFTriggerGroupOne").withSchedule(CronScheduleBuilder.cronSchedule(cronexp)).build();
       
           
            Scheduler scheduler = new StdSchedulerFactory().getScheduler();
            scheduler.start();
            scheduler.scheduleJob(job, trigger);
              } catch (SchedulerException se) {
            se.printStackTrace();
        }
    }
}
==>create one more java class as follows.
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class ADF implements Job {
    public ADF() {
        super();
    }

    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            this.JobSheetProcessing();
        } catch (Exceptions e) {
            e.printStackTrace();
        }
    }

    public void JobSheetProcessing() throws Exceptions{
       //write your logic to call or run  the batchjob
     
               }
}

==>The following jar are required
->c3p0-0.9.1.1.jar
->log4j-1.2.16.jar
->quartz-2.2.1.jar
->quartz-jobs-2.2.1.jar
->slf4j-api-1.6.6.jar
->slf4j-log4j12-1.6.6.jar
download add to libraries and class path of the view controller run the project.........