Friday, February 28, 2014

href="javascript:showOnlyCallendar();"

<a class="" href="javascript:showOnlyCallendar();" >Schedule</a>

                                                     Not

<a class="" href="#" onclick="showOnlyCallendar();">Schedule</a>






azax page call script by js


<script type="text/javascript">
function callBookList(){

   alert("azaxOne");
  
  
   $.ajax({
     url:"addBookEntryDataLogIn.do",
     success:function(data){
      $("#setAzaxPage_div").html(data);
     }
   })
  
  
  alert("azaxTwo");
  
}
</script>



@@@@@@@@@@@@@@@@@@@@@@@@@

Jsp page design :
------------------
N.B : Name are same but value different
 <tr>
    <td style="text-align:right;">Status : </td>
    <td width="8%"><input id="" name="ctive" type="radio" value="1" />Active </td>
    <td width="68%"><input id="" name="ctive" type="radio" value="0" />Inactive</td>
  </tr>


or


 <tr>
    <td style="text-align:right;">Status : </td>
    <td width="8%"><input id="" name="ctive" type="radio" value="Yes" />Active </td>
    <td width="68%"><input id="" name="ctive" type="radio" value="N0" />Inactive</td>
  </tr>



NOW AZAX SCRIPT :
--------------------------------

<script type="text/javascript">
function callBookList(){

   alert("azaxOne");
  
   var booksType =  document.getElementById('booksType').value; // input box
   alert("booksType="+booksType);
  
   var booksDes =  document.getElementById('booksDes').value; // text area
   alert("booksDes="+booksDes);
  
  
   //***** Start this portion is use for get Gender radio button  value
    var radiosA=document.getElementsByName('ctive');
   alert("radiosA"+radiosA);

    var statusValA;
    for (var i = 0, length = radiosA.length; i < length; i++) {
        if (radiosA[i].checked) {
            statusValA=radiosA[i].value;     
            alert("statusValA"+statusValA);
            break;
        }
    }
  
 
  
   $.ajax({
     url: "addBookEntryDataLogIn.do?booksType="+booksType+"&booksDes="+booksDes+"&statusValA="+statusValA,
     success:function(data){
      $("#setAzaxPage_div").html(data);
     }
   })
  
  
  alert("azaxTwo");
  
}
</script>






As  Combo value get :
------------------------------
var dt3 = document.getElementById('bank_name');  // As combo
var bankName = dt3.options[dt3.selectedIndex].value;
alert("bankName"+bankName);







@@@@@@@@@@@@@@@@@@@@@@@@@@
If i need another function create :then -

<!-- **** Start tab pane ****  -->
<script type="text/javascript">
function callBookList(){

   alert("azaxOne");
  
   var booksType =  document.getElementById('booksType').value;
   alert("booksType="+booksType);
  
   var booksDes =  document.getElementById('booksDes').value;
   alert("booksDes="+booksDes);
  
  
   //***** Start this portion is use for get Gender radio button  value
   //gender(genderOne,genderTwo,genderThree)
   var radiosA=document.getElementsByName('ctive');
   alert("radiosA"+radiosA);

    var statusValA;
    for (var i = 0, length = radiosA.length; i < length; i++) {
        if (radiosA[i].checked) {
            statusValA=radiosA[i].value;    
            alert("statusValA"+statusValA);
            break;
        }
    }
  
 
  
   $.ajax({
     url: "addBookEntryDataLogIn.do?booksType="+booksType+"&booksDes="+booksDes+"&statusValA="+statusValA,
     success:function(data){
      $("#setAzaxPage_div").html(data);
       clear();
     }
   })
  
  
  alert("azaxTwo");
  
}



function clear(){
  alert("cL");
  document.getElementById('booksDes').value = "";
  document.getElementById('booksType').value = "";

 
 
   
}
</script>
<!-- **** End tab pane ****  -->



AND JSP Page is  :
................................
................................

<table width="100%" border="0" cellspacing="1" cellpadding="1" style="font-family:Arial; font-size:12px; font-weight:bold; color:#000;">
  <tr>
    <td colspan="3" style="font-family:Arial; font-size:13px; font-weight:bold; color:#000; padding:5px; background:#D5E0F4;">Books Type Entry Setup Form : </td>
    </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td width="24%" style="text-align:right;">Books Type : </td>
    <td colspan="2"><input id="booksType" name="" type="text" value="" /></td>
    </tr>
  <tr>
    <td style="text-align:right;">Description : </td>
    <td colspan="2"><textarea  id="booksDes" name="" ></textarea ></td>
    </tr>
  <tr>
    <td style="text-align:right;">Status : </td>
    <td width="8%"><input id="" name="ctive" type="radio" value="1" />Active </td>
    <td width="68%"><input id="" name="ctive" type="radio" value="0" />Inactive</td>

  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td style="padding-bottom:10px;"><input id="" name="" type="button" value="Save" onclick="callBookList();"/></td>
    <td>&nbsp;</td>
  </tr>
   <tr>
    <td colspan="3">&nbsp;</td>
    </tr>
</table>













@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
Azax page call same div with status maintain : Learn it from java action class file for java code
-----------------------------------------------------------------------------------------------------------------------------
jsp page :



Now function call on active or inactive :

<div id="divs_id" style="float:left; width:100%; height:auto;">
      <table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr style="background:#666699;font-family:Arial;font-size:14px;font-weight:bold;color:#FFFFFF; text-align:center;">
    <td colspan="6" style="padding:5px;">User  Data Type</td>
    </tr>
  <tr style="background:#666699;font-family:Arial;font-size:14px;font-weight:bold;color:#FFFFFF; text-align:center;">
    <td width="22%" height="42" style="padding:5px;">User id</td>
    <td width="20%">Password</td>
    <td width="16%">User full name</td>
    <td width="11%">Role</td>
    <td width="18%">Image</td>
    <td width="13%">Inactive/Active Status</td>
  </tr>
  <s:iterator value="userDataTableList"  status="rowstatus">   
  <tr style="text-align:center;">
    <td><input id="pId" name="pInactiveId"  value="<s:property value='id'/>" type="hidden"   /><s:property value='user_id'/></td>
    <td><s:property value='user_pass'/></td>
    <td><s:property value='user_full_name'/></td>
    <td><s:property value='urd_name'/></td>
    <td>pic</td>
    <td><a href="#"  onClick="userStatusCall('<s:property value="status"/>','<s:property value="id"/>');"><s:property value='status'/></a></td>
  </tr>
  </s:iterator>
  <tr style="text-align:center;">
    <td colspan="6"><input id="" name="" type="button" value="Save" onClick="callActiveList();"/></td>
  </tr>
</table>
</div>

Not :(n.b: Not Single cotation) onClick="userStatusCall('<s:property value='status'/>','<s:property value'id'/>');"




<!-- **** Start tab pane ****  -->
<script type="text/javascript">
function userStatusCall(statusVal,unikId){


 alert("azaxTTwo_2 :"+statusVal);
 alert(unikId);
   $.ajax({
     url:"userStatusLogIn.do?statusVal="+statusVal+"&unikId="+unikId,
     success:function(data){
      $("#divs_id").html(data);
     }
   })
  alert("azaxTThree_3");
  

}
</script>



Java action class file :
//Azax
    private String statusVal;
    private String unikId;
    private String status = "";//Not set get just use for condition apply
    public String userStatus(){
        System.out.println("azax page: statusList call");
        if(statusVal.equalsIgnoreCase("inactive")){
            status ="1";
        } else {
            status ="0";
        }

        UserDataTableSQL userDataTableSQL = new UserDataTableSQL();
        userDataTableSQL.getUpdateTable(status,unikId); // use for update query
        userDataList(); // use for select query
        return "userStatus";
    }
    
Note : Hare I have take Uppercase Inactive value from jsp page But no problem  because I have used equalsIgnoreCase
 Now sql file :

//================user table: KYAMC_USER_TYPE
    public List getUserData() {
        List userDataTableList = new ArrayList();

        boolean fg = true;
        this.con = this.dbc.connectDB();

        if (this.con == null) {
            fg = false;
        }

        if (fg) {
            try {
                this.st = this.con.createStatement();

                //String query = "SELECT ID,USER_ID,USER_PASS,USER_FULL_NAME,GROUP_ID FROM  KYAMC_USER_TYPE";
                //String query = "SELECT ID,USER_ID,USER_PASS,USER_FULL_NAME,GROUP_ID FROM  KYAMC_USER_TYPE where STATUS='0'";
                //String query = "select id,user_id,user_pass,user_full_name,group_id,(select urd_name from kyamc_roledata_details where urd_grouporrole_id =a.group_id ) urd_name from  kyamc_user_type a  where status='0'";
               
                String query = "select id,user_id,user_pass,user_full_name,group_id,(select urd_name from kyamc_roledata_details where urd_grouporrole_id =a.group_id ) urd_name, decode(status,'1','Active','Inactive') status from  kyamc_user_type a";
               
                this.rs = this.st.executeQuery(query);
               

                while (this.rs.next()) {
                    UserDataTableInfo userDataTableInfo = new UserDataTableInfo();
                    //accountLevelInfo.setAuto_ac_type_no(this.rs.getString("AUTO_AC_TYPE_NO").trim());
                    userDataTableInfo.setId(this.rs.getString("id"));
                    userDataTableInfo.setUser_id(this.rs.getString("user_id"));
                    userDataTableInfo.setUser_pass(this.rs.getString("user_pass"));
                    userDataTableInfo.setUser_full_name(this.rs.getString("user_full_name"));
                    userDataTableInfo.setGroup_id(this.rs.getString("group_id"));
                    userDataTableInfo.setUrd_name(this.rs.getString("urd_name"));
                    userDataTableInfo.setStatus(rs.getString("status"));
                    userDataTableList.add(userDataTableInfo);
                }
            } catch (SQLException sq) {
                sq.printStackTrace();
                //or below line
                //System.out.println("Account Information Name Query Exception "+ sq.getMessage());
                try {
                    if (this.rs != null) {
                        this.rs.close();
                    }
                   

                    this.con.close();
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }
            } finally {
                try {
                    if (this.rs != null) {
                        this.rs.close();
                    }

                    this.con.close();
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }
            }
        }

        return userDataTableList;
    }
   
   
   
   
   
   
    //***************************************************************** START
    //***************************************************************** START
   
    //========================= update  query(executeUpdate) / insert query
      public void getUpdateTable(String statusPosition,String booksSingleId){
          System.out.println("kaniz");
          boolean fg = true;
          con = dbc.connectDB();

           if (con == null) {
               fg = false;
           }
      
      if (fg) {
       try {

              st = con.createStatement();
    
   //update kyamc_user_type set Status = '0' where ID='1130000019'
String queryUpdate = "update kyamc_user_type set Status = '"+statusPosition+"' where ID='"+booksSingleId+"'";

     System.out.println("QueryUpdate" + queryUpdate);
      //st.execute(query);//It is use for insertQuery
      st.executeUpdate(queryUpdate);
    

  


      } catch (SQLException sq) {       
        sq.printStackTrace();
      } finally {
        try {
            if (rs != null) {
                rs.close();
            }
      
            con.close();
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
      }
      }
  
              //return "getBankInfoPageReturn";  //Remember UPDATE query not Return;.Only select query return List.
          }
     
   
   
    //***************************************************************** END
    //***************************************************************** END
   
   













Parameter pass in script url


<script type="text/javascript">
function callBookList(){

   alert("azaxOne");
  
  
   $.ajax({
     url:"addBookEntryDataLogIn.do",
     success:function(data){
      $("#setAzaxPage_div").html(data);
     }
   })
  
  
  alert("azaxTwo");
  
}
</script>


 //window.location="teacherHisSavePageLadmin.do?"
//window.location="teacherHisSavePageLadmin.do?reg_noA="+reg_noA;


//var ajaxURL = "patientViewModalLoad.do";
 var ajaxURL = "patientViewModalLoad.do?userValue="+userValue;

var ajaxURL = "patientViewModalLoad.do?userValue="+userValue+"&second="+second;




<script type="text/javascript">
function callBookList(){

   alert("azaxOne");
  $.ajax({
     url: "addBookEntryDataLogIn.do?booksType="+booksType+"&booksDes="+booksDes+"&statusValA="+statusValA,
     success:function(data){
      $("#setAzaxPage_div").html(data);
     }
   })
  
  
  alert("azaxTwo");
  
}
</script>
 

Sunday, February 23, 2014

concat(), replace(), and trim() Strings in Java

from java if value go(pass) database 2 rule :



1/   "+admission_no+" (If it is number that means private int admission_no)



2/   '"+admission_no+"' (If it is varchar that means private string admission_no)







*************************************************************************
<script language="javascript">
function getInputVal(td_id,numberId){
//alert(td_id);
alert("kk");
var name = td_id+numberId;
var valOne = document.getElementById(name).innerHTML;

//var valTwo = document.getElementById(numberId).innerHTML;
//var total = parseInt(valOne)+parseInt(valTwo);


alert(valOne);


}
</script>


concatanation : concatanation is add of two string result. So no need double cotation for  string variable of name.

var valOne = document.getElementById(name).innerHTML;


Not


var valOne = document.getElementById("sc").innerHTML;


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


Ques: What is sum and concatanation ?
sum : sum is add of two numeric value result.It is need for parseInt

************************************
************************************
*************************************
<script language="javascript">
function getInputVal(td_id,numberId){
//alert(td_id);
alert("kk");
var sc = td_id+numberId;
var valOne = document.getElementById(sc).innerHTML;
//var valTwo = document.getElementById(numberId).innerHTML;
//var total = parseInt(valOne)+parseInt(valTwo);
alert(valOne);


}
</script>




********************************************************************
Single cotation and double cotation   And no cotation
=====================================================


<td  onClick="getInputVal('record<%=i %>');"><a href="#" ><img src="images/editable.jpg" style="border:none;"/></a>

Direct value pass in function using by single or double cotation.such as-
<script language="javascript">
function getInputVal(td_id){
alert(td_id);

var val = document.getElementById(td_id).innerHTML;
alert(val);

//var val1 = document.getElementById("record1").innerHTML; and var val1 = document.getElementById('record1').innerHTML;  same


alert(val1);


}
</script>



About no cotation
==================
value pass as parameter in function using by no cotation.such as-

<td  onClick="getInputVal('record<%=i %>');"><a href="#" ><img src="images/editable.jpg" style="border:none;"/></a>

Direct value pass in function using by single or double cotation.such as-
<script language="javascript">
function getInputVal(td_id){
alert(td_id);

var val = document.getElementById(td_id).innerHTML;
alert(val);



}
</script>


*********************************************************
<jsp:include page="adminInclude/menu/adminLeftMenu.jsp"></jsp:include>


save = insert query
edit = update query


===============================================
kaniz : subject : oracle data type
..................................

http://docs.oracle.com/cd/B14117_01/server.101/b10759/sql_elements003.htm


kaniz : subject : java sms send
..................................
http://www.ipipi.com/help/send_text_message_using_java.htm
===============================================

================================================
Java model class a Private int COUNTRY_ID means only indicate intiger vaue. (Here int is primitive type data type)

Java model class a Private Intiger COUNTRY_ID means it indicates intiger or string value.

=================================================
######################################################################
######################################################################

http://www.java-samples.com/showtutorial.php?tutorialid=339

concat()
You can concatenate two strings using concat(), shown here:
String concat(String str)
This method creates a new object that contains the invoking string with the contents of str appended to the end. concat( ) performs the same function as +. For example,
String s1 = "one"; 
String s2 = s1.concat("two");

puts the string "onetwo" into s2. It generates the same result as the following sequence:
String s1 = "one"; 
String s2 = s1 + "two";

replace()
The replace( ) method replaces all occurrences of one character in the invoking string with another character. It has the following general form:
String replace(char original, char replacement)
Here, original specifies the character to be replaced by the character specified by replacement. The resulting string is returned. For example,
String s = "Hello".replace('l', 'w');
puts the string "Hewwo" into s.
trim()
The trim( ) method returns a copy of the invoking string from which any leading and trailing whitespace has been removed. It has this general form:
String trim( )
Here is an example:
String s = " Hello World ".trim();
This puts the string "Hello World" into s.
The trim( ) method is quite useful when you process user commands. For example, the following program prompts the user for the name of a state and then displays that state's capital. It uses trim( )to remove any leading or trailing whitespace that may have inadvertently been entered by the user.
// Using trim() to process commands. 
import java.io.*; 
class UseTrim { 
public static void main(String args[]) 
throws IOException 
{ 
// create a BufferedReader using System.in 
BufferedReader br = new 
BufferedReader(new InputStreamReader(System.in)); 
String str; 
System.out.println("Enter 'stop' to quit."); 
System.out.println("Enter State: "); 
do { 
str = br.readLine(); 
str = str.trim(); // remove whitespace 
if(str.equals("Illinois")) 
System.out.println("Capital is Springfield."); 
else if(str.equals("Missouri")) 
System.out.println("Capital is Jefferson City."); 
else if(str.equals("California")) 
System.out.println("Capital is Sacramento."); 
else if(str.equals("Washington")) 
System.out.println("Capital is Olympia."); 
// ... 
} while(!str.equals("stop")); 
} 
}

What is trim ?

    if (!totalFemale.equals("")) {           
            committeesInfo.setTotalFemale(Integer.valueOf(totalFemale.trim()));
        }else{
            committeesInfo.setTotalFemale(null);           
        }



Return Value:
It returns a copy of this string with leading and trailing white space removed, or this string if it has no leading or trailing white space.



Example:
import java.io.*;

public class Test{
   public static void main(String args[]){
      String Str = new String("   Welcome to Tutorialspoint.com   ");

      System.out.print("Return Value :" );
      System.out.println(Str.trim() );
 //System.out.println(Str);   // For This out put is : Return Value :   Welcome to Tutorialspoint.com
   }
}
This produces the following result:

Return Value :Welcome to Tutorialspoint.com



Another Example :

This method removes the blank spaces from both ends of the given string (Front and End). 
Here is the code of program:



import java.lang.*;

public class StringTrim{
  public static void main(String[] args) {
  System.out.println("String trim example!");
  String str = " RoseIndia";
  System.out.println("Given String :" + str);
  System.out.println("After trim :" +str.trim());
  }
}

http://www.roseindia.net/java/beginners/StringTrim.shtml

Another Example :

Example of String trim() in java, JSP
public class StringTrimExample {

    public static void main(String[] args) {
        
        String string = " Java String ";
        
        String str = string.trim();
        
        System.out.println("Output without trim :"+string);
        
        System.out.println("Output with trim :"+str);
    }
}
Output
Output without trim : Java String 
Output with trim :Java String

DateFormating dot java

package util;

import java.util.Calendar;
import java.util.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class DateFormating {
   
    public Date getDate(String dateFormate, String dateString) {
        //03/06/2012
        DateFormat formater = new SimpleDateFormat(dateFormate);
       
        try {
               Date datevalue= formater.parse(dateString);
               return  datevalue;
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
   
   
    public String getDateTime(Date dateString) {
        SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
        String date = format.format(dateString);
        return date;
    }
   
    public String getDate(String dateString) {
        try {
            if(!dateString.isEmpty()){
                String oldDateFormat="yyyy-MM-dd";
                String newDateFormat="MM/dd/yyyy";
                SimpleDateFormat formater = new SimpleDateFormat(oldDateFormat);
                Date datevalue= formater.parse(dateString);
                formater.applyPattern(newDateFormat);
                return  formater.format(datevalue);
            }else{
                return "";
            }
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
   
    //format a date for database
    //@ getDate     this will take date from Date instance
    public Date dateFormatDB(String getDate) {
        DateFormat formater = new SimpleDateFormat("MM/dd/yyyy");
        Date datevalue;
        try {
            datevalue = formater.parse(getDate);
            return datevalue;
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
   
  //format a date for the user
    //@ getDate     this will take date from Date instance
    public String dateFormatUser(Date getDate) {
        SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
        String date = format.format(getDate);
        return date;
    }
   
    //format a date for the user
    //@ getDate     this will take date from Date instance
    public String dateFormatUser1(Date getDate) {
        SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
        String date = format.format(getDate);
        return date;
    }
  //format a date for the user
    //@ getDate     this will take date from Date instance
    public String dateFormatDBOracle(Date getDate) {
        SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        String date = format.format(getDate);
        return date;
    }
    public String dateFormatDBOracleD(Date getDate) {
        SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
        String date = format.format(getDate);
        return date;
    }
   
    public int dateCount(String dateFrom,String dateTo){
        Date fromDate=dateFormatDB(dateFrom);
        Date toDate=dateFormatDB(dateTo);
        int dateFromInt=fromDate.getDate();
        int dateToInt=toDate.getDate();
        int totalDays=dateFromInt-dateToInt;
        return totalDays;
    }
   
   
    public Date getCalendarDate(String dateFormate, String dateString) {  //Only for  "dd/MM/yyyy"
       
        Calendar cal= Calendar.getInstance();
        Date date=null;
        DateFormat formater = new SimpleDateFormat(dateFormate);

              try {
                       Date dateValue= formater.parse(dateString);
                    cal.setTime(dateValue);  
                    date=  cal.getTime();                                 
              } catch (ParseException e) {
                  e.printStackTrace();
                 
              }          
         return  date;
      
    }
   
    public static void main(String[] args){
       
        DateFormating dfff= new DateFormating();
       
       
//    System.out.println(    dfff.getCalendarDate("MM/dd/yyyy hh:mm aa", "03/05/2013 03:14 PM"));
        System.out.println(    dfff.dateFormatDBOracle(new Date()));
       
       
       
    }

}

Saturday, February 22, 2014

Date declare way in jsp page, javafile and database




About Date : in jsp page declare ,in  database declare and declare in java file
 




In jsp page


<td align="right">জন্ম তারিখ</td>
<td>&nbsp;&nbsp;
  <input type="text" id="dob" name="dob" style="width:103px;" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';checkdate(this);entYMD(this.id);" onKeyPress="return dateWithSlashOnly(this, event)" onKeyUp="dtval(this,event)" maxlength="16" title="DD/MM/YYYY" value="<s:date name='hrvPoliceInfo.dob' format='dd/MM/yyyy'/>"/> <img src="Calendar/DateTimeJS/images2/cal.gif" onClick="javascript:NewCssCal('dob','ddMMyyyy','','','24','','todayToPast')" style="height:20px;width:20px;"/></td>
<td align="right" colspan="2">বয়স &nbsp;&nbsp;


<input name="yearN" type="text" onKeyUp="setAgeDate('yearN','monthN','dayN');" maxLength="2" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" value="" id="yearN" onKeyPress="return numbersonly(this, event)" style="width:20px;" title="বছর"/>বছর<input name="monthN" type="text" onKeyUp="setAgeDate('yearN','monthN','dayN');" size="2" maxLength="2" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" value="" id="monthN" onKeyPress="return numbersonly(this, event)" title="মাস" style="width:20px;"/>মাস<input name="dayN" type="text" onKeyUp="setAgeDate('yearN','monthN','dayN');" size="2" maxLength="2" onChange="doReq(this)" value="" id="dayN" onKeyPress="return numbersonly(this, event)" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';" title="দিন" style="width:20px;"/>দিন
 
  </td>






PatientRegAction.java

query1 = "insert into op_registration (reg_no, national_id, full_name,reg_dt, fname, mname,dob,age_yy,age_mm, " +
                              "age_dd, blood_group, gender, pat_mobile,marital_status, entered_by,entry_timestamp, " +
                              "spouse_name, rel_id, police_bp_no)" +
                              " values " +
                              " ('"+secVal+"' , " +
                              " '"+national_id+"' , " +
                              " '"+full_name+"'  , " +
                              " to_date('" + datVal + "','DD/MM/YYYY') , " +
                              " '"+fname+"' ," +
                              " '"+mname+"' ," +        
                              " to_date('" + dob + "','DD/MM/YYYY') , " +
                              " "+Integer.parseInt(age_yy)+" ," +
                              " "+Integer.parseInt(age_mm)+" ," +
                              " "+Integer.parseInt(age_dd)+" ," +
                              " '"+blood_group+"' ," +
                              " '"+gender+"' ," +
                              " '"+pat_mobile+"' ," +
                              " '"+marital_status+"' ," +                    
                              "'Shyfuzzaman', " +    
                              " to_date('" + datVal + "','DD/MM/YYYY') , " +       
                              " '"+spouse_name+"' ," +     
                              " "+rel_id+" ," +
                              " '"+bpNo+"' " +                     
                                          " )";




This page variable declare (PatientRegAction.java):
      private String dob;
      private String age_fg="12" ;
      private String age_yy="2013";
      private String age_mm="10";
      private String age_dd="12";
      private String blood_group;
      private String gender;




In jsp Page For gender:
<td align="right">&nbsp;&nbsp;লিঙ্গ</td>
<td>&nbsp;&nbsp;

  <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="M"}'>
<input type="radio" value="M" id="gender1" name="gender" checked="checked">  
      </s:if>
      <s:else>
        <input type="radio" value="M" id="gender1" name="gender" />
      </s:else>
  পুরুষ
  <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="F"}'>
<input type="radio" value="F" id="gender2" name="gender" checked="checked">  
      </s:if>
      <s:else>
        <input type="radio" value="F" id="gender2" name="gender" />
      </s:else>মহিলা  <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="O"}'>
<input type="radio" value="O" id="gender3" name="gender" checked="checked">  
      </s:if>
      <s:else>
        <input type="radio" value="O" id="gender3" name="gender" />
      </s:else>অন্যান্য </td>








##################################################################################

##################################################################################

From Banbeis Learn date declare way in jsp page, javafile and database :












































In javaFile.java


private DateFormating dateFormating;


dateFormating = new DateFormating();

if (recognitionDateNinmoS!=null||!recognitionDateNinmoS.equals("")) {

institutesRecognitionInfo.setRecognitionDate(dateFormating.getCalendarDate("dd/MM/yyyy", recognitionDateNinmoS));
                        }



This page variable declare (SchoolAction.java):
private String recognitionDateNinmoS="";



in  jsp page:
<input id="recognitionExpireDate53S" name="recognitionExpireDate53S" type="text"  value="<s:date name='institutesRecognition53Info.recognitionExpireDate' format='dd/MM/yyyy'  />" style="width:200px;" onFocus="this.style.backgroundColor='#ffff66';" onBlur="this.style.backgroundColor='#d4e3e5';checkdate(this);" onKeyPress="return dateWithSlashOnly(this, event)" onKeyUp="dtval(this,event)" maxlength="10">




What is trim ??


    if (!totalFemale.equals("")) {           
            committeesInfo.setTotalFemale(Integer.valueOf(totalFemale.trim()));
        }else{
            committeesInfo.setTotalFemale(null);           
        }