How to convert resultset variable to integer variable

hii..i am making a jsp page in which i get the name of the product from the available products in the database and i give the quantity of the product from the jsp page which get stored in the database.Now the problem is when i give I want that only the product which i want come to the screen from the available products..for this i had made a combobox which selects the next item I want,but it is not working.Can anyone help me out.I am wriiting the code which I have written,Although it's not working.
<%@page language="java"%>
<%@page import="java.sql.*"%>
<%@page import="connect.connection"%>
<%
String productId = request.getParameter("pname")==null? "": request.getParameter("pname");
String strQuantity="";
%>
<%
     Connection con1=null;
     connection conn1=null;
     con1=conn1.getconnection();
     Statement st=null;
     ResultSet rs=null;
     st=con1.createStatement();
%>
<!--<script>
function subject()
document.registration.action="buyerForm2.jsp";
//document.registration.submit();
</script>-->
<HTML>
<HEAD>
<TITLE>Shree Cement : Register Buyer</TITLE>
<script language="javascript" src="../js/buyervalidate.js"></script>
</HEAD>
<body bgColor=3F7790 text=#000000 topMargin=12 border="0">
<!-- Begin header section -->
<jsp:include page="../header/header.jsp" />
<!-- End header section -->
<table width="800" align="center" border="0">
<tr>
<td bgcolor="#EBEBEB" width="135" valign="top">
     <!--Begin left nav section-->
          <jsp:include page="../include/left-nav-main.jsp" />
          <!-- End left nav section-->
</td>
<!--main section of pp Buyer-->
     <br>
<td rowspan=7 valign=top width="58%" align="center">
     <table>
                    <tr>
                    <td class="img">Registration Form</td>
<td width="60%"></td>
<td align="left" class="img1">Buyer</td>
                    </tr>
     </table>
<form name="login" method="post">
<table cellpadding=3 class="pp">
<tr>
<td>Online bid date :</td>
<td colspan=3 >
<select name="monthonline" class="formfield1" value="month" >
<option value="Month">-Month-
<option value=1> January
<option value=2>February
<option value=3>March
<option value=4>April
<option value=5> May
<option value=6> June
<option value=7> July
<option value=8> August
<option value=9> September
<option value=10> October
<option value=11> November
<option value=12> December
</select>
          </td>
               <td colspan=3 >
<select name="dateonline" class="formfield1" value="date">
<option value="Day">-Day-
<option value=1>1
<option value=2>2
<option value=3>3
<option value=4>4
<option value=5>5
<option value=6>6
<option value=7>7
<option value=8>8
<option value=9>9
<option value=10>10
<option value=11>11
<option value=12>12
<option value=13>13
<option value=14>14
<option value=15>15
<option value=16>16
<option value=17>17
<option value=18>18
<option value=19>19
<option value=20>20
<option value=21>21
<option value=22>22
<option value=23>23
<option value=24>24
<option value=25>25
<option value=26>26
<option value=27>27
<option value=28>28
<option value=29>29
<option value=30>30
<option value=31>31
</select>
               </td>
               <td >
<select name="yearonline" class="formfield1" value="year" align="left">
<option value="Year">-Year-
<option value=2003>2003
<option value=2004>2004
<option value=2005>2005
<option value=2006>2006
<option value=2007>2007
<option value=2008>2008
<option value=2009>2009
<option value=2010>2010
</select>
</td>
</tr>
<tr>
<td>Start time :</td>
<td colspan=3 width="296">
<select name="starttime" class="formfield1" size=1>
<option selected value="08:00:00">8 : 00 am
<option value="08:15:00">8 : 15 am
<option value="08:30:00">8 : 30 am
<option value="08:45:00">8 : 45 am
<option value="09:00:00">9 : 00 am
<option value="09:15:00">9 : 15 am
<option value="09:30:00">9 : 30 am
<option value="09:45:00">9 : 45 am
<option value="10:00:00">10 : 00 am
<option value="10:15:00">10 : 15 am
<option value="10:30:00">10 : 30 am
<option value="10:45:00">10 : 45 am
<option value="11:00:00">11 : 00 am
<option value="11:15:00">11 : 15 am
<option value="11:30:00">11 : 30 am
<option value="11:45:00">11 : 45 am
<option value="12:00:00">12 : 00 pm
<option value="12:15:00">12 : 15 pm
<option value="12:30:00">12 : 30 pm
<option value="12:45:00">12 : 45 pm
<option value="13:00:00">1 : 00 pm
<option value="13:15:00">1 : 15 pm
<option value="13:30:00">1 : 30 pm
<option value="13:45:00">1 : 45 pm
<option value="14:00:00">2 : 00 pm
<option value="14:15:00">2 : 15 pm
<option value="14:30:00">2 : 30 pm
<option value="14:45:00">2 : 45 pm
<option value="15:00:00">3 : 00 pm
<option value="15:15:00">3 : 15 pm
<option value="15:30:00">3 : 30 pm
<option value="15:45:00">3 : 45 pm
<option value="16:00:00">4 : 00 pm
<option value="16:15:00">4 : 15 pm
<option value="16:30:00">4 : 30 pm
<option value="16:45:00">4 : 45 pm
<option value="17:00:00">5 : 00 pm
<option value="17:15:00">5 : 15 pm
<option value="17:30:00">5 : 30 pm
<option value="17:45:00">5 : 45 pm
<option value="18:00:00">6 : 00 pm
<option value="18:15:00">6 : 15 pm
<option value="18:30:00">6 : 30 pm
<option value="18:45:00">6 : 45 pm
<option value="19:00:00">7 : 00 pm
<option value="19:15:00">7 : 15 pm
<option value="19:30:00">7 : 30 pm
<option value="19:45:00">7 : 45 pm
<option value="20:00:00">8 : 00 pm
</select>
</td>
</tr>
<tr>
<td>End
time :</td>
<td colspan=3 width="296">
<select name="endtime" class="formfield1" size=1><br>
<option selected value="08:00:00">8 : 00 am
<option value="08:15:00">8 : 15 am
<option value="08:30:00">8 : 30 am
<option value="08:45:00">8 : 45 am
<option value="09:00:00">9 : 00 am
<option value="09:15:00">9 : 15 am
<option value="09:30:00">9 : 30 am
<option value="09:45:00">9 : 45 am
<option value="10:00:00">10 : 00 am
<option value="10:15:00">10 : 15 am
<option value="10:30:00">10 : 30 am
<option value="10:45:00">10 : 45 am
<option value="11:00:00">11 : 00 am
<option value="11:15:00">11 : 15 am
<option value="11:30:00">11 : 30 am
<option value="11:45:00">11 : 45 am
<option value="12:00:00">12 : 00 pm
<option value="12:15:00">12 : 15 pm
<option value="12:30:00">12 : 30 pm
<option value="12:45:00">12 : 45 pm
<option value="13:00:00">1 : 00 pm
<option value="13:15:00">1 : 15 pm
<option value="13:30:00">1 : 30 pm
<option value="13:45:00">1 : 45 pm
<option value="14:00:00">2 : 00 pm
<option value="14:15:00">2 : 15 pm
<option value="14:30:00">2 : 30 pm
<option value="14:45:00">2 : 45 pm
<option value="15:00:00">3 : 00 pm
<option value="15:15:00">3 : 15 pm
<option value="15:30:00">3 : 30 pm
<option value="15:45:00">3 : 45 pm
<option value="16:00:00">4 : 00 pm
<option value="16:15:00">4 : 15 pm
<option value="16:30:00">4 : 30 pm
<option value="16:45:00">4 : 45 pm
<option value="17:00:00">5 : 00 pm
<option value="17:15:00">5 : 15 pm
<option value="17:30:00">5 : 30 pm
<option value="17:45:00">5 : 45 pm
<option value="18:00:00">6 : 00 pm
<option value="18:15:00">6 : 15 pm
<option value="18:30:00">6 : 30 pm
<option value="18:45:00">6 : 45 pm
<option value="19:00:00">7 : 00 pm
<option value="19:15:00">7 : 15 pm
<option value="19:30:00">7 : 30 pm
<option value="19:45:00">7 : 45 pm
<option value="20:00:00">8 : 00 pm
</select>
</td>
</tr>
          </table>
          <table class="log" cellpadding=3 cellspacing=0 border="0">
     <% String strname="";
          rs=st.executeQuery("select name from product");
          if(rs.next())
strname=rs.getString(1);
%>
          <tr>     
          <td align="left"><%=strname%></td>
          <td></td>
<td>Quantity(in lacs):</td>
<td><input type="text" class="formfield" name="items2" onkeypress="if(event.keyCode >47 && event.keyCode < 58){event.returnValue = true;} else{event.returnValue = false;}"></td>
          </tr>
          <tr>          
<td>Select Product Name :</td>
          <td></td>
<td>
<select name="pname"><option>select</option>
          <%
                    String username="";
                    rs=st.executeQuery("select name from product");
                    while(rs.next())
username = rs.getString(1);
          %>
<option <%if(productId.equals(username)){%> <%}%>><%=username%></option>
<% } %>
          </select>
          </td>
</tr>
          <%          
                    int count=1;
                    rs=st.executeQuery("select max(auction_id) from auction1");
     int num = Integer.parseInt(pageContext.findAttribute("num").toString());
                    out.println(num);
                    //for(count=1;count < num;count++)
                         //out.println(rs);
                    String name="";          
                         rs=st.executeQuery("select name from product where name='"+username+"'");
                         //out.println(rs);
                         if(rs.next())
                              name=rs.getString(1);
                         if(name.equals(username))
                         {%>
                              <tr>
                              <td align="left"><%=name%></td>
                              <td>Quantity(in lacs):</td>
                              <td><input type="text" class="formfield" name="items2" onkeypress="if(event.keyCode > 47 && event.keyCode < 58){event.returnValue = true;} else{event.returnValue = false;}"></td>
                              </tr>
          <%}
          %>
</table>
          <table cellpadding="5" align="center" bgcolor=#FFFFFF width="397">
<tr>
               <td>
                    <input type="submit" value="Add more Items" onClick="add();">
               </td>
               <td width="115"align="right">
                    <input type="submit" value="Continue"onClick="return validate();" name="submit">
               </td>
<td>
                    <input type="reset" value="Clear all fields" name="reset">
</td>
</tr>
</table>
     </form>               
</td>
<!-- End Main section -->
<td width="23%" valign="top" bgcolor="#EBEBEB" border="0">
     <!--Begin right nav section-->
          <jsp:include page="../include/rightbar2.jsp" />          
          <!-- End right nav section -->
          </td>
<!-- Begin footer section -->
<jsp:include page="../footer/footer.jsp" />
<!-- End footer section -->

It's highly recommended to use any business, logic and DB access tasks in a Servlet. JSP should be used only to display HTML forms/results.
<%@page language="java"%>
<%@page import="java.sql.*"%>
<%@page import="connect.connection"%>
<% String productId = request.getParameter("pname")==null? "": request.getParameter("pname"); String strQuantity=""; %>
<% Connection con1=null; connection conn1=null; con1=conn1.getconnection(); Statement st=null; ResultSet rs=null; st=con1.createStatement(); %>
<!--<script> function subject() { document.registration.action="buyerForm2.jsp"; //document.registration.submit(); } </script>-->
<HTML>
<HEAD>
<TITLE>Shree Cement : Register Buyer</TITLE>
<script language="javascript" src="../js/buyervalidate.js"></script>
</HEAD>
<body bgColor=3F7790 text=#000000 topMargin=12 border="0">
<!-- Begin header section -->
<jsp:include page="../header/header.jsp" />
<!-- End header section -->
<table width="800" align="center" border="0">
     <tr>
          <td bgcolor="#EBEBEB" width="135" valign="top"><!--Begin left nav section--> <jsp:include
               page="../include/left-nav-main.jsp" /> <!-- End left nav section--></td>
          <!--main section of pp Buyer-->
          <td rowspan=7 valign=top width="58%" align="center">
          <table>
               <tr>
                    <td class="img">Registration Form</td>
                    <td width="60%"></td>
                    <td align="left" class="img1">Buyer</td>
               </tr>
          </table>
          <form name="login" method="post">
          <table cellpadding=3 class="pp">
               <tr>
                    <td>Online bid date :</td>
                    <td colspan=3><select name="monthonline" class="formfield1" value="month">
                         <option value="Month">-Month-
                         <option value=1>January
                         <option value=2>February
                         <option value=3>March
                         <option value=4>April
                         <option value=5>May
                         <option value=6>June
                         <option value=7>July
                         <option value=8>August
                         <option value=9>September
                         <option value=10>October
                         <option value=11>November
                         <option value=12>December
                    </select></td>
                    <td colspan=3><select name="dateonline" class="formfield1" value="date">
                         <option value="Day">-Day-
                         <option value=1>1
                         <option value=2>2
                         <option value=3>3
                         <option value=4>4
                         <option value=5>5
                         <option value=6>6
                         <option value=7>7
                         <option value=8>8
                         <option value=9>9
                         <option value=10>10
                         <option value=11>11
                         <option value=12>12
                         <option value=13>13
                         <option value=14>14
                         <option value=15>15
                         <option value=16>16
                         <option value=17>17
                         <option value=18>18
                         <option value=19>19
                         <option value=20>20
                         <option value=21>21
                         <option value=22>22
                         <option value=23>23
                         <option value=24>24
                         <option value=25>25
                         <option value=26>26
                         <option value=27>27
                         <option value=28>28
                         <option value=29>29
                         <option value=30>30
                         <option value=31>31
                    </select></td>
                    <td><select name="yearonline" class="formfield1" value="year" align="left">
                         <option value="Year">-Year-
                         <option value=2003>2003
                         <option value=2004>2004
                         <option value=2005>2005
                         <option value=2006>2006
                         <option value=2007>2007
                         <option value=2008>2008
                         <option value=2009>2009
                         <option value=2010>2010
                    </select></td>
               </tr>
               <tr>
                    <td>Start time :</td>
                    <td colspan=3 width="296"><select name="starttime" class="formfield1" size=1>
                         <option selected value="08:00:00">8 : 00 am
                         <option value="08:15:00">8 : 15 am
                         <option value="08:30:00">8 : 30 am
                         <option value="08:45:00">8 : 45 am
                         <option value="09:00:00">9 : 00 am
                         <option value="09:15:00">9 : 15 am
                         <option value="09:30:00">9 : 30 am
                         <option value="09:45:00">9 : 45 am
                         <option value="10:00:00">10 : 00 am
                         <option value="10:15:00">10 : 15 am
                         <option value="10:30:00">10 : 30 am
                         <option value="10:45:00">10 : 45 am
                         <option value="11:00:00">11 : 00 am
                         <option value="11:15:00">11 : 15 am
                         <option value="11:30:00">11 : 30 am
                         <option value="11:45:00">11 : 45 am
                         <option value="12:00:00">12 : 00 pm
                         <option value="12:15:00">12 : 15 pm
                         <option value="12:30:00">12 : 30 pm
                         <option value="12:45:00">12 : 45 pm
                         <option value="13:00:00">1 : 00 pm
                         <option value="13:15:00">1 : 15 pm
                         <option value="13:30:00">1 : 30 pm
                         <option value="13:45:00">1 : 45 pm
                         <option value="14:00:00">2 : 00 pm
                         <option value="14:15:00">2 : 15 pm
                         <option value="14:30:00">2 : 30 pm
                         <option value="14:45:00">2 : 45 pm
                         <option value="15:00:00">3 : 00 pm
                         <option value="15:15:00">3 : 15 pm
                         <option value="15:30:00">3 : 30 pm
                         <option value="15:45:00">3 : 45 pm
                         <option value="16:00:00">4 : 00 pm
                         <option value="16:15:00">4 : 15 pm
                         <option value="16:30:00">4 : 30 pm
                         <option value="16:45:00">4 : 45 pm
                         <option value="17:00:00">5 : 00 pm
                         <option value="17:15:00">5 : 15 pm
                         <option value="17:30:00">5 : 30 pm
                         <option value="17:45:00">5 : 45 pm
                         <option value="18:00:00">6 : 00 pm
                         <option value="18:15:00">6 : 15 pm
                         <option value="18:30:00">6 : 30 pm
                         <option value="18:45:00">6 : 45 pm
                         <option value="19:00:00">7 : 00 pm
                         <option value="19:15:00">7 : 15 pm
                         <option value="19:30:00">7 : 30 pm
                         <option value="19:45:00">7 : 45 pm
                         <option value="20:00:00">8 : 00 pm
                    </select></td>
               </tr>
               <tr>
                    <td>End time :</td>
                    <td colspan=3 width="296"><select name="endtime" class="formfield1" size=1>
                         <option selected value="08:00:00">8 : 00 am
                         <option value="08:15:00">8 : 15 am
                         <option value="08:30:00">8 : 30 am
                         <option value="08:45:00">8 : 45 am
                         <option value="09:00:00">9 : 00 am
                         <option value="09:15:00">9 : 15 am
                         <option value="09:30:00">9 : 30 am
                         <option value="09:45:00">9 : 45 am
                         <option value="10:00:00">10 : 00 am
                         <option value="10:15:00">10 : 15 am
                         <option value="10:30:00">10 : 30 am
                         <option value="10:45:00">10 : 45 am
                         <option value="11:00:00">11 : 00 am
                         <option value="11:15:00">11 : 15 am
                         <option value="11:30:00">11 : 30 am
                         <option value="11:45:00">11 : 45 am
                         <option value="12:00:00">12 : 00 pm
                         <option value="12:15:00">12 : 15 pm
                         <option value="12:30:00">12 : 30 pm
                         <option value="12:45:00">12 : 45 pm
                         <option value="13:00:00">1 : 00 pm
                         <option value="13:15:00">1 : 15 pm
                         <option value="13:30:00">1 : 30 pm
                         <option value="13:45:00">1 : 45 pm
                         <option value="14:00:00">2 : 00 pm
                         <option value="14:15:00">2 : 15 pm
                         <option value="14:30:00">2 : 30 pm
                         <option value="14:45:00">2 : 45 pm
                         <option value="15:00:00">3 : 00 pm
                         <option value="15:15:00">3 : 15 pm
                         <option value="15:30:00">3 : 30 pm
                         <option value="15:45:00">3 : 45 pm
                         <option value="16:00:00">4 : 00 pm
                         <option value="16:15:00">4 : 15 pm
                         <option value="16:30:00">4 : 30 pm
                         <option value="16:45:00">4 : 45 pm
                         <option value="17:00:00">5 : 00 pm
                         <option value="17:15:00">5 : 15 pm
                         <option value="17:30:00">5 : 30 pm
                         <option value="17:45:00">5 : 45 pm
                         <option value="18:00:00">6 : 00 pm
                         <option value="18:15:00">6 : 15 pm
                         <option value="18:30:00">6 : 30 pm
                         <option value="18:45:00">6 : 45 pm
                         <option value="19:00:00">7 : 00 pm
                         <option value="19:15:00">7 : 15 pm
                         <option value="19:30:00">7 : 30 pm
                         <option value="19:45:00">7 : 45 pm
                         <option value="20:00:00">8 : 00 pm
                    </select></td>
               </tr>
          </table>
          <table class="log" cellpadding=3 cellspacing=0 border="0">
               <%      String strname="";
                    rs=st.executeQuery("select name from product");
                    if(rs.next()) {
                         strname=rs.getString(1);
               %>
               <tr>
                    <td align="left"><%=strname%></td>
                    <td></td>
                    <td>Quantity(in lacs):</td>
                    <td><input type="text" class="formfield" name="items2"
                         onkeypress="if(event.keyCode >47 && event.keyCode < 58){event.returnValue = true;} else{event.returnValue = false;}"></td>
               </tr>
               <tr>
                    <td>Select Product Name :</td>
                    <td></td>
                    <td><select name="pname">
                         <option>--select--</option>
                         <%
                              String username="";
                              rs=st.executeQuery("select name from product");
                              while(rs.next()) { username = rs.getString(1); %>
                              <option>
                                   <%if(productId.equals(username)){%>
                                   <%}%>
                                   <%=username%>
                                   </option>
                         <% } %>
                    </select></td>
               </tr>
               <%
                    int count=1;
                    rs=st.executeQuery("select max(auction_id) from auction1");
                    int num = Integer.parseInt(pageContext.findAttribute("num").toString());
                    out.println(num);
                    //for(count=1;count < num;count++) //{ //out.println(rs); String name=""; rs=st.executeQuery("select name from product where name='"+username+"'"); //out.println(rs); if(rs.next()) { name=rs.getString(1); } //} if(name.equals(username)) {
               %>
               <tr>
                    <td align="left"><%=num%></td>
                    <td>Quantity(in lacs):</td>
                    <td><input type="text" class="formfield" name="items2"
                         onkeypress="if(event.keyCode > 47 && event.keyCode < 58){event.returnValue = true;} else{event.returnValue = false;}"></td>
               </tr>
          </table>
          <table cellpadding="5" align="center" bgcolor=#FFFFFF width="397">
               <tr>
                    <td><input type="submit" value="Add more Items" onClick="add();"></td>
                    <td width="115" align="right"><input type="submit" value="Continue" onClick="return validate();" name="submit">
                    </td>
                    <td><input type="reset" value="Clear all fields" name="reset"></td>
               </tr>
          </table>
          </form>
          </td>
          <!-- End Main section -->
          <td width="23%" valign="top" bgcolor="#EBEBEB" border="0"><!--Begin right nav section-->
          <jsp:include page="../include/rightbar2.jsp" /> <!-- End right nav section --></td>
          <!-- Begin footer section -->
          <jsp:include page="../footer/footer.jsp" />
          <!-- End footer section -->

Similar Messages

  • How to convert DATE variable to CHAR variable

    dear all,
    How to convert DATE variable to CHAR variable
    thanq

    Depending on your final goal here are 2 options.
    DATA: datein        TYPE d.
    DATA: dateout(10)   TYPE c.
    DATA: dateout2(8)   TYPE c.
    datein = sy-datum.
    WRITE datein TO dateout MM/DD/YYYY.
    dateout2 = datein.
    WRITE:/ datein, dateout, dateout2.
    and the output
    05022008 05/02/2008 20080502    

  • How to convert string to an integer in SQL Server 2008

    Hi All,
    How to convert string to an integer in sql server,
    Input : string str="1,2,3,5"
    Output would be : 1,2,3,5
    Thanks in advance.
    Regards,
    Sunil

    No, you cannot convert to INT and get 1,2,3 BUT you can get
    1
    2
    3
    Is it ok?
    CREATE FUNCTION [dbo].[SplitString]
             @str VARCHAR(MAX)
        RETURNS @ret TABLE (token VARCHAR(MAX))
         AS
         BEGIN
        DECLARE @x XML 
        SET @x = '<t>' + REPLACE(@str, ',', '</t><t>') + '</t>'
        INSERT INTO @ret
            SELECT x.i.value('.', 'VARCHAR(MAX)') AS token
            FROM @x.nodes('//t') x(i)
        RETURN
       END
    ----Usage
    SELECT * FROM SplitString ('1,2,3')
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to convert ResultSet's value to String

    Dear JDC's
    plz tell me how to convert ResultSet's value to String.
    kashif

    I want to read a whole array from a table into a String[]
    and then send it to another servlet before I forward it all to anther servlet with request.setParameter.....
    Any ideas how to solve it....that is how far I got so far:
    rs=pgresult("select count (answer) from answers where qid="+idnum);
                                                           numberofquestions = rs.getInt("mynumber");     
                                                           rs=pgresult("SELECT answer FROM answers WHERE qgroup="+qgroup);
                                                           allanswers = new String[numberofquestions];
                                                           allanswers = (String[])rs.getArray(1).getArray();     
                                                           req.setParameter("allanswers",allanswers);
                                                           RequestDispatcher dispatcher = req.getRequestDispatcher("editanswers");
                                                           dispatcher.forward(req,res);
    Tobi

  • How to convert from java.lang.Integer to int

    Could you please show me
    how to convert from java.lang.Integer to int?
    and how to convert from java.lang.Integer to String?
    Thanks,
    Minh

    Could you please show me
    how to convert from java.lang.Integer to int?
    and how to convert from java.lang.Integer to String?Tip: always keep a browser open on the API docs; if you've got a
    couple of MBs to spare, download the docs; it's very convenient.
    kind regards,
    Jos

  • Proc C - How to convert datetime variable in Proc C into C?

    Hi,
    Does anyone know how to convert a datetime variable in Pro C into C?
    For Example,
    Order_Table with OrderId and OrderDate fields.
    How do I compare the OrderDate with the system datetime in Pro C or C?
    Thank you.

    Maybe this will help:
    http://asktom.oracle.com/~tkyte/Misc/CTime.html

  • How to convert a double to integer ?

    Hi,
    how do convert an output of a pow(2,n) method of Math class to integer. Since this pow(x double, y bouble) gives an output of type double, how do i convert this output to integer if i want the value returned as an integer ?
    thanks
    aron

    By casting (but note that this may not yield the results you want)...
    class Test {
         public static void main(String[] argv) {
              double a = 5.5;
              double b = 6.6;
              int c = (int)(a + b);
              System.out.println(c);
    }

  • How to convert ResultSet of MySQL to XML

    How can we convert ResultSet of MySQL using Hibernate into XML packet for JSP?

    maybe something like this
    http://beansource.sourceforge.net

  • How to convert a varchar to integer datatype in obiee Answers?

    Hi Gurus,
    I tried using cast to convert a varchar to integer type eg.
    cast (column as integer) in fx in answers but its not working.
    Can we use to_number function in answers?
    Also do we have any other way of changing the datatype of a column rather than changing it in
    Physical layer of the rpd.
    Thanks
    Ashish Gupta

    Always first choice should be BI instead of porting a function on DB side.
    As Lakshmipathi said do that.
    It would be always nice to share what you see instead of "Not working"
    have fun

  • How to convert the Variable with soap header to non soap variable.

    I am working on a customized flow simialr to ProcessSalesorderFulfillmentJMSCOnsumer and Requestor ABCS. I dont have the PIP codes for the Requestor adn JMS Consumer. i built my own Requester ABCS and JMS Consumer. When i am trying to send message from JMS Consumer to Requestor ABCS in a variable with a SOAP:Env and SOAP:body inside.
    Becoz of this i was not able to put a condition in my bpel flows. If i put a condtion on this variable like switch inputvariable:part:OrderType='NEW' and it was failing with selection failure. I tried copying the variable to a new variable and then to check the condition still it does not work for me. How do i convert the SOAP Message Variable to Non SOAP Message Variable.
    Can i know the message put by SIebel in JMS Queue was it SOAP converted adn then how they are going to handle in Process Sales order Requestor ABCS.

    HI,
    In JMS Consumer of order to cash pip, Instead of using a schema reference they use a Envolpe.zxsd file which will take care of conversion adn then other artibutes are mapped in a transformation file.
    Please take an export of jms consumer in jdeveloper and reverse engineer the code of JMS COnsumer Service.
    Envelope_To_ListOfSWIOrderIO is the xsl whcih converts the message in AIA Queue to a message in a SOAP. Please look into the transformation.
    Thanks,
    Venugopal sss Raja

  • How to convert ASCII to an integer number??

    Here I am trying to send the number 1000000 from microcontroller through UART and I am recieving the ASCII in labview. But i would like to get exact 1000000 in labview too. So i am trying to convert ASCII to integer but i am unable to do that.
    Solved!
    Go to Solution.

    danil33 wrote:
    Hello mallik,
                       Please don't feel bad.Smercurio and all other experts are trying to make us to do things by our own.THis will make us experts in labview.Thats why he told you to go through the tutorials.I have heard such type of advice(sometimes they scold us) so many times.Still Iam hearingIt is our fault that we won't go through the tutorials properly.Don't get annoyed.
    Besides, the question is quite unclear formulated and makes me almost assume, that the OP hasn't even bothered to look for a solution himself. Since the OP receives a string it would be logical to look in the String palette for some function to do what he wants. And inside that palette there is magically a String/Number Conversion palette, which sounds almost like it could contain at least one function that could do the right thing. (In fact it contains 3 that could work, but I'm sure the OP can find the most logical one for his number easlily).
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to convert an Object into integer?

    Ho can v convert an object of type Object into integer data type?
    Object obj = null;
    integer int = _____________;
    plz do fill it up and help ASAP......

    Fortunately, Gosling was able to predict that his
    language would produce exceptions, so he gave usthe
    catch block, so we can magically make them goaway:
    > catch (Exception exc) {}You are
    probably not without knowing that empty catch blocks
    are considered to be bad practice.
    You should better do the following
    :catch(Exception exc) {
    throw new RuntimeException();
    ode]You turned your sarcasm detector off or something?? :-)

  • How to convert Date to Integer

    Hi all,
    please send the code How to convert the Date to Integer
    I want like this
    example: Date= 04.11.2002 after conversion the integer is: 4112002
    like this I want if anyone knows this please send it as soon as possible
    byee
    thanks

    Assuming ... String ASimpleDateFormat;
    // do this first
    ASimpleDateFormat = ASimpleDateFormat.replace(".","");
    // then parse
    int DateAsInt = Integer.parseInt(ASimpleDateFormat);

  • How to store resultset value to  Some other variable

    ResultSet rset1=stmt1.executeQuery("SELECT count(*) FROM
    user_details_table" );
    while(rset1.next())
    System.out.println("No.of Connected Users In UserDetails Table: " + rset1.getInt(1));
    int x=rset1.getInt(1);
    to store tht resultset value into integer variable.Bt tht statement is giving error. Pls help me.
    Thanks....

    try
    ResultSet rset1=stmt1.executeQuery("SELECT count(*) FROM
    user_details_table" );
    while(rset1.next())
    int x=rset1.getInt(1);
    System.out.println("No.of Connected Users In UserDetails Table: " + x);
    }

  • How can I convert the variable expression stored as string back to variable expression

    How can I convert the variable expression stored as string back to variable expression?
    I am storing the expression enterd in the TSExpresssionEditControl as simple string and want to convert back to expression since I want to get the data type of that expression.

    pritam,
    I'm not sure what you're trying to do exactly. If you are trying to get the value of a variable and you only have the name of value in a string, then you can use Evaluate() to get its value. If you want the data type, my advise is to use the GetPropertyObject() API method and just pass in the loop up string. Then you'll have a handle to the data object and then proceed from there.
    Regards,
    Song D
    Application Engineer
    National Instrument
    Regards,
    Song Du
    Systems Software
    National Instruments R&D

Maybe you are looking for

  • What cables do I need to connect my MBA to a TV?

    I would like to connect my Macbook Air to a new 47" Vizio TV.  It is a 1080p, and has several open HDMI ports.  Will a Mini Display to HDMI adapter  send video and audio?

  • Re: How to have an out going message for voicemail

    Hi there, I have a Surface 8.1 RT tablet and I am trying to set up VM. The instructions say to go to the Menu Bar, but I do not have one (or don't know where it is) in my version of Skype 3.1.0.1005. I have swiped in and up and looked through everyth

  • Transaction code to show previous tcodes used

    Hi all, Gud morning... Is there any transaction code to view all the tcodes used by us?

  • Moving stills from video to iPhoto

    I have been using iMovie 6.0.3 and captured some stills from my vidoe and was able to drag them into the movie introduction. Now I would like to use the same stills in my Web Gallery page, but I cannot drag or import them into iPhoto. The files are c

  • Analyze and move is slow

    Hi I have PIOTs with 1-2million rows. when analyzing with 10% estimate, it takes 15-20 min and for moving also with much time. I have sufficient CPU,RAM,using LMT with higher extent size, no ASSM. default initrans,freelist. How can we drill down this