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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:33:34+00:00 2026-05-25T17:33:34+00:00

I have a little issue with Android SQL queries. Here is the my code

  • 0

I have a little issue with Android SQL queries.

Here is the my code :

        Communicator rpc;
        dbHelper = new DataBaseHelper(context, "oops_sys_tpl.sqlite", null, 1);
        dbHelper.getDatabase();
        dbHelper.executeQuery("users", "id", "75");
        dbHelper.executeQuery("users", "objectId", "2");
        dbHelper.executeQuery("users","serverName","ooops.com");
        dbHelper.executeQuery("users", "username", "muphet");

        newServerName = "stampii.com";
        Log.w("UserId","Show user Id : "+userId);
        int uuId = rpc.localUserIdByServerUserId(userId,newServerName);
        Log.w("uuId","uuId : "+uuId);

In Communicator class :

public static int localUserIdByServerUserId(int serverUserId){

    String query = "SELECT id FROM users WHERE objectId = "+serverUserId+" LIMIT 1";
    Map<String,Object> result = new HashMap<String,Object>();
    result.get(dbHelper.executeSQLQuery(query));

    int uuid = Integer.parseInt(result.get(0).toString());
    return uuid;
}

public static int localUserIdByServerUserId(int serverUserId, String serverName){

    String query = "SELECT id FROM users WHERE objectId = "+serverUserId+" AND serverName = "+serverName+" LIMIT 1";
    Map<String,Object> result = new HashMap<String,Object>();
    result.get(dbHelper.executeSQLQuery(query));

    int uuid = Integer.parseInt(result.get(0).toString());
    Log.w("localUSerByIdServerUserId","LocalUserByIdServerUserId result : "+uuid);
    return uuid;
}

In DatabaseHelper class :

SQLIteDatabase sqliteDb;
   public boolean executeQuery(String tableName,String keys,String value){
        return execQuery(tableName,keys,value);
    }

    private static boolean execQuery(String tableName,String key,String value){
        sqliteDb = instance.getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(key, value);
        sqliteDb.insert(tableName, null, values);

        return true;

    }

And it’s throwin me a NullPointerException at :

result.get(dbHelper.executeSQLQuery(query));

Any suggestions how can I fix that?

  • 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-25T17:33:35+00:00Added an answer on May 25, 2026 at 5:33 pm

    The method that you are calling in this line : result.get(dbHelper.executeSQLQuery(query)); and the method which you show here public boolean executeQuery() are different one, so I guess the problem is in the other one.Check it and you will find the answer,or paste it here so we can help you.

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

Sidebar

Related Questions

Hey guys I have a little issue here. I have a panel where I
Hey guys, I have a little issue here. I need my users to be
I have a little issue here regarding the modification of Web.Config files in Feature
I have a little issue here. Why does my search bar search when I
I'm running in a little issue here regarding jsf related dropdown selection. I have
I have a little issue here; my goal is to be able to process
I have a little issue concerning an animation-effect which loads a certain div into
So I'm having pretty much exactly the problem described here: http://code.google.com/p/android/issues/detail?id=6191 and until the
I have a strange little issue with a WCF RIA service I'm using in
This little issue is starting to do my head in, I have read around

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.