mardi 28 février 2017

java.sql.SQLSyntaxErrorException: ORA-00984: column not allowed here

I am facing a problem while inserting data using a web form into my table. I am using a session attribute which when inserted into the table will also act as a foriegn key to another table. I have typed the same code into my sql command prompt and everything seems to work fine but the problem only persist when i use in the java web format. I have made sure that there are no typo's present.But still facing the same problem

<%@page import="storage.data"%>
<%
        String fn,un,ln,mb,em,sug;

         fn=request.getParameter("uname");
         //ln=request.getParameter("lname");
         mb=request.getParameter("mobno");
         em=request.getParameter("email");
         sug=request.getParameter("sugg");

         data dt=new data();

           out.println(fn+mb+em+sug);

           try{

                dt.st=dt.cn.createStatement();
                out.println("1");
                String insert="insert into feedback_user values(myseqfeed.nextval,'"+ session.getAttribute("regid").toString() +"','"+fn+"',"+em+","+Integer.parseInt(mb)+",'"+sug+"')";
                out.println("2");
                dt.st.executeUpdate(insert);
                out.println("3");
                    //response.sendRedirect("user_feedback.jsp?sub=1");
            }
            catch(Exception ex){
            out.println(ex);
            }
%>




Aucun commentaire:

Enregistrer un commentaire