This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Android and the fly likes Issues connecting to DB using ORMLite and Record Insertion in Android Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Issues connecting to DB using ORMLite and Record Insertion in Android" Watch "Issues connecting to DB using ORMLite and Record Insertion in Android" New topic
Author

Issues connecting to DB using ORMLite and Record Insertion in Android

Srikant Venkata
Greenhorn

Joined: Jun 16, 2011
Posts: 19
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues connecting to DB using ORMLite and Record Insertion in Android