Putting ResultSet data into select boxes

I am running a query, and returning the data to a JSP which in turn, places the query data into 3 different select boxes. Each of these three select boxes will contain a different number of values. The query is as follows:
partQuestionList="SELECT DISTINCT carMake, carModel, partTypeName FROM PARTTYPE, CARSPARTAVAIL";
Hence, I have three select boxes to display the three types of data. I assume I will need to use a loop of some kind. What is the best way to accomplish this without having code all over the place? Also, what is the best way to make these distinct? Thanks.

By the way..here is the code I have so far...
while(rs.next()){
     carMake.add(rs.getString("carMake"));
     carModel.add(rs.getString("carModel"));
     //carYear.add(rs.getInt("carYear"));
     partTypeName.add(rs.getString("partTypeName"));
     <SELECT name="Model">
          <% for (int x = 0; x<carModel.size(); x++) { %>
          <OPTION><%=carModel.get(x) %></OPTION>
               <% } %>
     </SELECT>
Which will obviously work, but doesnt get rid of the duplicates..

Similar Messages

  • Putting resultset Data into sql server 2000

    hello,
    I have some trouble with putting my Date into the sql server. I'm very confused about this and gives me a lot of headage!
    This is my code:
    public void GenerateAlarms(StringBuffer alarmsLeft) throws Exception
    try
    statement = conn.createStatement();
    rsGenerate = statement.executeQuery("SELECT event_it, oplcl_id, host_id, app_id, sev_id, alarm_id,desc_id, prodef_id, alert_id, date_time FROM ScenarioFive");
    int saveCheck;
    sqlInsert.setInt(1, 1);
    sqlInsert.setDate(2, rsGenerate.getDate(10));
    sqlInsert.setInt(3, 1);
    sqlInsert.setInt(4, 1);
    sqlInsert.setInt(5, 2);
    sqlInsert.setInt(6, 0);
    sqlInsert.setInt(7, 2);
    sqlInsert.setInt(8, 1);
    sqlInsert.setInt(9, 2);
    sqlInsert.setInt(10, 4);
    saveCheck = sqlInsert.executeUpdate();
    if (saveCheck == 0)
    conn.rollback();
    System.out.println("Alarms not Updated in new Database");
    else
    conn.commit();
    rs.deleteRow();
    catch (Exception e)
    System.err.println("Got an exception! ");
    System.err.println(e.getMessage());
    System.out.println("Foult at insert alarms");
    The error is Got an exception!
    [Microsoft][ODBC Driver Manager] Invalid cursor state
    OF course i have a Connection function to the database, I will give this just in case (this one is oke I think)
    public void connection()throws Exception
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String url = "jdbc:odbc:MSSQL-Storm1";
    String username = "sqldemo";
    String password = "sqldemo";
    Class.forName(driver);
    //Establish the conCection to the database.
    conn = DriverManager.getConnection(url, password, username);
    System.out.println("We are got Connected to STORM: Sql Server Port:1433");
    statement = conn.createStatement();
    conn.setAutoCommit(false);
    Thanks a lot!!

    Not a concern for an Oracle forum.
    Als no need for SHOUTING.
    Conventional solutions are
    - dump the data to a csv file and load it in Mickeysoft SQL server
    - use Oracle Heterogeneous services
    - use Mickeysoft DTS
    Whatever you prefer.
    Sybrand Bakker
    Senior Oracle DBA

  • How to put the data into cache and distribute to nodeusing oracle coherence

    Hi Friends,
    i am having some random number data writing into file,from that file i am reading the data and i want to put into cache,how can i put the data into cache and partition this data into different nodes ( machines) to caluculate like S.D,variance..etc..like that.(or how can i implement montecarlo using oracle coherence) if any one know plz suggest me with flow.
    Thank you.
    regards
    chandra

    Hi robert,
    i have some bulk data in some arraylist or object format,i want to put into cache.
    i am not able to put into cache.i am using put method like cache.put(object key ,object value) ,but its not allowing to put into cache.
    can you please help me.i m sending my code.plz go thru and tel me whr i did mistake.
    package lab3;
    import com.tangosol.net.CacheFactory;
    import com.tangosol.net.NamedCache;
    import com.tangosol.net.cache.NearCache;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;
    import java.util.Scanner;
    import javax.naming.Name;
    public class BlockScoleData {
         * @param args
         * s=The spot market price
         * x=the exercise price of the option
         * v=instantaneous standard deviation of s
         * r=risk free instantaneous rate of interest
         * t= time to expiration of the option
         * n – Number of MC simulations.
         private static String outputFile = "D:/cache1/sampledata2.txt";
    private static String inputFile = "D:/cache1/sampledata2.txt";
    NearCache cache;
    List<Credit> creditList = new ArrayList<Credit>();
         public void writeToFile(int noofsamples) {
              Random rnd = new Random();
              PrintWriter writer = null;
              try {
                   writer = new PrintWriter(outputFile);
                   for (int i = 1; i <= noofsamples; i++) {
                        double s = rnd.nextInt(200) * rnd.nextDouble();
                        //double x = rnd.nextInt(250) * rnd.nextDouble();
                        int t = rnd.nextInt(5);
                        double v = rnd.nextDouble() ;
                        double r = rnd.nextDouble() / 10;
                        //int n = rnd.nextInt(90000);
                        writer.println(s + " " + t + " " + v + " "
                                  + r );
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              } finally {
                   writer.close();
                   writer = null;
    public List<Credit> readFromFile() {
    Scanner scanner = null;
    Credit credit = null;
    // List<Credit> creditList = new ArrayList<Credit>();
    try {
    scanner = new Scanner(new File(inputFile));
    while (scanner.hasNext()) {
    credit = new Credit(scanner.nextDouble(), scanner.nextInt(),
    scanner.nextDouble(), scanner.nextDouble());
    creditList.add(credit);
    System.out.println("read the list from file:"+creditList);
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    } finally {
    scanner.close();
    credit = null;
    scanner = null;
    return creditList;
    // public void putCache(String cachename,List<Credit> list){
    // cache = CacheFactory.getCache ( "VirtualCache");
    // List<Credit> rand = new ArrayList<Credit>();
    public Object put(Object key, Object value){
    cache = (NearCache)CacheFactory.getCache("mycache");
    String cachename = cache.getCacheName();
    List<Credit> cachelist=new ArrayList<Credit>();
    // Object key;
    //cachelist = (List<Credit>)cache.put(creditList,creditList);
    cache.put(creditList,creditList);
    System.out.println("read to the cache list from file:"+cache.get(creditList));
    return cachelist;
         public static void main(String[] args) throws Exception {
         NearCache cache = (NearCache)CacheFactory.getCache("mycache");
              new BlockScoleData().writeToFile(20);
         //new BlockScoleData().putCache("Name",);
              System.out
                        .println("New file \"myfile.csv\" has been created to the current directory");
         CacheFactory.ensureCluster();
         new BlockScoleData().readFromFile();
    System.out.println("data read from file successfully");
         List<Credit> creditList = new ArrayList<Credit>();
    new BlockScoleData().put(creditList,creditList);
         System.out.println("read to the cache list from file:"+cache.get(creditList));
    //cache=CacheFactory.getCache("mycache");
    //mycacheput("Name",new BlockScoleData());
    //     System.out.println("name of cache is :" +mycache.getCacheName());
    //     System.out.println("value in cache is :" +mycache.get("Name"));
    //     System.out.println("cache services are :" +mycache.getCacheService());
    regards
    chandra

  • ResultSet date into JavaScript Function HELP!!

    I am developing an auction web site for a end year project in college, it is all done except this countdown thingy. I got the 'endDate' of an auction in a table. I can get the date out no problem at all, where im stuck is where i gotta pass the date from the result set into the javascript countdown function so it can countdown to the end of the auction. Code below
    <%@ page language = "java" contentType = "text/html"%>
    <%@ page language = "java" import = "com.sybase.jdbcx.SybDriver" %>
    <%@ page language = "java" import = "java.sql.*" %>
    <%@ page language = "java" import = "java.util.*"%>
    <% Connection dbConn = null;
    try
    Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
    dbConn = DriverManager.getConnection("jdbc:sybase:Tds:compserver:5000/syb3044","
    syb3044", "syb3044");
    Statement b = dbConn.createStatement();
    ResultSet bid = b.executeQuery("select * from bid where carID=1");
    if(bid.next()){}
    %>
    <HTML>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    mDate = new Date("20 April 2004 16:45") //Hard Coded Date Here, Want ResultSet Date Passed Here
    function countdown()
         var now=new Date()
         var diff=mDate.getTime()-now.getTime()
         if (diff <= 0)
         document.bid.mseconds.value = 0
         return 0;
         document.bid.days.value = Math.round(diff/(24*60*60*1000))
         document.bid.hours.value = Math.round(diff/(60*60*1000))
         document.bid.minutes.value = Math.round(diff/(60*1000))
         document.bid.seconds.value = Math.round(diff/1000)
         document.bid.mseconds.value = diff
         var id=setTimeout("countdown()",0)
    </SCRIPT>
    </HEAD>
    <BODY onLoad="countdown()">
    <BR>
    <form name="bid" method="post" action="">
    <p>Timeleft</p>
    <TABLE BORDER=0>
    <TD width="79">Days: </TD>
    <TD width="81">
    <INPUT TYPE="text" NAME="days" SIZE=15></TD> <TR>
    <TD width="79">Hours: </TD>
    <TD width="81">
    <INPUT TYPE="text" NAME="hours" SIZE=15></TD> <TR>
    <TD width="79">Minutes:</TD>
    <TD width="81">
    <INPUT TYPE="text" NAME="minutes" SIZE=15></TD> <TR>
    <TD width="79">Seconds: </TD>
    <TD width="81">
    <INPUT TYPE="text" NAME="seconds" SIZE=15></TD> <TR>
    <TD width="79">Milliseconds:</TD>
    <TD width="81">
    <INPUT TYPE="text" NAME="mseconds" SIZE=15></TD> <TR>
    </TABLE>
    </form>
    </BODY>
    </HTML>
    <%     
    bid.close();
    catch (SQLException sqle)
    out.println(sqle.getMessage());     
    catch (ClassNotFoundException cnfe)
    out.println(cnfe.getMessage());
    catch (Exception e)
    out.println(e.getMessage());
    finally
    try
         if(dbConn != null)
         dbConn.close();
    catch (SQLException sqle)
         out.println(sqle.getMessage());
    %>
    ...........................................................SQLTable.......................................................................................................................
    create TABLE bid
    bidID     integer primary key,
    carID     numeric NOT NULL,
    seller     varchar(50) NOT NULL,
    username varchar(50),
    startDate varchar(25) not null,
    endDate datetime not null
    PS, tried putting endDate as varchar but same result
    Please note I am a computer science student
    Regards Don Colvin

    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 19 in the jsp file: /Test.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Tomcat\work\Catalina\localhost\Mess\org\apache\jsp\Test_jsp.java:55: cannot resolve symbol
    symbol : class SimpleDateFormat
    location: class org.apache.jsp.Test_jsp
    out.print( new SimpleDateFormat("dd MMMM YYYY hh:MM").format(bid.getDate("endDate")) );
    ^
    1 error
    It throwing back this error, any suggestions

  • I want to put my data into a web site

    Hi,
    I have an excel file full of information that is summarised in a dashboard worksheet. In this dashboard the user can query the data using dropdown boxes and on selection, the summary tables change.
    I am looking for a way to do this online. I'm familiar with wordpress which may be the completely wrong starting point but ideally I'd like to represent the data in a page where users can query it, and the results change.
    To complicate things, the results include a few icons too.
    The dataset is likely to grow over time so ideally I'd like a site that can handle more data down the track.
    The dashboard would show historic daily weather with a weather symbol, a low and a high. The user should be able to pick which time period they'd like to see the data for. It would then also summarise the averages from the data. All pretty simple stuff in
    Excel but I'm stuck as to how to make it happen online.
    Will I be able to do this using wordpress and excel/access? Are there any other user-friendly ways to get this data online if not?
    Thanks for your help in advance!

    Hi half-man-half-spreadsheet,
    >> I have an excel file full of information that is summarised in a dashboard worksheet. In this dashboard the user can query the data using dropdown boxes and on selection, the summary tables change.I am looking for a way to do this online.
    This is possible to achieve by using Excel Online. You could create your own worksheet on line, and operate the worksheet. You could refer the link below to create a new worksheet.
    https://office.live.com/start/default.aspx
    >> Will I be able to do this using wordpress and excel/access? Are there any other user-friendly ways to get this data online if not?
    Access Web app is also an alternative option, but it needs to be host on the SharePoint.
    >> I'm familiar with wordpress which may be the completely wrong starting point but ideally I'd like to represent the data in a page where users can query it, and the results change.
    This forum is discussing about Excel developing, and I am not familiar with it, if you have questions about WordPress, I suggest you post your issues on WordPress forums.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Want to Read the a txt file and put the data into the table colums.

    I have a text file in which data is piped separated and I want to put the data in the table column.
    Eg.
    Text File Column
    First_name|Last_name|address|phone_number
    Database table:
    first_name ,last_name,address,phone_number
    It's very urgent.
    Thanks For your help in advance.
    Himanshu

    Use sqlldr or external file.
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/part_ldr.htm#i436326 for SQL Loader.
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/tables013.htm#ADMIN11705 for External table.

  • Best way to put binary-data into string?

    Hi there!
    What I want to do is to transfer binary data via HTTP/GET so what I have to do is to transfer binary data into a string.
    Currently I do this the follwing way:
          byte[] rawSecData = new byte[4]; //any binary datas
          ByteArrayOutputStream secBOS = new ByteArrayOutputStream(4);
          DataOutputStream secDOS = new DataOutputStream(secBOS);
          for(int i=0; i < rawSecData.length; i++)
            secDOS.writeByte(rawSecData);
    secDOS.flush();
    String secData = secBOS.toString();
    System.err.println("Lenght of resulting String: "+secData.length());
    I know that this way already worked fine, however I now set up my system up again with another linux-distro and now strange things happen.
    e.g. the secData string differs in lenght from run-to-run between 2 and 4 and I don know at all why?
    Transferring the binary-stuff into string-stuff (e.g. short-binary 255 255, String: 65536) is not possible for me because of various reasons.
    The funny thing is that I remeber that this already worked some time ago and I can figure out why it now doesnt...
    Please help!

    First of all thanks a lot for your help!
    Yes, I already think its an encoding problem, but how can I specify the encoding in my application in a portable way. I dont have an idea what to do.
    My applikation should run as applet on many different 1.1+ VMS (msjvm, netscape-1.1.5, ...).
    Thanks again, lg Clemens

  • Putting tick mark into check box in smartform

    hi,
       can any one please let me know if i can put a tick mark in the check box of the smartform.
       for example: i need to select one among yes or no check box. how do i do it.
       should i have to upload a graphic of the tick mark and then display or is there any provision in smartforms to do that.

    Hi,
    Check threads like
    smartform- check box
    and
    what r the steps to display check box in smartform
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Put prepended "WITH" into Select statement possible?

    Assume I have a SQL statement like:
    with t1 as (select ......),
    t2 as (select ......)
    Select .... From t1, t2 Where ....;
    Can I merge somehow the prepended "with" term into the actual select statement?
    As far as I remember there is an equivalent statement syntax like:
    Select .... from t1 as (select ....), t2 as (select ....) where ....;
    but this does not work.
    Peter

    It will be like
    Select ....
    From ( select .. From ...) t1
    ,( select .. From ...) t2
    WHERE ...
    Regards
    Arun

  • How to get the data into select options if we have 10 select options

    Hi Experts,
         I facing problem to get the data from diffrent tables and different select options.
    I have to pass different parameter ranges.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: rb1 RADIOBUTTON GROUP g1.     "Existing Key Accounts
    PARAMETERS: rb2 RADIOBUTTON GROUP g1.     "Potential Key Accounts
    SELECT-OPTIONS: s_part FOR but000-partner."Business Partner Number
    PARAMETERS: p_bpkind LIKE but000-bpkind.    "Business Partner Type
    PARAMETERS: p_but000 LIKE but000-partner.   "Key Account Manager
    SELECT-OPTIONS : s_vkont FOR fkkvkp-vkont. "Contract Account
    SELECT-OPTIONS : s_ktokl FOR fkkvkp-ktokl. "Debtor Type
    SELECT-OPTIONS : s_sparte FOR ever-sparte.  "Division
    SELECT-OPTIONS : s_vertra FOR ever-vertrag. "Contract
    SELECT-OPTIONS : s_budat FOR erdk-budat.   "Invoice Date
    SELECT-OPTIONS : s_netto FOR dberchv-nettobtr."Billing Amount
    SELECT-OPTIONS : s_abrm FOR abc.               "Consumption Value
    SELECTION-SCREEN: END OF BLOCK b1.
    need response asap.
    Thanking you.
    Regards Surya Ramireddy

    HI,
    You can use as many Select-options in the select statment,
    Select XXXX yyyy from TABLE where FIELD In S_FIELD1 and
    FIELD2 In S_FIELD2.
    Regards
    Sudheer

  • I can not put the data of a field(LONG RAW) consulted into a item of a data block

    I want to query a field that is LONG RAW(it's a image) and put the data into a item of a data block (in Forms Builder), when i write ":BLOCK.FOTO:=vfoto" i recieve this errors: "bad bind variable ....". How can i put the data of field of my DB and put the data in a item of a data block(in Forms Builder)?.
    I can store a image in a table of my DB, but i want to query a image stored in my DB and put it into anothers table, all this on FORMS BUILDER.

    You have to base the image item on a base table and use EXECUTE_QUERY on that block. You can't do a direct select in PL/SQL into the item

  • How to put data into a array element in the BPEL

    Hi,
    I have a element in the WSDL which is of type Array. (i.e accepts unlimited data for the same element). How should i put a data into a array in the BPEL.
    Example:
    The below Example gives u an idea about wht iam asking:pasting a piece of my requirement:
    <s:element minOccurs="0" maxOccurs="1" name="parameters" type="tns:ArrayOfCSParameters" />
    <s:complexType name="ArrayOfCSParameters">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded"
    name="CSParameters" nillable="true" type="tns:CSParameters" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="CSParameters">
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="RevenueItem" type="tns:RevenueItem" />
    <s:element minOccurs="0" maxOccurs="1" name="AccountURIs" type="tns:ArrayOfString" />
    <s:element minOccurs="0" maxOccurs="1" name="GroupURIs" type="tns:ArrayOfString" />
    <s:element minOccurs="1" maxOccurs="1" name="Percentage" nillable="true" type="s:decimal" />
    </s:sequence>
    <s:attribute name="Version" type="s:decimal" use="required" />
    <s:attribute name="URI" type="s:string" />
    </s:complexType>
    Any suggestion is appreciated.
    Regards
    pavan

    You have 2 options i guess.
    Use the transformation and the for-each to construct the array-list
    or like Richard said, use a loop in bpel, assign in the loop an variable of element type="CSParameters" and append this variable to your variable with accepts the arraylist.

  • Need help in putting data into 2d array

    My input file :
    1 , 2 , 1
    2 , 2 , 1
    3 , 3 , 1
    4 , 2 , 2
    2 , 3 , 2I'm stuck at:
    while( reader.readLine() != null){
    String Matrix[] = line.split(",");
    }Means I only can read how many lines there. For 2d array, Matrix[i][j], is that when I count the line, the number of count will be the 'i'? How about 'j'? Am I need to count i and j before put the data into 2d array?
    Do correct me if something wrong in:
    while( reader.readLine() != null){
    String Matrix[] = line.split(",");
    } Thank you.

    gtt0402 wrote:
    while( reader.readLine() != null){
    String Matrix[] = line.split(",");
    How about:
    ArrayList<String[]> rows = new ArrayList<String[]>();
    while((line = reader.readLine()) != null) {
        rows.add(line.split(","));
    }After the loop you have a list full of String arrays and you can convert it to a 2D String array if you wish.

  • What is the best way to put LabVIEW DSC data into an Oracle database?

    I have been collecting data using LabVIEW DSC 7.0 for several years and have always accessed the data from the Citadel database via the Historical Data Viewer.  I would now like to begin putting this data into an Oracle database.  My company stores all their data in Oracle and it would provide me all the benefits of their existing infrastructure such as automated backups, data mining tools, etc.
    My initial thought is to use "Read Trace.vi" in LabVIEW to pull historical data from the citadel database at regular intervals (e.g. 1 minute) and insert this data into Oracle via ODBC.  In this way, I do not need to track the value changes in order to know when to write to Oracle.  I also considered replicating the citadel database using some other method, but I recall that the tables used by citadel are somewhat complicated.  I only need a simple table with columns for channel, timestamp, and data.  The "Read Trace.vi" will provide me data in this format.
    I do not need to update the Oracle database in real time, a few minute delay is acceptable. If anyone has a better idea or additional insight please let me know. Thanks.

    In terms of connectivity, you want to use ADO, not ODBC. Beyond that, it all depends on the structure of the data and what you are going to want to do with it. This is a very big question that you need to be getting some in-depth assistance.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Problem with inserting data into mySQL database with jsp

    I have a jsp page that collects infromation about a users vehicle and puts the data into a mySQL database. Iv'e been messing around with it for ages & i can't seem to get it to work even though i cannot see anything wrong with the code, which can be seen below.
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/connection.jsp" %>
    <%
    // *** Restrict Access To Page: Grant or deny access to this page
    String MM_authorizedUsers="";
    String MM_authFailedURL="login_form.jsp";
    boolean MM_grantAccess=false;
    if (session.getValue("MM_Username") != null && !session.getValue("MM_Username").equals("")) {
      if (true || (session.getValue("MM_UserAuthorization")=="") ||
              (MM_authorizedUsers.indexOf((String)session.getValue("MM_UserAuthorization")) >=0)) {
        MM_grantAccess = true;
    if (!MM_grantAccess) {
      String MM_qsChar = "?";
      if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";
      String MM_referrer = request.getRequestURI();
      if (request.getQueryString() != null) MM_referrer = MM_referrer + "?" + request.getQueryString();
      MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + java.net.URLEncoder.encode(MM_referrer);
      response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL));
      return;
    String vehicle_details__registration = null;
    if(request.getParameter("txt_registration") != null){ vehicle_details__registration = (String)request.getParameter("txt_registration");}
    String vehicle_details__make = null;
    if(request.getParameter("txt_make") != null){ vehicle_details__make = (String)request.getParameter("txt_make");}
    String vehicle_details__model = null;
    if(request.getParameter("txt_model") != null){ vehicle_details__model = (String)request.getParameter("txt_model");}
    String vehicle_details__colour = null;
    if(request.getParameter("txt_colour") != null){ vehicle_details__colour = (String)request.getParameter("txt_colour");}
    String vehicle_details__tax_class = null;
    if(request.getParameter("select_tax_class") != null){ vehicle_details__tax_class = (String)request.getParameter("select_tax_class");}
    String vehicle_details__chasis_num = null;
    if(request.getParameter("chasis_num") != null){ vehicle_details__chasis_num = (String)request.getParameter("chasis_num");}
    String vehicle_details__status = null;
    if(request.getParameter("radio_status") != null){ vehicle_details__status = (String)request.getParameter("radio_status");}
    String owner_details__MMColParam = "1";
    if (session.getValue("MM_Username") !=null) {owner_details__MMColParam = (String)session.getValue("MM_Username");}
    Driver Drivervehicle_details = (Driver)Class.forName(MM_connection_DRIVER).newInstance();
    Connection Connvehicle_details = DriverManager.getConnection(MM_connection_STRING,MM_connection_USERNAME,MM_connection_PASSWORD);
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    vehicle_details.executeUpdate();
    %>
    <form name="add_vehicle_form" id="add_vehicle_form">
      <p>Registration mark:
        <input name="txt_registration" type="text" id="txt_registration">
    </p>
      <p>Make:
        <input name="txt_make" type="text" id="txt_make">
    </p>
      <p>Model:
        <input name="txt_model" type="text" id="txt_model">
    </p>
      <p>Colour:
        <input name="txt_colour" type="text" id="txt_colour">
      </p>
      <p>Tax Class:
        <select name="select_tax_class" id="select_tax_class">
          <option value="AAA">Band AAA (up to 100g/km)</option>
          <option value="AA">Band AA (101 - 120g/km)</option>
          <option value="A">Band A (121 - 150g/km)</option>
          <option value="B">Band B (151 - 165g/km)</option>
          <option value="C">Band C (166 - 185g/km)</option>
          <option value="D">Band D (Over 185g/km)</option>
        </select>
      </p>
      <p>Chasis Number:
        <input name="txt_chassis_num" type="text" id="txt_chassis_num">
    </p>
      <p>Status: active:
        <input name="radio_status" type="radio" value="1" checked>
        off-road
        <input name="radio_status" type="radio" value="0">
      </p>
      <p>
        <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
    Connvehicle_details.close();
    %>This is the error I am getting from the server
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 3 in the jsp file: /add_vehicle_form.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\Assignment\org\apache\jsp\add_005fvehicle_005fform_jsp.java:113: ')' expected
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Any help would be much appreciated.
    Thanks

    use this ...
    PreparedStatement vehicle_details =
    Connvehicle_details.prepareStatement("INSERT INTO
    vehicle_man_db.vehicle_details (registartion, make,
    model, colour, tax_class, chasis_num) VALUES
    vehicle_details .setString(1,String
    vehicle_details__registration );
    vehicle_details setString(2,String
    vehicle_details__make );
    vehicle_details .setString(3,String
    vehicle_details__model );
    vehicle_details .setString(4,vehicle_details__colour
    vehicle_details .setString(5,String
    vehicle_details__tax_class);
    vehicle_details .setString(6,String
    vehicle_details__chasis_num );
    vehicle_details .executeQuery();Even you need a screwing up... what's the point putting that String inside. That's the bloody error.

Maybe you are looking for

  • How to remove old iPhone from iTunes account?

    Last I was on itunes it told me I had 4 out of 5 authorized devices on my account, how do I remove old devices?

  • High quality, untouched logo blurs when inserted into Photoshop PDF

    Hi all, Been having mega problems with this. I am creating a 'label' for work to be used as a promotional tool using my old Photoshop CS2 . I created a PDF and manually inserted all of the text, and insert my logo by dragging the layer onto the PDF.

  • Manual archiving of redo log files....

    Hi , If the database is running in NOARCHIVELOG mode , is it possible to archive the redo log files manually.... and how..???? Note: I use Oracle 10g v.2 Many thanks, Simon

  • New Masthead with a built-in search :: questions

    I have created a new Page (2-column, wide and narrow) and in that Page I added my headerm iView and my search iView - header in the wide column, search in the narrow. In my portal Framework, I made the existing header and the toolarea with search not

  • Web Dynpro ABAP Component configuration - Invalid access Key

    Hi Friends, I have copied HRESS_CC_MENU_OVP to ZHRESS_CC_MENU_OVP and trying to configure it. Even after registering the object it is giving the same error Invalid access key. We have registered HRESS_CC_MENU_AREA_GROUP and the access key worked fine