Is any other way for this problem

<jsp:useBean id="obj" class="DBConnection.DbBean" scope="application"/>
<%@ page import="java.sql.*" %>
<%! ResultSet rs;%>
<%
rs=obj.getItemRs();
int cnameindex=0;
int pnameindex=0;
String cname=request.getParameter("cname");
String load="no";
String C1nameIndex = request.getParameter("cnameIndx");
if(C1nameIndex == null || C1nameIndex.equals(""))
else
    cnameindex = Integer.parseInt(C1nameIndex);
String P1nameIndex = request.getParameter("pnameIndx");
      String pname=request.getParameter("pname");
      if(P1nameIndex == null || P1nameIndex.equals(""))
     else
                pnameindex = Integer.parseInt(P1nameIndex);
          // out.print(pname);
     out.println(pnameindex);
%>
<HTML><head><title>Product Details</title></head>
<body   bgcolor="#99CCFF">
<form name="f1" method="POST" action="">
   <p align="center">
   <%String user=(String)session.getAttribute("username");%>
  <marquee> <font size="5" color="green"><b>  Abc Electronics Welcomes <%=user%></b></font> </marquee><br>
   <b><font size="5">Products Details</font></b></p>
   </p>
   <input type="hidden" name="cnameIndx" value="<%=cnameindex%>" size="20">
   <input type="hidden" name="pnameIndx" value="<%=pnameindex%>" size="20">
  <table border="0" cellpadding="5" cellspacing="5" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" id="AutoNumber1" bgcolor="#99CCFF">
    <tr>
      <td width="50%">
       </td>
    </tr>
  </table>
   <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" id="AutoNumber2" bgcolor="#99CCFF">
     <tr>
       <td width="50%">
       <p align="center"><b>Company Name :</b>     
       <select size="1" name="cname" onchange="
       document.f1.pnameIndx.value=0;
       document.f1.cnameIndx.value=document.f1.cname.selectedIndex;
       document.f1.action='';
       document.f1.submit();
       ">
       <option >Select The Company </option>
       <%
       int x=1;
       while(rs.next())
       %>
       <option
       <%
       if(cnameindex==x)
       %>
        selected
        <%
        %>
        ><%=rs.getString(1)%></option>
       <%
         x++;
       %>
       </select></td>
       <td width="50%">
       <p align="center">
        <b>Product Name</b> :             
        <select size="1" name="pname" onchange="
          document.f1.pnameIndx.value=document.f1.pname.selectedIndex;
          document.f1.action='';
          document.f1.submit();
       " >
        <option >Select The Product </option>
        <%
        int y=1;
        rs=obj.SetCompanyNameRs(cname);
        while(rs.next())
        %>
        <option
             <%
       if(pnameindex==y)
       %>
        selected
        <%
        %>
     > <%=rs.getString(1)%></option>
     <%
         y++;
        %>
        </select></td>
     </tr>
   </table>
   <% int z=0;
             if( cnameindex > 0 && pnameindex > 0 )
         { z++;
         rs=obj.getProductNameRs(cname , pname );
   %>
       <center>
      <table cellspacing="9" cellpadding="9" border="1" bordercolor="#FFFFFF" bgcolor="#99CCFF" style="border-collapse: collapse" bordercolordark="#000000" height="116" width="888">
       <tr>
       <td height="17" width="133"><b><center> Company Name</b></center></td>
       <td height="17" width="186"><b><center> Product Name</b></center></td>
       <td height="17" width="160"><b><center> Item No.</b></center></td>
       <td height="17" width="137"><b><center> Cost</b></center></td>
       <td height="17" width="176"><b><center> Model No.</b></center></td>
        </tr>
       <%
           while(rs.next())
        %><tr>
        <%
        String productid="";
         for(int a=1; a<=5;a++)
           String temp=rs.getString(a);
           if(a==3)
           productid=temp;
                %>
           <td height="18" width="133"><%=temp%> </td>
         <%
           %>
           <td height="18" width="186"><input type="checkbox" value="<%=productid%>" name="z<%=productid%>"></td>
       <%
         %>
         </tr>
         <%
         %>
  </tr>
  <tr>
  <td height="27" width="133">
  <%
  if(z==1)
  {%>
  <input type=button value="Order " onclick="
  document.f1.action='OrderDetails';
  document.f1.submit();
   <%}
   else
   %>
  </td>
  </center>
   </table>
</form>

package DBConnection;
import java.sql.*;
public class DbBean
     Statement stmt=null;
     public void DataBaseConnection()
          try
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               Connection conn=DriverManager.getConnection("jdbc:odbc:Login","scott","tiger");
               stmt=conn.createStatement();
          catch(Exception e)
               System.out.println(e);
     public ResultSet getItemRs()
          ResultSet rs=null;
          try
               DataBaseConnection();
               rs=stmt.executeQuery("select DISTINCT cname from Items");
               System.out.println("hai da");
          catch(Exception e)
               System.out.println(e);
               return rs;
          public ResultSet SetCompanyNameRs(String cname )
          ResultSet rs=null;
          try
               DataBaseConnection();
               rs=stmt.executeQuery("select DISTINCT pname from Items where cname='"+cname+"'");
          catch(Exception e)
               System.out.println(e);
          return rs;
     public ResultSet getProductNameRs(String cname ,String pname)
          ResultSet rs=null;
          try
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               Connection conn=DriverManager.getConnection("jdbc:odbc:Login","scott","tiger");
               Statement stmt=conn.createStatement();
               rs=stmt.executeQuery("select * from ItemDetails where cname='"+cname+"' and pname='"+pname+"'");
          catch(Exception e)
               System.out.println(e);
          return rs;
     public ResultSet getOrderedItemRs(String u)
          ResultSet rs=null;
          try
          {   System.out.println(u);
               DataBaseConnection();
               if(u.equals("Admin"))
               rs=stmt.executeQuery("select * from OrderDetail ");
               else
               rs=stmt.executeQuery("select * from OrderDetail  where Cust_name='"+u+"'");
          catch(Exception e)
               System.out.println(e);
          return rs;
  

Similar Messages

  • Not equal to operator in KQL i.e. for string comparison is not working. Is there any other approach for this?

    In KQL my query is like this,
    refinablestring05<>9c460541-5979-44ec-b0ab-63d1823f922f
    but looks like operator <> not working. It is not throwing error at all and always shows result.
    Any one can help me out for this?

    use NOT operator so it would be "NOT refinablestring:something"
    kashif

  • HT5035 I added a 25 gift card to my account and it showed up on the account.  However, my previous balance of $6.08 was deleted.  Any other's with this problem.  I sent the message in to Itunes but haven't heard back yet...

    Hello,
    I added a $25 gift card to my account and when I did, it deleted my previous amount of $6.08.  It is kind of like a parking meter.  Anyone else with this problem?

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

  • No one understands RSS. Any other way for people to subscribe to my blog?

    Is there another way besides RSS to allow people to subscribe to an iWeb '08 blog, and be notified of updates/new posts? I've been getting feedback from people that they just don't understand RSS or it's not working for them, so they miss out on getting notifications of my new posts. Is there another program I can drop in as a widget or something? Anyone else been able to work around RSS? I've got an option for people to sign up for my email newsletter, but fewer people are willing to sign up for that, and I would rather not have to email everyone every time I post.
    Thanks!
    Ellen

    Ellen ~ You probably don't want to switch to a different blogging platform, but just in case...
    Posterous provides some automatic, non-RSS, email options. This first one doesn't require your followers to create a free Posterous account:
    http://blog.posterous.com/posterous-group-blogs-are-now-email-lists-too
    This second option requires that your followers create a free Posterous account:
    http://blog.posterous.com/new-read-posterous-subscriptio

  • Unable to follow links in pdf document which use asynchronous pluggable protocol on Windows unless we disable extended security completely (Reader 11.0.7) - is there any other way round this?

    We have a pdf document which contains links of the format appname://some/path.
    This is using Windows Asynchronous Pluggable Protocols which we have defined in the registry so these links should launch the application with the path as an argument.
    If we disable enhanced security in Reader 11.0.7 then this works - otherwise it just fails to do anything.
    With enhanced security on, we get warning and select trust this site for all pdfs.
    Adobe then stores the first part of the path i.e. for appname://some/path it will store path in [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\11.0\TrustManager\cDefaultLaunchURLPerms].
    Don't get warning after that but the application still doesn't launch if enhanced security is enabled.

    Apologies was mislead - it's not enhanced security which is causing the issue, it is protected mode.

  • My Ipad was activated by my cousin so then when i have restarted it, i had to use their apple email to activate my ipad and she lives very far so is their any other way for me to be able to get into my ipad with my apple ID

    My ipad was activated by my cousin so then i cant activate it by my apple ID so can i get into my ipad without using my cousins icloud? i know my apple ID and Apple password/

    You need to erase the device and reconfigure it for yourself. Have your cousin turn off Find My Phone, then erase your iPad. After iOS is reinstalled do your own setup using your Apple ID and password.

  • Any other way for music downlo

    Can a software like limewire be used to downlod songs with Creative?
    I have the Microphoto for months but I don't have anything on it except some songs from my dad's cds I don't even like.
    Doesn't the company allow song downloads not coming just from CD's?
    Please do help. I'm getting really desperate.

    WMP0 has plenty of music stores on it here in the UK. Maybe your local version has some too.
    Limewire is not a legal place to download commercially available copyrighted music and noone here is going to tell you how to do it on a public forum

  • Hi, I have lost my iphone but i have its backup in itunes, how can i restore my contact/sms using itunes or is there any other way, please help

    Hi, I have lost my iphone but i have its backup in itunes, how can i restore using itunes or is there any other way for this
    please suggest

    You can restore that backup to a replacement iPhone, if that's what you're asking. If you want to extract data from the iPhone backup, you'll need third-party software to do so:
    http://www.iphonebackupextractor.com/

  • I have a Mac OSX version 10.75 with just one Thunderbolt port. and it has been my Thunderbolt port to connect with Blackmagic wear my intensity. and I no longer can use the port for mini-DVI adapter to connect with me. I do not want to ask any other way f

    i have a Mac OSX version 10.75 with just one Thunderbolt port. and it has been my Thunderbolt port to connect with Blackmagic wear my intensity. and I no longer can use the port for mini-DVI adapter to connect with me. I do not want to ask any other way for me to use to use my monitor. I monitor LG FLATRON E2041 brand .. PLEASE Helpp ME

    i have a Mac OSX version 10.75 with just one Thunderbolt port. and it has been my Thunderbolt port to connect with Blackmagic wear my intensity. and I no longer can use the port for mini-DVI adapter to connect with me. I do not want to ask any other way for me to use to use my monitor. I monitor LG FLATRON E2041 brand .. PLEASE Helpp ME

  • HT1933 Following the instructions above, I'm constantly redirected to this help page rather than receiving any drop down list to select what my problem is. Are there any other ways to report issues with purchases?

    Following the instructions for reporting an issue with a purchase problem, when selecting "report a probelm", I am not provided with a drop down list, I am redirected to the help page instead.
    Is there any other way to report an issue where the app owner has taken the funds twice for the same product at literally the same time?

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • HT201412 None of this work for  my Iphone. There any other way around Please. Thanks

    Hello There
    I am having  problems with  my Iphone
    Does turn it on
    It  just  shows the apple  logo and a black srean
    I  need help to fix this

    Arno79 wrote:
    Hello, my phone has been unlocked?Am I forced to restore for this to work?
    Yep.
    there any other way?
    Nope.
    if I restore, will io6 be installed?I've got a 3Gs running ios5. Thanks
    Yep.

  • I have photos on my iPad that I want to delete. This is my problem. I synced them from my ex-husband's Mac. We are no longer together therefore I don't have access to his computer or iTunes account. Is there any other way to delete them?

    I have photos on my iPad that I want to delete. The problem is I don't have access to the computer used to sync them. It was my ex husbands computer and iTunes account. Is there any other way to delete them?

    Not sure is any of these methods will work.
    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • I bought this iPhone 5 n its asking for a sim card to activate my phone is there is any other ways to do it?

    i bought this iPhone 5 n its asking for a sim card to activate my phone is there is any other ways to do it?

    No. You can't activate it without a SIM.

  • I can't get any contact info for installation problem- I just bought a Mac Air and my CS5 is asking for a reinstall. Mac Air has no DVD slots. HELP I al VERY FRUSTRATED THAT ADOBE HAS NO WAY TO GET HELP

    I can't get any contact info for installation problem- I just bought a Mac Air and my CS5 is asking for a reinstall. Mac Air has no DVD slots. HELP I al VERY FRUSTRATED THAT ADOBE HAS NO WAY TO GET HELP

    You are right, Adobe does not support CS5 because it is no longer sold.
    Simply download the trial version of CS5 from this Adobe web site and input your serial number.
    Adobe - Photoshop : For Macintosh

  • Western Digital My Book World EditionI have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way i get the message 'There was a proble

    I have bought a WD My Book World Edition to use for back-up of my iMac, but when I try and log onto the drive with Apple time Machine (back-up software) or connect in any other way I get the message 'There was a problem connecting to the server "MybookWorld.local" The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem'
    It is a brand new iMac and running Lion OSX
    Any ideas on how to solve would be gratefully received?

    Followed the directions on this page and it worked!
    http://forums.macrumors.com/showthread.php?t=1102423
    Part One - Turn on SSH (in the admin panel)
    [1] Go to to http://mybookworld.local
    [2] login: username will be admin, password will be whatever you have setup. If you can't remember it should be in your Mac OS X keychain (Utilities > Keychain Access, search for "mybookworld"). If you have not changed if from the default the password will be admin as well.
    [3] Switch to advanced mode.
    [4] From the System tab, pick Advanced.
    [5] Enable SSH Access, and click submit.
    [6] Click on the network tab and then the LAN button
    [7] Make a note of the IP address
    Small, maybe obvious, but nevertheless important point: For the install to work, your NAS needs to be connected to a router with internet access.
    Part Two - Install netatalk2.2
    [8] Open Terminal.app (Utilities > Terminal)
    [9] Enter the following command (substitute in 127.0.0.1 for the actual IP address you noted down in step 7), then hit return:
    Code: 
    ssh [email protected]
    [10] When prompted, enter the ssh password (will be welc0me).
    [11] You are now going to download the installer. Enter the following command, then hit return:
    Code: 
    wget http://mybookworld.wikidot.com/local--files/netatalk2-2-on-whitelight/install_netatalk.sh -O install_netatalk.sh
    [12] Once completed, you will need to run the installer. Type:
    Code: 
    sh install_netatalk.sh
    [13] You will be asked a number of question during install, answer yes to all. When asked about the "DHX2 login process", I opted to install the modified version, so I can confirm it works.
    [14] Once the box has restarted, you should be able to connect to your afp shares and continue to use Time Machine.

Maybe you are looking for

  • Windows 98 won't install over Windows XP HDD

    Hello there! I am trying to install Windows 98 over Windows XP. However, I am having problems to do with formatting process. It goes up to 20% but stops and has an error saying something to do with the HDD. it is 32 Gigabytes and it offers "large har

  • 300dpi Image: copy to clipboard??

    Hi everybody, I have somewhat like a problem: I set up something like a picture album with director. Also there is a function to copy a selected image to the clipboard in order to import it into PowerPoint. Now, the original images have a resolution

  • Length of flexString

    Hi I am trying store payload information, which users would like to use as search criteria, in flexString as it is suggested in thread “How to query worklist task based on payload information“ Posted: Aug 22, 2005 2:26 PM. Although there is mentioned

  • Oracle 10g Data Guard

    Hello to all. I am looking forward to implement Logical standby database for one of my clients. I want to know about licensing implications for the same. Does creation of logical standby database in Oracle 10g require a License?? If if it does then w

  • Regarding APO and SEM docs...

    Hi Folks, i am going to work on SEM and APO parallelly.i don have knowledge in those two modules.so can anyone please send me the documents or pdf's to my mail id: [email protected] or anylinks or anyinformation also greatly rewared..... Please help