Problem: java. lang. IllegalArgumentException: the bind value at index is null

Source: Internet
Author: User

Today I encountered such a problem and solved it. I know what is going on.

Java. lang class IllegalArgumentExceptionjava. lang. Object java. lang. Throwable java. lang. Exception java. lang. RuntimeException java. lang. IllegalArgumentException

The explanation of java. lang. IIIegalArgumentException is as follows:


The exception thrown by public class IllegalArgumentExceptionextends RuntimeException often indicates that an invalid or incorrect parameter is passed to the method.


Find the row with the error:

Cursor c = db.rawQuery("select * from tablename where cntrct_no=? AND product_code=?",new String[]{cntrct_no, product_code});while (c.moveToNext()) { }

Here I want to call the database and obtain the query result. I tracked the problem. The cntrct_no value I passed is null, he suggested that the bind value at index is null. I always thought that the second column of the index was incorrect when the data in the while column was obtained. Later I realized that it was a problem with the first number of data bound here.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.