This discussion is archived
14 Replies Latest reply: Nov 1, 2007 12:33 AM by 807603 RSS

NULL value gettin generated even after gettin updated in DB,

807603 Newbie
Currently Being Moderated
hi
i ve a jsp and in tat jsp i ve a button (save)-- on click of which DB gets updated...
the DB values gets updated but the updated value is not shown in the jsp screen unless and until i press tat show button in the prev jsp...

got any suggestions?

thankx
  • 1. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    got any suggestions?
    Yes.

    1) Having JDBC code in your JSP is a big mistake.

    2) Try re-writing your question so that it's comprehensible. Some non-idiotic punctuation and using real words would help.
  • 2. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    i use struts.. and in my DAO the value passed is NULL....
  • 3. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    aravindsr1983 wrote:
    i use struts.. and in my DAO the value passed is NULL....
    I see.

    Well try fixing your code on line 15 of your JSP then.
  • 4. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    problem is fixed,
  • 5. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    see i am totally blank on tis. if u could be of any help it wil be great.. i dont ve time to play
  • 6. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    aravindsr1983 wrote:
    problem is fixed,
    I see.

    Well I'm off to buy lottery tickets now. You have a nice day.
  • 7. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    aravindsr1983 wrote:
    see i am totally blank on tis.
    You just said it was fixed!
    if u could be of any help it wil be great.. i dont ve time to play
    Then why don't you tell us something useful about your problem then jackass?

    Like maybe some formatted code? Or an stack trace? Or whatever it is that you've got?
  • 8. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
         
    <%@ page import="com.games24X7.endpoint.web.util.RequestAttribute" %>
    <%@ page import="com.games24X7.endpoint.web.tournament.vo.TournamentDetailVO" %>
    <%@ page import="com.games24X7.endpoint.web.tournament.form.TournamentDetailForm" %>     
    <%@ page import="com.games24X7.auth.Session"%>     
    
    <%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
    <%@taglib prefix="app" uri="button"%>
    <%
    String contextPath = request.getContextPath();
    TournamentDetailVO viewObj = (TournamentDetailVO)session.getAttribute(
                                                 RequestAttribute.TOURNAMENT_DETAIL_VO );
    boolean update = true;
    if(viewObj.getGame()== null || viewObj.getGame().equalsIgnoreCase("") )
    {
         update = false;
         viewObj = new TournamentDetailVO();
    }
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    
    <title>::Play Games 24x7::</title>
    <link rel="stylesheet" type="text/css" href="style1.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="<%=contextPath%>\css\style.css"
         type="text/css">
    <link rel="stylesheet" type="text/css" media="all"
         href="<%=contextPath %>/themes/bluexp.css"
         title="Calendar Theme - bluexp.css">
    
    <link href="<%=contextPath %>/css/zpcal.css" rel="stylesheet"
         type="text/css">
    <link href="<%=contextPath %>/css/template.css" rel="stylesheet"
         type="text/css">
    
    <style>
    <!--
    body {
    background-color:#000000;
    }
    body {
    scrollbar-face-color:#9F160F; 
    scrollbar-shadow-color:#FFD799;
    scrollbar-highlight-color:#FFD799;
    scrollbar-3dlight-color:#000000;
    scrollbar-darkshadow-color:#000000;
    scrollbar-track-color:#FFFFFF; 
    scrollbar-arrow-color: #FFFFFF;
    }
    .style1 {font-weight: normal; color: #000000; text-decoration: none; font-family: Verdana;}
    .Bigboldtext {     font-family: Arial, Helvetica, sans-serif;
         font-size: 18px;
         font-weight: bold;
         color: #000000;
         text-decoration: none;
    }
    .blackboderforimages {     padding: .5px;
         border: 1px solid #000000;
    }
    .bottonfor-searchgo1 {     background-image: url(images/botton1back.gif);
         border: 1px groove #000000;
         font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 11px;
         font-weight: bold;
         color: #000000;
         text-decoration: none;
         padding: .5px;
    }
    .homepagetext {     font-family: Verdana;
         font-size: 11px;
         font-weight: normal;
         color: #000000;
         text-decoration: none;
    }
    .searchtextbox1 {     font-family: Verdana;
         font-size: 11px;
         font-weight: bold;
         color: #000000;
         text-decoration: none;
         padding: .5px;
         border: 1px groove #000000;
         word-spacing: 2px;
    }
    -->
    </style>
    
    <script type="text/javascript">
    function press(id1,id2){
         
        document.getElementById(id1).style.display='none'
        document.getElementById(id2).style.display='block'
    }
    function submitForm(){
    <%
    if(update)
    {
    %>
    document.tournamentDetailForm.processAction.value="update"
    <%
    }
    else
    {
    %>
    document.tournamentDetailForm.processAction.value="save"
    <%
    }
    %>
    document.tournamentDetailForm.submit();
    }
    
    function viewTournaments(){
              window.location = "<%=contextPath%>/viewTournaments.do"
    }
    
    //
    
    function eventTrigger (e)
    {
    if (! e)
    e = event;
    return e.target || e.srcElement;
    }
    function radioClick (e) 
    {
    var obj = eventTrigger (e);
    alert(obj.value);
    document.getElementById('radiobuttonvalue').value = obj.value;
    
    
                                     if(obj.value == 'Chess')
                                     {
                                          
                                          document.getElementById('new').style.display = 'block';
                                          document.getElementById('old').style.display = 'block';
      }
                                                                      
                                     if(obj.value == 'Rummy')
                                     {
                                          
                                          document.getElementById('new').style.display = 'none';
                                          document.getElementById('old').style.display = 'none';
    }                 
      }     
    function Clickradio (e) 
    {
    var objj = eventTrigger (e);
     alert(objj.value); 
           
           
                    
                                            if(objj.value == 'FIX_PLAYER')
                                            {
                                                 var checkAvailEl = document.getElementById('start');
                                                 alert(checkAvailEl);
                                                 checkAvailEl.innerHTML = 'Tournament Expiration Time ';
                                            }
                                            if(objj.value == 'FIX_TIME')
                                                 {
                                                 
                                                 var checkAvailEl = document.getElementById('start');
                                                 alert(checkAvailEl);
                                                 checkAvailEl.innerHTML = 'Tournament Start Time ';
                                                 }
    }     
    function loading()
    {
                                       
                                          
                                          document.getElementById('start').style.display = 'block';
                                                 
                                                 document.getElementById('col').style.display = 'block';
                                                 
                                                 
                                                 
    
    }                                 
    
    
    </script>
    
    
    <!-- import the calendar script -->
    <script type="text/javascript" src="<%=contextPath %>/js/utils.js"></script>
    <script type="text/javascript" src="<%=contextPath %>/js/calendar.js"></script>
    
    <!-- import the language module -->
    <script type="text/javascript" src="<%=contextPath %>/js/calendar-en.js"></script>
    
    <!-- other languages might be available in the lang directory; please check
              your distribution archive. -->
    
    <!-- import the calendar setup script -->
    <script type="text/javascript"
         src="<%=contextPath %>/js/calendar-setup.js"></script>
    
    
    
    </head>
    <html:form action="tournamentDetail" method="get">
         <body onLoad="loading()">
         
         <html:errors />
         <jsp:useBean id="props" class="com.games24X7.property.PropertyLoader"
              scope="page" />
    
         <div class="container" id="mainzone"><!--start of top zone--> <!--Tops(--Logo;one banner;members login page;main navigation--)-->
    
    
         <div class="topzone" id="top_zone">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                   <td width="264" rowspan="3" valign="top">
                   <div align="right"><img src="images/logo.gif" width="259"
                        height="162" /></div>
                   </td>
    
                   <!-- Start Of Top Banner Zone-->
                   <td height="108" valign="top">
                   <div class="topbanner" id="topbanner_zone">
                   <table width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                             <td colspan="2" valign="top"><img src="images/topbanner1.gif"
                                  width="725" height="103" /></td>
                        </tr>
                   </table>
    
    
                   </div>
    
    
                   </td>
                   <!-- End Of Top Banner Zone-->
    
              </tr>
              <tr>
    
                   <td height="28"><!-- Start Of Members login Zone-->
                   <div id="memberslogin_zone"></div>
                   <!-- End Of Members login Zone--></td>
    
              </tr>
              <tr>
                   <!-- Start Of Main Link Zone-->
                   <td height="26"> </td>
                   <!-- End Of Main Link Zone-->
              </tr>
         </table>
         </div>
         <!--end of top zone--> <!--start of middle zone-->
         <div class="midzone" id="middle_zone">
         <div class="midtopborder"><img src="images/midtop.gif" /></div>
    
         <!--start of middle-->
         <div class="midmiddlezone">
         <div>
         <table width="100%" border="0" cellspacing="0" cellpadding="8">
    
              <tr>
                   <td height="187" valign="top">
                   <table width="100%" border="0" align="center" cellpadding="3"
                        cellspacing="0" class="blackboderforimages">
                        <tr>
                             <td valign="top">
                             <table width="100%" border="0" align="left" cellpadding="1"
                                  cellspacing="1" class="borderblack">
                                  <tr>
                                       <td width="1450%" height="23" colspan="6"
                                            background="images/headerline.gif" class="tournamentheder"> Tournament
                                       Creation Page</td>
                                  </tr>
    
    
                                  <tr>
                                       <td colspan="6" valign="top" class="headerbold">
                                       <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                 <td width="50%" valign="top">
                                                 <table width="99%" border="0" align="center" cellpadding="2"
                                                      cellspacing="2" class="blackboderforimages">
                                                      <tr>
                                                           <td width="45%"><strong>Tournament Type</strong></td>
                                                           <td width="2%">:</td>
                                                                                                        
                                                           <input type="hidden" value="<%= viewObj.getGame() %>" >
                                                           <input type="hidden" value="<%= viewObj.getTournamentType() %>" >
                                                                
                                                           
                                                           <% if(update){ 
                                                                if( (viewObj.getTournamentType().equalsIgnoreCase("FIX_TIME")))
                                                                {%>
                                                                <td width="26%"><span class="homepagetext">     
                                                                     <input name="tournamentType" type="radio" value="FIX_TIME"  checked  />
                                                                     Fixed Time</span></td>
                                                                <%}else{%>
                                                                     
                                                                     <td><span class="homepagetext">     
                                                                     <input name="tournamentType" type="radio" value="FIX_PLAYER"  checked />
                                                                     Fixed PLAYER</span></td>
                                                           
                                                                <input name="test" type="hidden" value ="<%= viewObj.getTournamentType() %>"/>
                                                           
                                                           
                                                           
                                                           <%}
                                                                }else{ %>
                                                           
                                                           
                                                           <td width="27%"><span class="homepagetext">     
                                                           <html:radio property="tournamentDetailVO.tournamentType" value="FIX_TIME" onclick=" Clickradio (event)"  />
                                                           Fixed Time  </span></td>
                                                           <td width="27%"><span class="homepagetext">
                                                           <html:radio property="tournamentDetailVO.tournamentType" value="FIX_PLAYER" onclick=" Clickradio (event)" />
                                                           Fixed Player</span></td>
                                                      </tr>
                                                      <%} %>
                                                      
                                                 
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Game
                                                           </strong></td>
                                                           <td>:</td>
                                                           
                                                           <% if(update){ 
                                                                if( (viewObj.getGame().equalsIgnoreCase("1")))  
                                                                {%>
                                                                <td width="27%"><span class="homepagetext">     
                                                                     <input name="game" type="radio" value="1"  checked  />
                                                                     Rummy</span></td>
                                                                <%}else{%>
                                                                     
                                                                     <td width="27%"><span class="homepagetext">     
                                                                     <input name="game" type="radio" value="2"  checked />
                                                                     Chess</span></td>
                                                           
                                                                <input name="testt" type="hidden" value ="<%= viewObj.getGame() %>"/>
                                                           
                                                           
                                                           
                                                           <%}
                                                                }else{ %>
                                                           
                                                           
                                                           <td width="27%"><span class="homepagetext">     
                                                           <html:radio property="tournamentDetailVO.game" value="1" onclick=" Clickradio (event)"  />
                                                           Rummy  </span></td>
                                                           <td width="27%"><span class="homepagetext">
                                                           <html:radio property="tournamentDetailVO.game" value="2" onclick=" Clickradio (event)" />
                                                           Chess</span></td>
                                                      </tr>
                                                      <%} %>
                                                           
                                                                                                             
                                                           
                                                           </tr>
    
    <!-- new field for chess<tr>
                                                           <td><strong><div id = "new">NEW FIELD FOR CHESS</div></strong> </td>
                                                           <td><div id="old">:</div></td>
                                                           <td colspan="2"> <html:text  styleId= "chess" property="tournamentDetailVO.game" /></td>
                                                      </tr>-->
                                               
                                            
                                            
                                            
                                            
                        
                                            
                                            
                                            
                                            
                                            
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td colspan="2"> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Tournament Name</strong></td>
                                                           <td>:</td>
                                                           <td colspan="2"><html:text
                                                                                    property="tournamentDetailVO.name" styleClass="edited_section " value="<%= viewObj.getName()%>"/>
                                                                               </td>
                                                                               <html:hidden property="processAction" />
                                                                               <html:hidden property="tournamentDetailVO.id" value="<%=viewObj.getId()%>"/>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td colspan="2"> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Games Per Match</strong></td>
                                                           <td>:</td>
                                                           <td colspan="2"><html:text property="tournamentDetailVO.gamesPerMatch" 
                                                           styleClass="edited_section" value="<%= viewObj.getGamesPerMatch() %>"/></td>
                                                      </tr>
    
    
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td colspan="2"> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Minimum Number of Players</strong></td>
                                                           <td>:</td>
                                                           <td colspan="2"><html:text property="tournamentDetailVO.minNofPlayers" 
                                                                                    styleClass="edited_section " value="<%= viewObj.getMinNofPlayers() %>"/></td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td colspan="2"> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Maximum Number of Players</strong></td>
                                                           <td>:</td>
                                                           <td colspan="2"><span class="homepagetext"> 
                                                           <html:text property="tournamentDetailVO.maxNofPlayers" 
                                                           styleClass="edited_section " value="<%= viewObj.getMaxNofPlayers() %>"/>
                                                           </td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td colspan="2"> </td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td height="21" colspan="2"> </td>
                                                      </tr>
                                                 </table>
                                                 </td>
                                                 <td width="50%" valign="top">
                                                 <table width="99%" border="0" align="center" cellpadding="2"
                                                      cellspacing="2" class="blackboderforimages">
    
                                                      <tr>
                                                           <td width="45%"><strong>Time Between Games</strong></td>
                                                           <td width="2%">:</td>
                                                           <td width="53%"><html:text property="tournamentDetailVO.timeBetweenMatch"
                                                                                    styleClass="edited_section " value="<%= viewObj.getTimeBetweenMatch() %>"/>
                                                                                    </td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Time Between Rounds</strong></td>
                                                           <td>:</td>
                                                           <td>
                                                            <html:text property="tournamentDetailVO.timeBetweenRound"
                                                                                    styleClass="edited_section " value="<%= viewObj.getTimeBetweenRound() %>"/>
                                                                                    </td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Entry Fees</strong></td>
                                                           <td>:</td>
                                                           <td><html:text property="tournamentDetailVO.entryFees" 
                                                           styleClass="edited_section " value="<%= viewObj.getEntryFees() %>"/></td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Time of release</strong></td>
                                                           <td>:</td>
                                                           <td><html:text
                                                                                    property="tournamentDetailVO.timeOfRelease" styleClass="edited_section "
                                                                                    styleId="sel5" readonly="true" value="<%= viewObj.getTimeOfRelease() %>"/> <img src="<%=contextPath%>/images/cal.gif" id="button5" class="cursor"> <script
                                                                                    type="text/javascript">
                                                                                                   var cal = new Game24X7.Calendar.setup({
                                                                                                   
                                                                                                   inputField     :    "sel5",     // id of the input field
                                                                                                   singleClick    :     false,     // require two clicks to submit
                                                                                                   ifFormat       :    '%a, %b %e, %Y [%I:%M %p]',     // format of the input field
                                                                                                   showsTime      :     true,     // show time as well as date
                                                                                                   button         :    "button5"  // trigger button 
                                                                                                   
                                                                                                   });
                                                                                                   
                                                                                              </script></td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Registration Start Time</strong></td>
                                                           <td>:</td>
                                                           <td><html:text
                                                                                    property="tournamentDetailVO.registrationStartTime"
                                                                                    styleClass="edited_section " styleId="sel4"
                                                                                    readonly="true" value="<%= viewObj.getRegistrationStartTime() %>"/> <img src="<%=contextPath%>/images/cal.gif" id="button4" class="cursor"> <script type="text/javascript">
              var cal = new Game24X7.Calendar.setup({
              
              inputField     :    "sel4",     // id of the input field
              singleClick    :     false,     // require two clicks to submit
              ifFormat       :    '%a, %b %e, %Y [%I:%M %p]',     // format of the input field
              showsTime      :     true,     // show time as well as date
              button         :    "button4"  // trigger button 
              
              });
              
         </script></td>
                                                      </tr>
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td><strong>Registration End Time</strong></td>
                                                           <td>:</td>
                                                           <td><html:text
                                                                                    property="tournamentDetailVO.registrationEndTime"
                                                                                    styleClass="edited_section " styleId="sel8"
                                                                                    readonly="true" value="<%= viewObj.getRegistrationEndTime() %>"/> <img src="<%=contextPath%>/images/cal.gif" id="button7" class="cursor"> <script type="text/javascript">
              var cal = new Game24X7.Calendar.setup({
              
              inputField     :    "sel8",     // id of the input field
              singleClick    :     false,     // require two clicks to submit
              ifFormat       :    '%a, %b %e, %Y [%I:%M %p]',     // format of the input field
              showsTime      :     true,     // show time as well as date
              button         :    "button7"  // trigger button 
              
              });
              
         </script></td>
                                                      </tr>
                                                      
                                                      
                                                      
                                                      
    <!-- END TIME -->
    
    <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      
                                                      <tr>
                                                      <td> 
                                                     <% if(!update){ %>
                                                           <strong><div id="start">Tournament Start Time</div></strong>
                                                      <%}else{
                                                           if( viewObj.getTournamentType().equalsIgnoreCase("FIX_PLAYER")) {%>
                                                           <strong><div id="start">Tournament Expiration Time</div></strong>
                                                           <%}else{ %>     
                                                           <strong><div id="start">Tournament Start Time</div></strong>     
                                                      <% }}%>
                                                           </td>
                                                           <td><div id="col">:</div></td>
                                                           <td><span class="homepagetext"><html:text
                                                                                    property="tournamentDetailVO.tournamentStartTime"
                                                                                    styleClass="edited_section " styleId="sel3"
                                                                                    readonly="true" value="<%= viewObj.getTournamentStartTime() %>"/> <img src="<%=contextPath%>/images/cal.gif" id="button2" class="cursor"> <script type="text/javascript">
              var cal = new Game24X7.Calendar.setup({
              
              inputField     :    "sel3",     // id of the input field
              singleClick    :     false,     // require two clicks to submit
              ifFormat       :    '%a, %b %e, %Y [%I:%M %p]',     // format of the input field
              showsTime      :     true,     // show time as well as date
              button         :    "button2"  // trigger button 
              
              });
              
         </script>
         
         
         
                                         </td>
                                                      </tr>
    
                                                      
                                                      <tr>
                                                           <td> </td>
                                                           <td> </td>
                                                           <td> </td>
                                                      </tr>
                                                      <tr>
                                                           <td>
                                                           </td>
                                                           <td></td>
                                                           <td>
         
         
              
         </td>
                                                      </tr>
                                                 </table>
                                                 </td>
                                            
    
    
                                            <tr><td align="right">
                                            
                                                                     <%
                                                                     if(!update)
                                                                     {
                                                                     %>                                                                 
                                                                     <app:button
                                                                          label="<%=props.getDefaultProps().getProperty("button.name.save")%>"
                                                                          normalButtonId="nbutton12" pressedButtonId="pbutton12"
                                                                          onMouseDown="press('nbutton12','pbutton12');"
                                                                          onMouseUp="press('pbutton12','nbutton12');submitForm();"
                                                                          onmouseout="press('pbutton12','nbutton12');"></app:button>
                                                                     <%
                                                                     }
                                                                     else
                                                                     {
                                                                     %>
                                                                     <app:button
                                                                          label="<%=props.getDefaultProps().getProperty("button.name.update")%>"
                                                                          normalButtonId="nbutton12" pressedButtonId="pbutton12"
                                                                          onMouseDown="press('nbutton12','pbutton12');"
                                                                          onMouseUp="press('pbutton12','nbutton12');submitForm();"
                                                                          onmouseout="press('pbutton12','nbutton12');"></app:button>                                                                      
                                                                     <%
                                                                     }
                                                                     %>
                                                                     </td>
                                                                     <td align="left">
                                                                     <app:button
                                                                          label="ViewTournaments"
                                                                          normalButtonId="nbutton13" pressedButtonId="pbutton13"
                                                                          onMouseDown="press('nbutton13','pbutton13');"
                                                                          onMouseUp="press('pbutton13','nbutton13');viewTournaments();"
                                                                          onmouseout="press('pbutton13','nbutton13');"></app:button>
                                                                </td>
                                                                          
                                                                </tr>
    
    
                                       </table>
                                       </td>
                                  </tr>
    
    
    
                             </table>
                             </td>
                        </tr>
                   </table>
                   </td>
              </tr>
         </table>
         </div>
         </div>
         <!--End of middle-->
    
    
    
    
    
    
         <div class="midbottomborder"><img src="images/midbottom.gif" /></div>
    
         </div>
         <!--end of middle zone--> <!--start of bottom zone-->
         <div class="bottomzone">
    
         <div class="bottomleft1"><img src="images/bottomback_01.gif" /></div>
    
         <div class="bottomleft2">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
    
              <tr>
                   <td width="50%" height="28" class="bottomlink">Copyright &copy;
                   2006 Play Game24X7 All rights reserved.</td>
                   <td width="53%">
                   <div align="right" class="bottomlink">Best view in
                   1024X768  </div>
                   </td>
              </tr>
         </table>
         </div>
    
         <div class="bottomleft3"><img src="images/bottomback_03.gif" /></div>
    
    
         </div>
         <!--end of bottom zone--></div>
         </body>
    </html:form>
    </html>
    This is jsp which has the save button and once i click on this the control goes to struts action and all those procedure...


    i am also pasting my DAO code which updates in the DB
    package com.games24X7.persistence.dao.impl.hibernate;
    
    import java.math.BigDecimal;
    import java.sql.Timestamp;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.Iterator;
    import java.util.LinkedHashSet;
    import java.util.List;
    import org.hibernate.type.TimestampType;
    import org.hibernate.type.Type;
    import com.games24X7.components.Globals;
    import com.games24X7.infra.logging.Logger;
    import com.games24X7.persistence.dao.ITIntoTournamentDAO;
    import com.games24X7.persistence.dto.hibernate.TIntoTournament;
    import com.games24X7.persistence.dto.hibernate.TIntrTrnmtRegistration;
    import com.games24X7.persistence.util.ListContainer;
    
    //import com.games24X7.persistence.util.Query;
    //import org.hibernate.Query;;
    public class TIntoTournamentDAO extends BaseDAO implements ITIntoTournamentDAO
    {
      /**
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#create(com.games24X7.persistence.dto.hibernate.TIntoTournament)
       */
         public TIntoTournament create(TIntoTournament entity)
           {
              System.out.println("DEBUGGING DAO********>"+entity.getUpdateOperId());
             entity.setCreateDate(new Timestamp(new Date().getTime()));
             entity.setUpdateOperId(entity.getCreateOperId());
             Long trnmtId = (Long) save(entity);
             entity.setTrnmntId(trnmtId);
             return entity;
           }
    
      /**
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#update(com.games24X7.persistence.dto.hibernate.TIntoTournament)
       */
      public TIntoTournament update(TIntoTournament entity)
      {
        assert (entity.getTrnmntId() != null && entity.getTrnmntId().longValue() != 0) : "Invalid trnmtId";
        TIntoTournament orig = (TIntoTournament) load(entity.getTrnmntId(),
            TIntoTournament.class);
            
        orig.setEntryFee(entity.getEntryFee());
        orig.setGamesPerMatch(entity.getGamesPerMatch());
        orig.setMaxPlayers(entity.getMaxPlayers());
        orig.setMinPlayers(entity.getMinPlayers());
        orig.setRegEndTime(entity.getRegEndTime());
        orig.setRegStartTime(entity.getRegStartTime());
        orig.setReleaseTime(entity.getReleaseTime());
        orig.setTimeBtwMatch(entity.getTimeBtwMatch());
        orig.setTimeBtwRound(entity.getTimeBtwRound());
        // orig.setTIngaGame(entity.getTIngaGame());
        orig.setTrnmtName(entity.getTrnmtName());
        orig.setTrnmtStartTime(entity.getTrnmtStartTime());
        orig.setUpdateDate(entity.getUpdateDate());
        orig.setUpdateOperId(entity.getUpdateOperId());
        super.update(orig);
        return entity;
      }
    
      /**
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#retrieve(java.lang.Long)
       */
      public TIntoTournament retrieve(Long trnmtId)
      {
        TIntoTournament tournament = (TIntoTournament) load(trnmtId,
            TIntoTournament.class);
        System.out.println("Tournament Type DAO" + tournament.getTournamentType());
        // Invoking the getter just to make sure that the
        // T_Inga_Game table data is also fetched
        tournament.getTIngaGame();
        return tournament;
      }
    
      public void delete(Long trnmtId)
      {
        TIntoTournament tournament = (TIntoTournament) load(trnmtId,
            TIntoTournament.class);
        // Invoking the getter just to make sure that the
        // T_Inga_Game table data is also fetched
        tournament.setDelI(Globals.DEL);
        super.update(tournament);
      }
    
      public ListContainer listSummaries (int startRow, int maxRows, String type)
      {
        ListContainer listContainer = new ListContainer();
        List list = null;
        List l = null;
        // Are we getting everything?
        boolean getAll = false;
        if (maxRows == -1)
        {
          getAll = true;
        }
        
        /*
         * final String sql = "SELECT tournament.tournamentId, tournament.trnmtName, " +
         * "tournament.releaseTime, tournament.regStartTime, " +
         * "tournament.regEndTime, tournament.trnmtStartTime, " + "tournament.delI " +
         * "FROM TIntoTournament tournament";
         */
        System.out.println("TYPE---->");
        if (type == null)
        {
             type="FIX_TIME";
        }
        
        
        final String sql = "FROM TIntoTournament tournament WHERE tournament.tournamentType ='" + type + "' order by tournament.trnmntId";
      
        System.out.println("TYPE---->" + type);
        // Query query = getQuery(sql.toString());
        /*
         * Query query = getHibernateQuery(sql.toString()); if (!getAll) {
         * query.setFirstResult(startRow - 1); query.setFetchSize(maxRows); }
         */
        // Iterator itor = query.execute().iterator();
        l = find(sql);
        System.out
            .println("$$$$VISHNU$$$$$Number of Tournaments in DB:" + l.size());
        Iterator itor = l.iterator();
        // Iterator itor = find(sql).iterator();
        if (itor != null && itor.hasNext())
        {
          list = new ArrayList();
          listContainer.setList(list);
        }
        int rowCount = 0;
        while (itor != null && itor.hasNext())
        {
          TIntoTournament tournament = (TIntoTournament) itor.next();
          if (tournament.getDelI().equals(Globals.DEL))
          {
            continue;
          }
          list.add(tournament);
          rowCount++;
        }
        // Setting the flag to denote whether there are more rows to be fetched
        if (!getAll)
        {
          if (rowCount == maxRows)
          {
            listContainer.setMoreData(true);
          }
        }
        return listContainer;
      }
    
      /*
       * (non-Javadoc)
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#getMaxPlayers(java.lang.Long)
       */
      public int getMaxPlayers(Long trnmntId)
      {
        final String sql = "SELECT tournament.maxPlayers FROM "
            + "TIntoTournament tournament WHERE tournament.trnmntId = " + trnmntId;
        Iterator itor = find(sql).iterator();
        return ((BigDecimal) itor.next()).intValue();
      }
    
      public ListContainer getTournamentsByStartTimeBetween(Timestamp t1,
          Timestamp t2)
      {
        assert (t1 != null && t2 != null) : "Input argument(s) is null";
        List list = new ArrayList();
        ListContainer container = new ListContainer();
        final String query = "SELECT tournament.trnmntId, tournament.gamesPerMatch, "
            + "tournament.trnmtStartTime, tournament.timeBtwRound, "
            + "tournament.timeBtwMatch, "
            + "registration.userId, registration.regId "
            + "FROM TIntoTournament tournament, TIntrTrnmtRegistration registration "
            + "WHERE tournament.trnmntId = registration.TIntoTournament.trnmntId "
            + "AND tournament.trnmtStartTime > ? AND tournament.trnmtStartTime <= ? "
            + "AND tournament.delI = 'N' AND registration.waitListInd = 'N' "
            + "ORDER BY tournament.trnmntId, tournament.trnmtStartTime, registration.timeOfReg";
        Logger.debug(this, "query = " + query);
        Object[] values = { t1, t2 };
        Type[] types = { new TimestampType(), new TimestampType() };
        long[] start = new long[1];
        Logger.timeStart(this, "Query Execution", start);
        Iterator itor = _manager.find(query, values, types).iterator();
        TIntoTournament tournament = null;
        LinkedHashSet registrations = null;
        TIntrTrnmtRegistration registration = null;
        Long trnmntId = null;
        Long nextTrnmntId = null;
        Logger.debug(this, "Loop begins");
        while (itor.hasNext())
        {
          Logger.debug(this, "Iteration begins-------->");
          Object[] tuples = (Object[]) itor.next();
          nextTrnmntId = (Long) tuples[0];
          if (trnmntId == null || !trnmntId.equals(nextTrnmntId))
          {
            registrations = new LinkedHashSet();
            tournament = new TIntoTournament();
            tournament.setTIntrTrnmtRegistrations(registrations);
            list.add(tournament);
            trnmntId = (Long) tuples[0];
            tournament.setTrnmntId(trnmntId);
            tournament.setGamesPerMatch((BigDecimal) tuples[1]);
            tournament.setTrnmtStartTime((Timestamp) tuples[2]);
            tournament.setTimeBtwRound((BigDecimal) tuples[3]);
            tournament.setTimeBtwMatch((BigDecimal) tuples[4]);
            Logger.debug(this, "tournamentId = " + trnmntId);
            Logger.debug(this, "gamesPerMatch = " + tournament.getGamesPerMatch());
            Logger
                .debug(this, "trnmtStartTime = " + tournament.getTrnmtStartTime());
            Logger.debug(this, "timeBtwRound = " + tournament.getTimeBtwRound());
            Logger.debug(this, "timeBtwMatch = " + tournament.getTimeBtwMatch());
          }
          registration = new TIntrTr                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
  • 9. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    i know its a lottttttt of code.. but i dont ve any option other than to paste it.. if u want me to edit the CSS part tell me i will remove those and paste


    thankx
  • 10. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    got confused?
    well the same for me.. hehe...

    if u got any suggestions.. pls msg...

    thankx
  • 11. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    Please post more code.
  • 12. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    wat? r u in funny mood?

    i know therz lot of code.. well i am editing those and pasting new set of code



    THE FOLLOWING IS THE SET OF CODE FOR UPDATE,RETRIEVE,DELETE AND CREATE in DAO
    public class TIntoTournamentDAO extends BaseDAO implements ITIntoTournamentDAO
    {
      /**
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#create(com.games24X7.persistence.dto.hibernate.TIntoTournament)
       */
         public TIntoTournament create(TIntoTournament entity)
           {
              System.out.println("DEBUGGING DAO********>"+entity.getUpdateOperId());
             entity.setCreateDate(new Timestamp(new Date().getTime()));
             entity.setUpdateOperId(entity.getCreateOperId());
             Long trnmtId = (Long) save(entity);
             entity.setTrnmntId(trnmtId);
             return entity;
           }
    
      /**
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#update(com.games24X7.persistence.dto.hibernate.TIntoTournament)
       */
      public TIntoTournament update(TIntoTournament entity)
      {
        assert (entity.getTrnmntId() != null && entity.getTrnmntId().longValue() != 0) : "Invalid trnmtId";
        TIntoTournament orig = (TIntoTournament) load(entity.getTrnmntId(),
            TIntoTournament.class);
            
        orig.setEntryFee(entity.getEntryFee());
        orig.setGamesPerMatch(entity.getGamesPerMatch());
        orig.setMaxPlayers(entity.getMaxPlayers());
        orig.setMinPlayers(entity.getMinPlayers());
        orig.setRegEndTime(entity.getRegEndTime());
        orig.setRegStartTime(entity.getRegStartTime());
        orig.setReleaseTime(entity.getReleaseTime());
        orig.setTimeBtwMatch(entity.getTimeBtwMatch());
        orig.setTimeBtwRound(entity.getTimeBtwRound());
        orig.setTIngaGame(entity.getTIngaGame());
        orig.setTrnmtName(entity.getTrnmtName());
        orig.setTrnmtStartTime(entity.getTrnmtStartTime());
        orig.setUpdateDate(entity.getUpdateDate());
        orig.setUpdateOperId(entity.getUpdateOperId());
        super.update(orig);
        return entity;
      }
    
      /**
       * @see com.games24X7.persistence.dao.ITIntoTournamentDAO#retrieve(java.lang.Long)
       */
      public TIntoTournament retrieve(Long trnmtId)
      {
        TIntoTournament tournament = (TIntoTournament) load(trnmtId,
            TIntoTournament.class);
        System.out.println("Tournament Type DAO" + tournament.getTournamentType());
        // Invoking the getter just to make sure that the
        // T_Inga_Game table data is also fetched
        tournament.getTIngaGame();
        return tournament;
      }
    
      public void delete(Long trnmtId)
      {
        TIntoTournament tournament = (TIntoTournament) load(trnmtId,
            TIntoTournament.class);
        // Invoking the getter just to make sure that the
        // T_Inga_Game table data is also fetched
        tournament.setDelI(Globals.DEL);
        super.update(tournament);
      }
  • 13. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    wat happ? no idea abt wat i am talking?

    how to get the value in the same jsp in which u ve clicked update and it has also updated ur DB....
    i want the updated data to be displayed in the same screen...
  • 14. Re: NULL value gettin generated even after gettin updated in DB,
    807603 Newbie
    Currently Being Moderated
    thankx.. prob fixed anyways thankx