Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issues connecting to DB using ORMLite and Record Insertion in Android

 
Srikant Venkata
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to connect to my Android Database using ORMLite. Basically, I have created a DAO and trying to Insert user object in RegisterActivity.java class.
But, I receive the below exception, I am quite new to DAO, Kindly suggest If the below approach is right.

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.divi.apps.db.DBHelper
at com.divi.apps.activities.RegisterActivity.insertUser(RegisterActivity.java 55)


DBHelper.java



In my RegisterActivity.java, I call the create method of the DAO




I have created a DBHelper initializing the DBName and Version.
I have also create a Dao based on the tutorials from ORMLite (http://ormlite.com/javadoc/ormlite-core/doc-files/ormlite_1.html#SEC1)
Also, I dont see the database folder in the File Explorer view under DDMS perspective.

The DB code used to connect to the Database is picked up from the tutorials.

Please let me know if there is a better way of doing this DB connect and Records Insertion.

-Regards
Srikant Mantha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic