Java Basic Problems

Solution of Batch entry 0 insert into postgresql database table, Call getNextException to see the cause|| Learn How to solve this exception or error ||Java PostgreSQL Database Exception.

sun javaHave you ever faced this exception while executing sql query in  your software  or  database?? Well, I am using  Java programming language in the front end and PostGreSQL in the backend i.e. server side. Recently I have faced the following  exception which was showing actually from the database. I searched internet for the solution but didn’t get any reliable solution. But at last I have solved it and sharing the solution procedure with you. Hope it will also work with your problem

Here is the problem (Exception)

Batch entry 0 insert into endproduct_mat_req(item_no,end_product_mat_no,mat_no,qty) values(523,71,44,100000.0) was aborted.  Call getNextException to see the cause

Here Is the Database (PostGreSQL) Table which I am using in our  ERP  software

 Batch entry 0 insert into postgresql  database table

While Checking the log (output from System.out.println() function)   What I have found, the following data was inserting in my table.

 

 Batch entry 0 insert into postgresql  database table

Here, What I have noticed,  when Big Decimal value  is going to six digits ( means, 1 lakh ) it is throwing this exception,  this big decimal value was saving in the qty  field  of  endproduct_mat_req table.

Solution:

I have got one solution, the  qty field in endproduct_mat_req  table was numeric(15,5). To solve this exception I just increased the size of the qty field  as below


 batch entry 0 postgre sql exception

After changing the size of qty field the exception gone.

2 thoughts on “Solution of Batch entry 0 insert into postgresql database table, Call getNextException to see the cause|| Learn How to solve this exception or error ||Java PostgreSQL Database Exception.”

  1. I have the same exception on my Java web application which uses Postgresql database. In my situation, the cause of the exception is, trying to set null values to not null set columns in the db.

    I hope that information will be useful.

    Like

  2. I have the same exception , null’s are not accepted in postgresql for not null , make sure that they have defaults or provide any value while insertion , for my problem i have used 0000-00-00 as date.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s