Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4324688
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:09:58+00:00 2026-05-21T09:09:58+00:00

What am I doing wrong? I keep getting weird errors from SQL? //get parameters

  • 0

What am I doing wrong? I keep getting weird errors from SQL?

   //get parameters from the request
 String custID=request.getParameter("cust_ID");
 String saleID=request.getParameter("sale_ID");
 String firstName=request.getParameter("first_Name");
 String mInitial=request.getParameter("mI");
 String lastName=request.getParameter("last_Name");
 String streetName=request.getParameter("street");
 String city=request.getParameter("city");
 String state=request.getParameter("state");
 String zipCode=request.getParameter("zip_Code");
 String DOB=request.getParameter("DOB");
 String agentID=request.getParameter("agent_ID");
 String homePhone=request.getParameter("home_Phone");
 String cellPhone=request.getParameter("cell_Phone");
 String profession=request.getParameter("profession");
 String employer=request.getParameter("emoployer");
 String referrer=request.getParameter("referrer");


   preparedStatement = conn.prepareStatement("INSERT INTO customer (cust_ID, sale_ID, first_Name, mI, last_Name, street_Name, city, state, zip_Code, DOB, agent_ID, home_Phone, cell_Phone, profession, employer, referrer)"
                + " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");

preparedStatement.setInt(1, Integer.valueOf(custID));
preparedStatement.setInt(2, Integer.valueOf(saleID));
preparedStatement.setString(3, firstName);
preparedStatement.setString(4, mInitial);
preparedStatement.setString(5, lastName);
preparedStatement.setString(6, streetName);
preparedStatement.setString(7, city);
preparedStatement.setString(8, state);
preparedStatement.setString(9, zipCode);
preparedStatement.setString(10, DOB);
preparedStatement.setInt(11, Integer.valueOf(agentID));
preparedStatement.setString(12, homePhone);
preparedStatement.setString(13, cellPhone);
preparedStatement.setString(14, profession);
preparedStatement.setString(15, employer);
preparedStatement.setString(16, referrer);

preparedStatement.executeUpdate();

SQL DDL

   CREATE TABLE customer
       (cust_ID     NUMBER          NOT NULL,
        sale_ID             NUMBER          NOT NULL,
        first_Name      VARCHAR2(30)        NOT NULL,
        mI          VARCHAR2(2)         ,
        last_Name       VARCHAR2(50)        NOT NULL,
        street_Name     VARCHAR2(50)        NOT NULL,
        city            VARCHAR2(30)        NOT NULL,
        state           VARCHAR2(2)     NOT NULL,
        zip_Code        VARCHAR2(5)     NOT NULL,
        DOB         DATE            ,
        agent_ID        NUMBER              ,
        home_Phone      VARCHAR2(12)        UNIQUE,         
        cell_Phone      VARCHAR2(12)        UNIQUE,
        profession      VARCHAR2(30)            ,
        employer        VARCHAR2(30)            ,
        referrer        VARCHAR2(30)            
     );    

SQL DML

   INSERT INTO customer VALUES (primary_ID.nextval,17,'Kito','M','Bradford','123 DeLancy Lane','Wabash','TX','12345','01-JAN-69',1,'222-222-2222','301-555-6874','software engineer','HPL', NULL);
   INSERT INTO customer VALUES (primary_ID.nextval,18,'Morpheus',' ','Smith','1289 Matrix Lane','Idaho', 'NE', '45678','06-JUN-72',2,'321-654-9877','258-852-9635','doctor', 'The OC', NULL);

Error message

org.apache.jasper.JasperException: An exception occurred processing JSP page       
/customerAdd.jsp at line 70


67:     <%preparedStatement.setString(15, employer);%>

68:     <%preparedStatement.setString(16, referrer);%>

69: 

70:     <%preparedStatement.executeUpdate();%>


root cause

javax.servlet.ServletException: java.sql.SQLException: [Oracle][ODBC][Ora]ORA-
01400:cannot insert NULL into ("CM485A07"."CUSTOMER"."STREET_NAME")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:09:59+00:00Added an answer on May 21, 2026 at 9:09 am

    You are tyring to insert a NULL value into the street_Name column which has a NOT NULL constraint.

    Probably something is wrong here:

    String streetName=request.getParameter("street");
    

    Double check the name of the request parameter against the actual request. Maybe there is a mismatch in names or the requesting side forgets to send it.

    BTW look like you have a typo here to:

    String employer=request.getParameter("emoployer");
    

    I expect your request parameter is called “employer” without the additional o

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought I was doing the right thing but I keep getting the wrong
I don't understand what I'm doing wrong here ! I keep getting a Data
Hi i want to run an if statement but keep getting syntax errors near
What am I doing wrong? I have a simple console app in VS08. When
What am I doing wrong here? My use of the INTO clause seems to
I can't seem to figure out what I am doing wrong here. I publish
I find this very strange, must be something I'm doing wrong, but still... I'm
Am I doing something wrong or is it not possible to specify a generic
I must be doing something wrong. I can't seem to execute my CustomValidator's ServerValidate
Am I doing something wrong is this a known issue with the ASP.NET MVC

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.