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 1037007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:47:51+00:00 2026-05-16T14:47:51+00:00

I have an INSERT INTO … ON DUPLICATE KEY UPDATE … statement that executes

  • 0

I have an INSERT INTO ... ON DUPLICATE KEY UPDATE ... statement that executes fine (but with warnings) in the mysql> prompt:

mysql> INSERT INTO ... ON DUPLICATE KEY UPDATE ... ;
Query OK, 2 rows affected, 2 warnings (0.00 sec)
Warning (Code 1364): Field 'x' doesn't have a default value

However, when I try to execute the same statement via JDBC the warning shows up as an SQLException and no rows are updated:

java.sql.SQLException: Field 'x' doesn't have a default value
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
  at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536)
  at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468)  
  at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1957)
  at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
  at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
  at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2086)
  at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1365)

Is there a JDBC or mysql connector setting or command to ignore or suppress these warnings?

I’m using MySQL Community Server 5.1.31 with MySQL connector 5.1.8 and Java 1.5.0_24.

  • 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-16T14:47:52+00:00Added an answer on May 16, 2026 at 2:47 pm

    You can use INSERT IGNORE to suppress these completely.

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

Sidebar

Related Questions

Right now I have: INSERT INTO mytable (a,b,c,d) VALUES(1,2,3,4) ON DUPLICATE KEY UPDATE c=VALUES(c),d=VALUES(d)
I have an INSERT statement that looks like this: INSERT INTO officer (officer_number, name,
I have an INSERT query that works fine, but when I add an extra
I have an insert query for MySQL that looks like this: INSERT INTO table
I have an insert that looks like this (using MySQL) INSERT INTO user_actions(action_id,user_id,action_type,record_id,on_table) VALUES
I have an insert statement that pulls some data into a few table variables
First time I am trying duplicate key to have insert and update in one
If I have an insert statement such as: INSERT INTO MyTable ( Name, Address,
I have an insert query that gets generated like this INSERT INTO InvoiceDetail (LegacyId,InvoiceId,DetailTypeId,Fee,FeeTax,Investigatorid,SalespersonId,CreateDate,CreatedById,IsChargeBack,Expense,RepoAgentId,PayeeName,ExpensePaymentId,AdjustDetailId)
Hey guys quick question, I currently have an insert statement $query= INSERT into new_mail

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.