Problem parsing SimpleDateFormat date format to database

I have a page where I am getting parameter values form another page a constucting
a string from these values which i then want to insert into my SQL database.
The field i am putting the data into is of type DATETIME and i am using the SimpleDateFormat to format the string.
Here is my code
String startTime = request.getParameter("startHour") + ":" + request.getParameter("startMin")+ ":00";
     String endTime = request.getParameter("endHour") + ":" + request.getParameter("endMin") + ":00";
     String startDate = request.getParameter("startDay") + "-" + request.getParameter("startMonth") + "-" + request.getParameter("startYear");
     String endDate = request.getParameter("endDay") + "-" + request.getParameter("endMonth") + "-" + request.getParameter("endYear");
     scheduleData.startTime = startTime;
     scheduleData.endTime = endTime;
     scheduleData.startDate = startDate;
     scheduleData.endDate = endDate;
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     StringBuffer start = new StringBuffer();
     start.append("'"); // start quote (enclose string values in single quote)
     start.append(scheduleData.startDate);  // or compose it from the parameter values
     start.append(" "); // add space between date and time
     start.append(scheduleData.startTime); // or compose it from the parameter values
     start.append("'"); // end quote (enclose string values in single quote)
     StringBuffer end = new StringBuffer();
     end.append("'"); // start quote (enclose string values in single quote)
     end.append(scheduleData.endDate);  // or compose it from the parameter values
     end.append(" "); // add space between date and time
     end.append(scheduleData.endTime); // or compose it from the parameter values
     end.append("'"); // end quote (enclose string values in single quote)
     Date startSQLDate = new Date();
     startSQLDate = sdf.parse(start.toString());
     Date endSQLDate = new Date();
     endSQLDate = sdf.parse(end.toString());
Driver DriverinsertSchedule   = (Driver)Class.forName(MM_connAdministration_DRIVER).newInstance();
Connection ConninsertSchedule = DriverManager.getConnection(MM_connAdministration_STRING,
                                                            MM_connAdministration_USERNAME,
                                                            MM_connAdministration_PASSWORD);
for (int i = 0; i < scheduleData.participants.length; i++) {
    PreparedStatement insertSchedule =
                          ConninsertSchedule.prepareStatement("INSERT INTO Administration.schedule (Assessment_ID, Participant_ID, Schedule_Name, Restrict_Times, Schedule_Starts, Schedule_Stops, Resrict_Attempts, Max_Attempts)  VALUES ( '"
                                                                  + scheduleData.assessmentID + "', '"
                                                                  + scheduleData.participants[i] + "', '"
                                                                  + scheduleData.scheduleName + "', '"
                                                                  + scheduleData.participants[i] + "', '"
                                                                  + scheduleData.scheduleName + "', '"
                                                                  + scheduleData.timeLimit + "', '" + startSQLDate
                                                                  + "', '" + endSQLDate + "', '"
                                                                  + scheduleData.limitAttempts + "', '"
                                                                  + scheduleData.attemptsAllowed + "' ) ");
    insertSchedule.executeUpdate();
}I am getting this error.
javax.servlet.ServletException: Unparseable date: "'01-01-2005 09:00:00'"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)     org.apache.jsp.administration.schedules.process_005fschedule_jsp._jspService(process_005fschedule_jsp.java:385)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
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)
root cause
java.text.ParseException: Unparseable date: "'01-01-2005 09:00:00'"
java.text.DateFormat.parse(Unknown Source)     org.apache.jsp.administration.schedules.process_005fschedule_jsp._jspService(process_005fschedule_jsp.java:133)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
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)
Can someone please help me as my project deadline is 2morrow and this is a major problem that needs fixing. Can anyone please tell me what i am doing wrong and how to fix the problem.
Help would be much appreciated
Thanks

Can someone please help me as my project deadline ...You can do one of the following.
1. Figure out the exact format for time that your database takes. In the previous thread you posted there was a suggestion about that exact format.
2. Use prepared statements and a java.sql.Timestamp which was also suggested to you in the previous thread you posted.
3. Give up.

Similar Messages

  • Problem with input data format - not "only" XML

    Hi Experts,
    I have problem with input data format.
    I get some data from JMS ( MQSeries) , but input format is not clear XML. 
    This is some like flat file with content of XMLu2026.
    Example:
    0000084202008-11-0511:37<?xml version="1.0" encoding="UTF-8"?>
    <Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
    ...content....
    </Document>000016750
    Problems in this file is :
    1. data before parser <? xml version="1.0"> -> 0000084202008-11-0511:37 
    2. data after last parser </Document> -> 000016750
    This data destroy XML format.
    Unfortunately XI is not one receiver of this files and we canu2019t change this file format in queue MQSeries ( before go to XI) .
    My goal is to get XML from this file:
    <?xml version="1.0" encoding="UTF-8"?>
    <Document xmlns="urn:xsd:test.01" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance Sndr="0001" Rcvr="SP">
    ...content....
    </Document>
    My questions:
    1. Is any way or technique to delete this data 0000084202008-11-0511:37  in XI from this file ?
    2. Is any way to get only XML from this file ?
    Thanx .
    Regards,
    Seo

    Hi Buddy
    What is the XI adapter using?
    If you use inbound File adapter content conversion you could replace these values with none and then pass it to the scenario.
    Does that help?
    Regards
    cK

  • I have Problem in Upload Date formate

    Hi Friends,
    I have one doubt on WDJ.
    I have done one Application that application having one functionality that is Download data in to Excel. After download data into excel we can change the DATE cell and again upload Excel Data.
    Here what I am getting problem is  download data into SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); this date forame. And again upload data  into Same date formate
    But it is not uploaded
    When I download data into SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); this date format that time it will upload successfully.
    This is for Dowload data into Excel
    if(StockEle.getConf_Shp_Date()==null)
    ExcelEle.setConf_Shp_Date("null");
    else
    SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
    Date ConfShpDate = wdContext.nodePoDetails_OutTab().getPoDetails_OutTabElementAt(i).getConf_Shp_Date();     
    String ConfShpDate1 = sdf.format(ConfShpDate); // will give dd-MM-yyyy
    ExcelEle.setConf_Shp_Date(ConfShpDate1);
    Here ExcelEle.setConf_Shp_Date data type is String
    This is for Upload data
    try
    SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
    //Date dt = sdf.parse(ele.getConf_Shp_Date());
    // java.util.Date Date dt = sdf.parse(ele.getConf_Shp_Date());                                   
    java.util.Date dt = sdf.parse(ele.getConf_Shp_Date());
    java.sql.Date sqlDate = new java.sql.Date(dt.getTime());                                   
    eleout.setEindt(sqlDate);
    catch(Exception e)
    e.printStackTrace();
    eleout.setEindt data type is Date.
    How to Solve this issue I want upload this type of date (dd.MM.yyyy).
    Regards
    Vijay Kalluri

    Hi
    Try to format it before sending it back , try using these code
    // Create Date object.  Date date = new Date(); 
    //Specify the desired date format
    String DATE_FORMAT = "MM/dd/yyyy";
    //Create object of SimpleDateFormat and pass the desired date format.
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); 
    /*  Use format method of SimpleDateFormat class to format the date.  */
    System.out.println("Today is " + sdf.format(date) );
    Best Regards
    Satish Kumar

  • Problem with the Date format and sending it to R/3

    Hi all,
    I have an Adaptive RFC application which fetches the data from the R/3 and displays the Employee's Personal Data.
    I am using a ZFM which is customised as per the requirement from the Standard BAPI_EMPLOYEE_GETDATA.
    Now the Problem i am facing is Date is default and Optional Parameter in RFC.
    If i execute the RFC in R/3 without Date it is not filling the Internal Tables. And if i pass the Date it is filling the Internal Table and fetches the Records.
    So in WD application i am inputing Employee FirstName, LastName or the Employee ID.
    User can give any of the above input or combination of FirstName and LastName Or only the Employee ID.
    Now the Main Problem is of Date which is of type Date.
    I have also tried the SimpleDateFormat Class, but i am not able to achieve the result.
    I have also seen the Links and threads on SDN, but unable to solve the problem.
    So pls help me out asap.
    Thanks & Regards,
    Dhruv Shah

    Hi ,
    By default , RFC accept date format of SQL date (yyyy-mm-dd) . If you are using a date picker from WD, it directly set the date in SQL date format. Incase if you are trying to pass date to RFC in some other way you have to convert that into SQL date format before passing.
    if you are passing String date of format dd-mm-yyyy , you try this method to convert that to SQL date and pass to your RFC.
    public java.sql.Date sqlDateConvert( String date)  {
        //@@begin sqlDateConvert()
         java.sql.Date dateObj=null;
         try{     
              StringTokenizer tempStringTokenizer = new StringTokenizer(""+date,"-");          int dd=Integer.parseInt(tempStringTokenizer.nextToken().trim());
                                    int mm=Integer.parseInt(tempStringTokenizer.nextToken().trim());
              mm=mm-1;
              int yyyy=Integer.parseInt(tempStringTokenizer.nextToken().trim());
              Calendar cal =Calendar.getInstance();   
              cal.set(yyyy,mm,dd);                         
              dateObj = new java.sql.Date( cal.getTime().getTime());
         }catch(Exception e)
              return dateObj;
    Hope this will help you.

  • URGENT: XML-SQL: Error parsing different date formats in the same XML file.

    Hi Everyone,
    I have a big problem while using the XML-SQL utility. I have a XML file with different date formats. I get exception like the one below.
    "oracle.xml.sql.OracleXMLSQLException: 'java.text.ParseException: Unparseable date:"
    And the XML file is :
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Info Key="ID">
         <Insert>
              <ID>1</ID>
              <BookingDate>10.12.2001</BookingDate>
              <OpeningTime>19:16</OpeningTime>
         </Insert>
    </Info>
    I have tried using different setDateFormat which is contrary.
    sav.setDateFormat("d.M.y");
    sav.setDateFormat("H:m:s");
    Can someone help me on the same.
    Thanks in advance.
    Subramanian.

    You might have to describe the columns as varchar then modify the table to the right format.

  • Converting BPEL date format to Database Timestamp format

    Hi all,
    Is there any way to convert BPEL current-dateTime() format to database Timestamp format.
    Sample BPEL current-dateTime(): *2011-07-14T11:51:06-04:00*
    Sample Database Timestamp value: *14-JUN-11 11.51.06.936511000 AM*
    If this is not possible, then could I get millisecond from any of the function used in BPEL? if yes, how?
    Actually I need this to find out the time of invoke of a BPEL process upto millisecond.
    Any help would be appreciated.
    Regards,
    Rakesh Ranjan

    Please check the below thread and let usknow if it helps.
    Re: Date conversion

  • HT3345 Importing from xls problems with the date format (mixed european format)

    Hi.
    I made some spreadsheets with Neo Office and saved them in xls format. So I can import them in numbers, doing so in OpenOffice, LibreOffice or even the worst in Mircosoft Office on a PC works just fine. But importing them with Numbers 2.0.4 it just don't work.
    I have Mac OSX 10.5.8 and a PowerPC G4 1,67 GHz.
    The date format in all other programs is " 21.05.2011" and numbers creates "21/05/2011" out of it. Although my international setting is set to 23.05.2012. It defines the cells as my own format and takes than the totally wrong format.
    Does anyone know how to solve this problem, or how to change all the weird own formats in my international setting, which would be correct.
    Best regards.

    Hi Franklin,
    I used to have similar problem with date too. To make my forms and reports work for all date, I used to send the parameter from forms to the report in text format. In the report, I grab that parameter as "Text Format" (I mean the parameter created in Oracle Reports was really as Character in datatype property) then I manipulate them in my SQL to convert that "date" into real date using TO_DATE function. Usually I use DD-MM-YYYY as my date format.
    Hope this help.
    Regards,
    Franko Lioe
    Hello friends at www.oracle.com,
    when I sent some informations to Reports, one of these informations was a date field. Here, the format mask may vary from one computer to another - some computers here are using american date format; however, my computer was using brazilian date format.
    The fact is that I was sending date information to Reports using the mask dd/mm/yyyy, and Reports (in the computer that uses american date format) couldn't recognize it, stating that I was sending an invalid month. So I had to change my date information to dd-mon-yyyy and Reports could run in the other computer, but doesn't run here anymore - fact that obligated me to change my date format to american format.
    Is there any way for me to use a date format mask that's valid to all computers here? If other computers - with other format masks - meet the same problem, the use of this program may become something very complicated.
    Thanks for all answers,
    Franklin Gongalves Jr.
    [email protected]

  • How can I parse this date format?

    Hey,
    i am trying to write an interface between two applications. One application gives me the following date:
         Wed Jul 16 12:18:20 CEST 2003
    but I need it to look like this:
         16.07.03 12.18:20
    I tryed to use Date and DateFormat to parse and change it but the Date was unparseable.
    I hope somebody can point me to the right direction or show me how I can do the formating.
    Thanx a lot!
    Martin

    If this isn't a well-known date format, I can't see any solution but to write small function yourself which doe the job.
    you can start with :
    String source = "Wed Jul 16 12:18:20 CEST 2003";
    String[] elements = source.split();//splits source around spaces
    then you write functions that map day of week with numbers
    "Mon" --> 1
    "Tue" --> 2
    etc...
    it won't take you days to write this.
    Sometimes it's faster to write the stuff yourself than spending days looking for something pre-defined that may or may not exist.

  • Problems in the date format

    Hi,
    I am working on a program in which i retrieve date fields from an Oracle 8 DB & need to execute other db statements.The extracted date field's format is however different from that of Oracle format.Is there some way of obtaining the date fileld in the original format.(i am using jdbc-odbc bridge for the connection)
    Also can i change the format of the date field(in terms of mm-dd-yy etc) in java.

    Hi,
    to convert a JAVA date to some format, you can use java.text.DateFormat. Instead of using this rather complex class, you may also use java.text.SimpleDateFormat, which can translate a date according to a pattern string.
    What you get from your database may be a java.sql.Date object, right? This is a subclass of java.util.Date. It does not imply any specific text representation. The toString method simply uses yyyy-mm-dd. But with the DateFormat-classes, you can convert it to (almost) any other textual representation.

  • Is there anyway to parse all Date format?

    I have a string here which represents a date, but the problem is that it could be in mm/dd/yy or yyyy.MM.dd format, how can I make my parse to recognize all format might appear? Thanks in advance

    use for java 1.4.01
    try
    ResourceBundle r = ResourceBundle.getBundle("sun.text.resources.LocaleElements",Locale.US);
    /* ResourceBundle r = ResourceBundle.getBundle("java.text.resources.LocaleElements",Locale.US);
    for java 1.3*/
    String[] s = r.getStringArray("DateTimePatterns");
    System.out.println(" &&&&&&&&&&&& "+s[2]+" ^^^^^^^^^^^^^^^^^^ "+s[7]);
    catch (java.util.MissingResourceException e)
    System.out.println(" ###"+e.getMessage());
    s[0] // full time pattern
    s[1] // long time pattern
    s[2] // medium time pattern
    s[3] // short time pattern
    s[4] // full date pattern
    s[5] // long date pattern
    s[6] // medium date pattern
    s[7] // short date pattern

  • Problem with output /  Data format

    Using CFMX 7.0.2
    Gupta SQLBase DB
    Here is my Query:
    <cfquery datasource="_Casewin" name="HomeData">
    SELECT CRL_RLINE.RDESC, CRL_RLINE.QUESNO
    FROM CRL_RLINE
    WHERE CRL_RLINE.R_CASE = '#FORM.CASE_NO#'
    </cfquery>
    RDESC is a memo data type, but returns this:
    1 ðÙT393252 rODBC Ser¨{² \©
    2 ðÙ
    3
    where the actual data is this:
    CRL_RLINE.QUESNO CRL_RLINE.RDESC
    1 NEIGHBOUR REMOVED FENCING AND WILL NOT REPLACE
    2 N.S.W
    3 NO
    I've tried string formats, trims, justify
    any ideas?

    Thanks Grizzly
    The driver is the Gupta SQLBase driver, other queries work
    fine from all connections. it just seems to be this one table
    throwing the wierd symbols in Coldfusion only.
    The Database front end that enters the data is fine, doing
    SQL queries in SQLBase, even in excel and access with linked tables
    work fine. It is only the output through coldfusion.
    This is the only field that uses the memo format, so not sure
    if that is the reason

  • Parsing XML data into MySQL database

    I need to parse data from an xml document rsiding on amother
    server into a mysql database residing on my server, so that I can
    pull data into a php site.
    Any help? Mybe there's a commercial script or something?
    I would also need to update the data daily
    Thanks!!

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_xmlsav.htm#1008593

  • Problem in retrieving data from MSAcess Database in a servlet

    Hi,
    I Have Used MS Access as my database......
    When i try to connect to the databse i get the following exception...
    java.sql.SQLException:[Microsoft][ODBC][Driver Manager]Data Source name not found and no default driver specified...But i have connected the database properly.....
    When i run my databse code as normal java class code it is running succesfully....but when i integrate with servlets i get this error......
    Can anyone help me soon.......
    Thanks,
    Akshatha

    Hi,
    The code is here............ i did not get any compilation error.........
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class Studlogn extends HttpServlet
         public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
              res.setContentType("text/html");
              PrintWriter out=res.getWriter();
              String l=req.getParameter("login");
              String p=req.getParameter("passwd");
              String dbl="";
              String dbp="";
              try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection con=DriverManager.getConnection("jdbc:odbc:Test2");
              Statement st=con.createStatement();
              String q1="Select * from Table1";
              ResultSet rs=st.executeQuery(q1);
              while(rs.next())
                   dbl=rs.getString(1);
                   dbp=rs.getString(2);
              }catch(Exception e)
                   System.out.println(e);
                   out.println("<html><body>"+e+"</body></html>");
              //if(dbl.equals(l)&&dbp.equals(p))
              out.println("<html><body>Connected to the Database"+dbl+","+dbp+"</body></html>");
              else
              out.println("<html><body>Please check ur password</body></html>");
              Thanks,
    Akshatha

  • 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.

  • Parsing xml data into oracle database

    Oracle ACEs,
    We got a requirement that needs to load xml data into oracle db. Is it possible to load xml data into oracle db using built-in package. Is Oracle provides one ?
    Our database version is Oracle 9i.
    Your help in this regard is highly appreciated.
    Many Thanks.

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_xmlsav.htm#1008593

Maybe you are looking for

  • Error while comitting a transaction in oSB. The following is the error stack

    Error while comitting a transaction in OSB. The following is the error stack <Apr 20, 2015 12:00:15 AM MDT> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Xid=BEA1-1AE41F1CAE45F2B146FD(296700848),Status=Rolled back. [Reas

  • ITunes will not install - have tried EVERYTHING - please help

    I recently (yesterday) bought an iPod and yesterday installed the iPod and iTunes software on my computer, with absolutely no problems. Then today, when I tried to get onto the Music Store, I could not access it. (error -3212 was the number, I think.

  • Looking for a new Hard Drive

    I am having trouble keeping up with my editing. With grand kids and RVing I am getting footage faster than I can edit. To that end I am looking into a Macbook pro so that I can edit when we travel. For the new laptop I will need a scratch disk. I wou

  • Dual monitor using imac

    Can I use my intel Imac as a dual monitor for my MBP?

  • Can't mount Esata as user without booting with it inserted

    When I plug in my NTFS-formatted eSATA drive it is not mounted. If I boot with it plugged in it's mounted but then I have problems during boot. My computer tries to do a filesystem check and it ends with "run fsck manually or press ctrl+D to continue