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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:51:46+00:00 2026-06-17T18:51:46+00:00

I want to retrieve data from database and display it on LOG, here my

  • 0

I want to retrieve data from database and display it on LOG, here my code:

 String dd = "1/23/2013";

  String sp = "Sky Storm";

 Log.d("Checking",db.getMeterNUmber2(dd,sp).toString());

And getMeterNUmber2 are in DBAdapter and the data that im looking for are in database, so I just want to retrieve it.

My DB Adapter :

public ArrayList<String> getMeterNUmber2(String date , String Vname) throws SQLException {    

    String[] whereArgs = new String[]{date,Vname}; 

    Cursor mcursor = db.rawQuery("SELECT MeterNumber FROM " + SCAN_TABLE + " WHERE  Date = ? AND VendorName = ? ",whereArgs);

    ArrayList<String> results = new ArrayList<String>();
    while (mcursor.moveToNext()) {
        results.add(mcursor.getString(0));
    }

    return results;

}

I’m getting error in logcat:

01-24 19:57:13.590: E/AndroidRuntime(11662): FATAL EXCEPTION: main
01-24 19:57:13.590: E/AndroidRuntime(11662): java.lang.NullPointerException
01-24 19:57:13.590: E/AndroidRuntime(11662):    at scann.barcode.scan.DBAdapter.getMeterNUmber2(DBAdapter.java:303)
01-24 19:57:13.590: E/AndroidRuntime(11662):    at scann.barcode.scan.Result$1.onClick(Result.java:104)
  • 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-06-17T18:51:47+00:00Added an answer on June 17, 2026 at 6:51 pm

    i had the same problem as you and when i look at your log cat

     java.lang.NullPointerException ,
    

    It returning null value , so that means It does not read into your Database,

    please check if you have opened your database e.g : db.open() and close

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

Sidebar

Related Questions

Hii, I want to retrieve data from sql database and display dynamically in div
I have some text data from database that I want to display it on
I have two seperate databases from which I want to retrieve data and display
I want to retrieve data from a database with PHP and show it on
//Retrieve data to display string queryString2 = SELECT [ConfidenceLevel], [LoveLevel], [StressLevel] FROM [UserData] WHERE
I use the next code to retrieve data from a table in the database:
I have DropDownList with CascadingDropDown extender. If I want to retrieve data from the
I want to display the data retrieved from the JSP page in my List.
I want applications to share certain database data. I want one application to retrieve
I am using Self Join to retrieve data from SQLSERVER Database and displaying the

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.