aspose file tools*
The moose likes JDBC and the fly likes Error 500 in root causes saying not enough value error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error 500 in root causes saying not enough value error" Watch "Error 500 in root causes saying not enough value error" New topic
Author

Error 500 in root causes saying not enough value error

Ronak Trivedi
Greenhorn

Joined: Feb 23, 2012
Posts: 6
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00947: not enough values
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:534)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:442)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

javax.servlet.ServletException: java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00947: not enough values
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840)
org.apache.jsp.registered_jsp._jspService(registered_jsp.java:133)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


root cause

java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00947: not enough values
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3148)
sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:215)
sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:137)
org.apache.jsp.registered_jsp._jspService(registered_jsp.java:123)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.11 logs.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.11







Hello Sir this type of Error coming my project code is

<%--
Document : registered
Created on : Mar 20, 2006, 6:44:55 PM
Author : Rushi
--%>
<%@page language="java" import="java.sql.*" contentType="text/html" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Registration Confirmation</title>
</head>
<body>
<%
String eid = request.getParameter("eid");
String fname = request.getParameter("fname");
String mname = request.getParameter("mname");
String lname = request.getParameter("lname");
String gender = request.getParameter("gender");
String email = request.getParameter("email");
String process = request.getParameter("process");
String designation = request.getParameter("designation");
String dob = request.getParameter("dob");
String cadd = request.getParameter("cadd");
String ccity = request.getParameter("ccity");
String cstate = request.getParameter("cstate");
String ccountry = request.getParameter("ccountry");
String czip = request.getParameter("czip");
String padd = request.getParameter("padd");
String pcity = request.getParameter("pcity");
String pstate = request.getParameter("pstate");
String pcountry = request.getParameter("pcountry");
String pzip = request.getParameter("pzip");
String bname = request.getParameter("bname");
String brname = request.getParameter("brname");
String accno = request.getParameter("accno");
String pcno = request.getParameter("pcno");
String uname = request.getParameter("uname");
String pwd = request.getParameter("pwd");
String cpwd = request.getParameter("cpwd");
String acctype = request.getParameter("acctype");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn = DriverManager.getConnection("jdbcdbc:Employee","system","tiger");
PreparedStatement s = cn.prepareStatement("insert into EMPLOYEE values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
s.setString(1,eid);
s.setString(2,fname);
s.setString(3,mname);
s.setString(4,lname);
s.setString(5,gender);
s.setString(6,email);
s.setString(7,process);
s.setString(8,designation);
s.setString(9,dob);
s.setString(10,cadd);
s.setString(11,ccity);
s.setString(12,cstate);
s.setString(13,ccountry);
s.setString(14,czip);
s.setString(15,padd);
s.setString(16,pcity);
s.setString(17,pstate);
s.setString(18,pcountry);
s.setString(19,pzip);
s.setString(20,bname);
s.setString(21,brname);
s.setString(22,accno);
s.setString(23,pcno);
s.setString(24,uname);
s.setString(25,pwd);
s.setString(26,cpwd);
s.setString(27,acctype);
s.executeUpdate();%>
<h1 align ="center"><u>Thank You For Registration!</u></h1>
</body>
</html>
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2477
    
    7



Try to enter the fioeld names in the sql statement.






OCUP UML fundamental and ITIL foundation
youtube channel
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

don't try DO, ALWAYS list the column names, the error message is saying you haven't provided enough values in your insert statement.
There is another thread on here from a guy who found the columns were in diffenent order depending on how he ran his select statement.
Column order IS NOT RELIABLE.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error 500 in root causes saying not enough value error
 
Similar Threads
SQL Server JDBC Connectivity Error
JDBC code with type 1 driver not working
ArrayIndexOutOfBoundsException
Bean property problems
problem with the request dispatcher