iIIegalArgumentException:the bind value at index 1 isnull
生活随笔
收集整理的這篇文章主要介紹了
iIIegalArgumentException:the bind value at index 1 isnull
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
iIIegalArgumentException:the bind value at index 1 isnull
這個java.lang.IIIegalArgumentException的解釋如下:
public classIllegalArgumentExceptionextends RuntimeException拋出的異 常表明向方法傳遞了一個不合法或不正確的參數
?
找到這個問題對應的出現錯的行:
[java]?viewplaincopy
Cursor?c?=?db.rawQuery("select?*?from?tablename?where?cntrct_no=??AND?product_code=?",??
????????????????new?String[]{cntrct_no,?product_code});??
????????????while?(c.moveToNext())?{?}??
這里我是想調用數據庫 ,取得查詢結果,問題追蹤了一下,我傳值的cntrct_no是null,他提示的?the bind value at index is null 我一直認為下面while里面獲取數據的時候的index 的第二列數據有誤,后來才明白是這里綁定的第一個數據有問題。
轉載于:https://blog.51cto.com/jinchao/1605227
總結
以上是生活随笔為你收集整理的iIIegalArgumentException:the bind value at index 1 isnull的全部內容,希望文章能夠幫你解決所遇到的問題。