Thursday, January 23, 2014

Oracle database connectivity with php configaration/setup file

1/ open http.conf file from apache tab
2/ in http.conf file uncomment  mod -rewrite.so
3/ open php.ini file from php tab
4/ in php.ini file uncomment extention = php-oci8.dll and extension = php-pdo-oci8.dll
5/ stop all services
6/ restart all services

Call Stored Procedure In Oracle And Pass In Out Parameters

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
  public static void main(String[] argsthrows Exception {
    Connection conn = getOracleConnection();
    // Step-2: identify the stored procedure
    String proc3StoredProcedure = "{ call proc3(?, ?, ?) }";
    // Step-3: prepare the callable statement
    CallableStatement cs = conn.prepareCall(proc3StoredProcedure);
    // Step-4: set input parameters ...
    // first input argument
    cs.setString(1"abcd");
    // third input argument
    cs.setInt(310);
    // Step-5: register output parameters ...
    cs.registerOutParameter(2, java.sql.Types.VARCHAR);
    cs.registerOutParameter(3, java.sql.Types.INTEGER);
    // Step-6: execute the stored procedures: proc3
    cs.execute();
    // Step-7: extract the output parameters
    // get parameter 2 as output
    String param2 = cs.getString(2);
    // get parameter 3 as output
    int param3 = cs.getInt(3);
    System.out.println("param2=" + param2);
    System.out.println("param3=" + param3);
    conn.close();
  }

  private static Connection getHSQLConnection() throws Exception {
    Class.forName("org.hsqldb.jdbcDriver");
    System.out.println("Driver Loaded.");
    String url = "jdbc:hsqldb:data/tutorial";
    return DriverManager.getConnection(url, "sa""");
  }

  public static Connection getMySqlConnection() throws Exception {
    String driver = "org.gjt.mm.mysql.Driver";
    String url = "jdbc:mysql://localhost/demo2s";
    String username = "oost";
    String password = "oost";

    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, username, password);
    return conn;
  }

  public static Connection getOracleConnection() throws Exception {
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbc:oracle:thin:@localhost:1521:caspian";
    String username = "mp";
    String password = "mp2";

    Class.forName(driver)// load Oracle driver
    Connection conn = DriverManager.getConnection(url, username, password);
    return conn;
  }
}



Java practice for self ( Parameter pass , static and non static , local , global )

java class file name ( printName.java): Run: on page R.B click - run on server

import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
         
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
     
     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
          
          // Following statement would create an object myPuppy
           printName myPuppy = new printName( );
           myPuppy.Puppy(kaniz);
          
           myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
        date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        System.out.println(date);
       
       }



    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}



Also follow it

import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
          Name("rokon");
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public static  void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
   
//     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
           printName myPuppy = new printName( );
          // Following statement would create an object myPuppy
         
           Puppy(kaniz);
           myPuppy. Name("rokon");
         //  myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
    Date date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        System.out.println(date);
       
       }

private static Date date = new Date();

    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}



newTestList.java

public class newTestList {

   
public int sum(int a,int b){
    int s = 0;
    s = a+b;
      System.out.println(s);
     
      printName.Puppy("owares");
      printName bas = new printName();
      bas.Name("iftekhar");
      return s;
}
   

public int sum(int a,int b,int c){
    int s= 0;
    s = a+b+c;
      System.out.println(s);
      return s;
}




   public static void main(String[] args) {
   
       
        newTestList p = new newTestList();
        p.sum  (10,20);
        p.sum  (10,20,50);
   
    }
   
   
   
   
   
   
}

3rd Step static and non static
printName.java
import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
          Name("rokon");
          Puppy("");
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }
   

      public static  String Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
          return "";
       }
 static void strat() {
   
 }
   
//     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
           printName myPuppy = new printName( );
           strat();
          // Following statement would create an object myPuppy
          System.out.println(printName.Puppy("pop"));
          System.out.println(Puppy("popppp"));
        //  printName.
        //   Puppy(kaniz);
        //   myPuppy. Name("rokon");
         //  myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
    Date date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        //System.out.println(date);
       
       }

private static Date date = new Date();

    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}


newTestList.java




public class newTestList {

   
public int sum(int a,int b){
    int s = 0;
    s = a+b;
      System.out.println(s);
   
      printName.Puppy("owares");
      printName bas = new printName();
      bas.Name("iftekhar");
      bas.Puppy("");
      bas.getDate();
      return s;
}
   

public int sum(int a,int b,int c){
    int s= 0;
    s = a+b+c;
      System.out.println(s);
      return s;
}




   public static void main(String[] args) {
   
       
        newTestList p = new newTestList();
        p.sum  (10,20);
        p.sum  (10,20,50);
   
    }
   
   
   
   
   
   
}




** java action class run and see output(printName.java)

public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
         
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
          
          // Following statement would create an object myPuppy
           printName myPuppy = new printName( );
           myPuppy.Puppy(kaniz);
          
           myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
       
       
       }
   




   
   
   
   
}



output
Passed(call by reference) Name is :null
Passed(value) Name is  op is double cotation kaniz:kaniz. I am string value.it is direct value pass
Passed(value) Name is :kanizZZ Passed(value) nameNext is : fatema
Passed(call by reference) Name k is :ghrg Passed(call by reference ) nameNext  f is : fatema mmm Passed ( direct vallue call) text  is :kkkkk Call by Reference Numbers : 100



**************************************************************************

Write a method to print out a string “Name” multiple times
==========================================================
System.out.println("name" + " " + "name" + " "...).


1/  "name"

2/  + " "

3/  + "name"

4/  + " "



update printName.java
import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
         
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
     
     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
          
          // Following statement would create an object myPuppy
           printName myPuppy = new printName( );
           myPuppy.Puppy(kaniz);
          
           myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
        date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        System.out.println(date);
       
       }



    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}

Model View Controller ( MVC )























************************************************************************
************************************************************************


# Struts 2 is an action-based presentation framework, the version 2 of the above (created from a merge of WebWork with Struts).
# Hibernate is an object-relational mapping tool, a persistence framework.

Oracle Query Date Calculation

1.



---SELECT---
DATE RANGE    DR
TODAY         TD
NEXT DAY      ND
7 DAYS        7D
15 DAYS       15D
30 DAYS       30D
THIS MONTH    TM
NEXT MOTH     NM


IF :CTRL_ROSTER.SCH_FR='DR' THEN
   :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
   :CTRL_ROSTER.TO_DATE:=NULL;
ELSIF :CTRL_ROSTER.SCH_FR='TD' THEN--TODAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='ND' THEN ----NEXT DAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE+1);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+1);
ELSIF :CTRL_ROSTER.SCH_FR='7D' THEN--7 DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+7);
ELSIF
  :CTRL_ROSTER.SCH_FR='15D' THEN--15DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+15);
ELSIF
  :CTRL_ROSTER.SCH_FR='30D' THEN --30DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+30);
ELSIF
  :CTRL_ROSTER.SCH_FR='TM' THEN--THIS MONTH
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=LAST_DAY(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='NM' THEN -- NEXT MONTH
    :CTRL_ROSTER.FROM_DT:=LAST_DAY(SYSDATE)+1;
    :CTRL_ROSTER.TO_DATE:=LAST_DAY(LAST_DAY(SYSDATE)+1);

END IF;
next_item;






2.



1st script
-------------
CREATE OR REPLACE Procedure PRC_DATECAL (pNoOfDays in Number,pThisMonth in varchar2,pNextMonth Varchar,pFrDate out date,pEnDate out Date)
     IS
     vDate Date;
     BEGIN
     if pNoOfDays is not null AND pThisMonth IS NULL and pNextMonth IS NULL then
     SELECT trunc(SYSDATE)
     INTO pFrDate
     FROM DUAL;
     SELECT trunc(SYSDATE+pNoOfDays)
     INTO pEnDate
     FROM DUAL;
     elsif  pNoOfDays is null AND pNextMonth IS NULL AND pThisMonth IS NOT NULL then
     SELECT trunc(SYSDATE)
     INTO pFrDate
     FROM DUAL;
     SELECT TRUNC(Last_Day(SYSDATE))
     INTO pEnDate
     FROM DUAL;
     elsif pNoOfDays is null AND pThisMonth IS NULL AND pNextMonth IS NOT NULL then
     SELECT TRUNC(Last_Day(SYSDATE)+1)
     INTO pFrDate
     FROM DUAL;
     SELECT TRUNC(LAST_DAY(Last_Day(SYSDATE)+1))
     INTO pEnDate
     FROM DUAL;
     end if;
   
exception when others then
null;
END;

PRC_DATECAL(










2nd Script
----------------------------
CREATE OR REPLACE FUNCTION FNC_DATECAL (pNoOfDays Number,p)
     RETURN date  IS
     vDate Date;
     BEGIN
     SELECT trunc(SYSDATE+pNoOfDays)
     INTO vDate
     FROM DUAL;
  return vDate;
END;
/





*********************************************************
Form plsql
............



---SELECT---
DATE RANGE    DR
TODAY         TD
NEXT DAY      ND
7 DAYS        7D
15 DAYS       15D
30 DAYS       30D
THIS MONTH    TM
NEXT MOTH     NM


IF :CTRL_ROSTER.SCH_FR='DR' THEN
   :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
   :CTRL_ROSTER.TO_DATE:=NULL;
ELSIF :CTRL_ROSTER.SCH_FR='TD' THEN--TODAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='ND' THEN ----NEXT DAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE+1);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+1);
ELSIF :CTRL_ROSTER.SCH_FR='7D' THEN--7 DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+7);
ELSIF
  :CTRL_ROSTER.SCH_FR='15D' THEN--15DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+15);
ELSIF
  :CTRL_ROSTER.SCH_FR='30D' THEN --30DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+30);
ELSIF
  :CTRL_ROSTER.SCH_FR='TM' THEN--THIS MONTH
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=LAST_DAY(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='NM' THEN -- NEXT MONTH
    :CTRL_ROSTER.FROM_DT:=LAST_DAY(SYSDATE)+1;
    :CTRL_ROSTER.TO_DATE:=LAST_DAY(LAST_DAY(SYSDATE)+1);

END IF;
next_item;




////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

CREATE OR REPLACE FUNCTION FNC_DATECAL (pNoOfDays Number,pLastDay varchar2)
     RETURN date  IS
     vDate Date;
     BEGIN
     if pNoOfDays is not null and pLastDay is null then
     SELECT trunc(SYSDATE+pNoOfDays)
     INTO vDate
     FROM DUAL;
     elsif pNoOfDays is null and pLastDay is not null then
     select trunc(last_day(sysdate))
     into vDate
     from dual;
     end if;
     /*
     Select trunc((sysdate)+pNoofMonth) into vDate
     from dual;
     */
  return vDate;
END;
/


select name,JOB_DESC
from hrv_empjobdetails
where emp_no=:global.g_emp_no
and nvl(ACTIVE_STATUS,'N')='Y'

hrv_empdetails


select FNC_DATECAL ('','htgt') from dual;

Tuesday, January 21, 2014

Blank Page - 3(java code writing way)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<div style="float:left; width:150px;" class="banglaText">
          <s:if test='%{summaryInfo.teacApearUse == "1"}'>
         <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" checked>এইচ.এস.সি (বি.এম)
          <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
           <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
         </s:if>
         <s:elseif test='%{summaryInfo.teacApearUse == "2"}'>
         <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
          <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" checked>এইচ.এস.সি (বি.এম)
           <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
         </s:elseif>
         <s:else>
         <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
          <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
           <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" checked>এইচ.এস.সি (বি.এম)
         </s:else>       
        </div>

        
    <div style="float:left; width:100px;">
         <select name="mpoStatus" id="mpoStatus" style="width:100px;" class="banglaText">
         <s:if test='%{summaryInfo.teacApearUse == "1"}'>
          <option value="1" selected="selected">হ্যাঁ</option>
          <option value="2">না</option>
          <option value="3">প্রযোজ্য নয়</option>
         </s:if>
         <s:elseif test='%{summaryInfo.teacApearUse == "2"}'>
         <option value="2" selected="selected">না</option>
         <option value="1">হ্যাঁ</option>
         <option value="3">প্রযোজ্য নয়</option>
         </s:elseif>
         <s:else>
          <option value="3" selected="selected">প্রযোজ্য নয়</option>
          <option value="1">হ্যাঁ</option>
         <option value="2">না</option>
         </s:else>
  
      </select>

    </div>
  
  
  
    <div>
       <td colspan="2" class="banglaTextDob" style="text-align:right;">লিঙ্গ :
      <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="M"}'>
        <input type="radio" value="M" id="gender1DepNRP" name="genderDepNRP" checked="checked">  
            </s:if>
      <s:else>
        <input type="radio" value="M" id="gender1DepNRP" name="genderDepNRP" />
        </s:else>
  পুরুষ
  <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="F"}'>
    <input type="radio" value="F" id="gender2DepNRP" name="genderDepNRP" checked="checked">  
  </s:if>
    <s:else>
      <input type="radio" value="F" id="gender2DepNRP" name="genderDepNRP" />
      </s:else>
    মহিলা
    <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="O"}'>
      <input type="radio" value="O" id="gender3DepNRP" name="genderDepNRP" checked="checked">  
      </s:if>
    <s:else>
      <input type="radio" value="O" id="gender3DepNRP" name="genderDepNRP" />
      </s:else>
    অন্যান্য    </td>
    </div>
  
</body>
</html>

Odd even apply on iterator table using status in java tag

Using  status odd even apply that means odd row show present and even row show past and also color apply From qregPolice

<%@taglib prefix="s" uri="/struts-tags" %>
<style type="text/css">
.odd{
background-color:#CCC;
}

.even{
background-color:#EEE;
}

</style>

<table border="0" cellpadding="0" cellspacing="0" style="width:214px;">

<tr>
    <td width="36%" style="font-family:Arial; font-size:12px; font-weight:bold; color:blue; text-decoration:underline;">Status</td>
    <td width="48%" style="font-family:Arial; font-size:12px; font-weight:bold; color:blue; text-decoration:underline;">Patient Name</td>
    <td width="16%" style="font-family:Arial; font-size:12px; font-weight:bold; color:blue; text-decoration:underline;">SL</td>
</tr>

<s:iterator value="patientSeqList" status="status">
<s:if test="#status.odd==true">
<tr style="font-family:Arial; font-size:12px; font-weight:normal; color:#000;" class="odd">

<td >Present</td>
  <td><s:property value="PAT_NAME"/></td>
  <td><s:property value="PAT_SL"/></td>
</tr>
 </s:if>
<s:else>
<tr style="font-family:Arial; font-size:12px; font-weight:normal; color:#000;" class="even">
<td >Past</td>
  <td><s:property value="PAT_NAME"/></td>
  <td><s:property value="PAT_SL"/></td>
</tr>
</s:else>

</s:iterator>
</table>












From ACO odd even apply using status



<%@taglib prefix="s" uri="/struts-tags"%>
<div  id="pageNavPosition" style="padding-bottom: 2px;" align="left">
    </div>
    <div id="displayDataDiv"  style="float:left;width:584px;height:auto;overflow:auto;overflow-x:scroll;">   
   
<table id="tablepaging" class="yui" align="center">
        <tr bordercolor="#FFFFFF" >
        
          <th>Search</th>         
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>         
       </tr>
       <tr>       
          <th  scope="col">HTN Rank</th>
          <th  scope="col">Confirmation</th>
          <th  scope="col">Not Qualified Reason</th>
          <th  scope="col">Not Qualified Date</th>
          <th  scope="col">Recent BP</th>
          <th  scope="col">BP Date</th>
          <th  scope="col">Systolic</th>
          <th  scope="col">Diastolic</th>
          <th  scope="col">Comments</th>
       </tr>
      
      <s:iterator value="hypertensionList" status="acd">
     
     <s:if test="#acd.odd==true">
         <tr class="odd" >
         
          <td align="center"><s:property value="htn_rank"/></td>
          <td align="center"><s:property value="htn_confirmed"/></td>
          <td align="center"><s:property value="htn_not_qualified_reason"/></td>
          <td align="center"><s:property value="htn_not_qualified_date"/></td>
          <td align="center"><s:property value="htn_recent_bp"/></td>
          <td align="center"><s:property value="htn_bp_date"/></td>
          <td align="center"><s:property value="htn_bp_systolic"/></td>
          <td align="center"><s:property value="htn_bp_diastolic"/></td>
          <td align="center"><s:property value="htn_comments"/></td>
          </tr>
          </s:if>
          <s:else>
           <tr class="even" >
         
          <td align="center"><s:property value="htn_rank"/></td>
          <td align="center"><s:property value="htn_confirmed"/></td>
          <td align="center"><s:property value="htn_not_qualified_reason"/></td>
          <td align="center"><s:property value="htn_not_qualified_date"/></td>
          <td align="center"><s:property value="htn_recent_bp"/></td>
          <td align="center"><s:property value="htn_bp_date"/></td>
          <td align="center"><s:property value="htn_bp_systolic"/></td>
          <td align="center"><s:property value="htn_bp_diastolic"/></td>
          <td align="center"><s:property value="htn_comments"/></td>
          </tr>
          </s:else>
        </s:iterator>
      
      </table>
       
   
    </div>