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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:57:29+00:00 2026-05-28T00:57:29+00:00

Part of my application is to bring user account information from dynamic database. When

  • 0

Part of my application is to bring user account information from dynamic database. When a user entered his username and password, I will search for username in the database and bring all data related to his username. I am using getTwitterAccount for search and My primary key is String “TW_USERNAME”. Here it’s part of database code:

public String[] getTwitterAccount(String username) {
    Cursor cursor = db.query(true, TABLE_1, null, TW_USERNAME + "=" + username, null, null, null, null, null);


    if ((cursor.getCount() == 0) || !cursor.moveToFirst()) {
        return null;
    }

    String[] account = new String[3]; 
    account[0] = cursor.getString(cursor.getColumnIndex(TW_USERNAME));
    account[1] = cursor.getString(cursor.getColumnIndex(TW_AUTH_KEY));
    account[2] = cursor.getString(cursor.getColumnIndex(TW_AUTH_SECRET_KEY));

    return account;
}  

I got error in the query. I searched for this problem and they said “Primary key should be integer “_id”. Is there anyway to search in the database by using String not Integer?

  • 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-28T00:57:29+00:00Added an answer on May 28, 2026 at 12:57 am

    try this: TW_USERNAME + “= ‘” + username +”‘” Your input parameter should be in single quotes, if it is String.

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

Sidebar

Related Questions

I developed an ipad application. Some part of the application will bring the user
I am writing an application which will cut the part of the Mp3 song
We have an application that is being moved to .NET. One part of the
Part of my application maps resources stored in a number of locations onto web
Part of my application depends on JavaMail, moving arranging messages etc. Is it possible
For part of my application I have a need to create an image of
A part of the application that I am working on is a legacy Vb6
A part of the application I'm working on is an swf that shows a
As part of my application requirements, I have a limit of 30 characters for
As a part of our application I need to write simple workflow system which

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.