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

  • Home
  • SEARCH
  • 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 7562323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:23:14+00:00 2026-05-30T13:23:14+00:00

I was just About to create a Sample for Proper Understanding on how the

  • 0

I was just About to create a Sample for Proper Understanding on how the Hello Android for ORMLite works in Android.

    public class SchoolDataBean {


// id is generated by the database and set on the object automagically
@DatabaseField(generatedId = true)
int rollNo;
@DatabaseField(index = true)
String name;
@DatabaseField
String gender;
@DatabaseField
boolean presence;

public SchoolDataBean() {
//required by ORM :)
}

public void setRollNo(int rollNo) {
    this.rollNo = rollNo;
}

public void setName(String name) {
    this.name = name;
}

public void setGender(String gender) {
    this.gender = gender;
}

public void setPresence(boolean presence) {
    this.presence = presence;
}

}

In the Database Helper when I try Inserting the initial Values and creating the table with

      SchoolDataBean schoolDataSecond = new SchoolDataBean();
    schoolDataSecond.setName("Ram");
    schoolDataSecond.setGender("F");
    schoolDataSecond.setPresence(true);
    schoolDataSecond.setRollNo(2);
    dao.create(schoolDataSecond);

I get this exception from the ORMLite Library as

  sqlite returned: error code = 1, msg = duplicate column name: gender

   java.sql.SQLException: SQL statement failed: CREATE TABLE `schooldata` (`rollNo` INTEGER PRIMARY KEY AUTOINCREMENT , `name` VARCHAR , `gender` VARCHAR , `gender` VARCHAR , `presence` SMALLINT ) 

thanks everyone.

      The Exception seems to be caused at this line
        TableUtils.createTable(connectionSource, SchoolDataBean.class);
  • 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-30T13:23:16+00:00Added an answer on May 30, 2026 at 1:23 pm

    Actually i didn’t realize that I needed to check the Config.txt for Column names too, there it was, two similar column names which caused this duplication problem.

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

Sidebar

Related Questions

I'm reading a book about java. It just got to explaining how you create
I find some sample code about PNS, article here and I also create an
Given a simple Flask application, I'm just curious about whether there is a proper
Just about every piece of example code everywhere omits error handling (because it confuses
Hi just about to get the dev team to start looking at the next
I'm just about to make my first trip into the world of JNI (Java
I'm just about wrapped up on a project where I was using a commercial
I've gone through just about every property I can think of, but haven't found
I use log4net in just about every code project. I was wondering what other
i was just about to finish up my project and install it as a

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.