Error while connecting to the database

  • Replies:1
Android Developer
  • Forum posts: 2

Jul 24, 2012, 1:59:45 PM via Website

Hi,

i was getting some error while connecting the data base

Here is my code (maindb.java)

package com.example.db1;

import android.app.Activity;
import android.os.Bundle;
import android.database.sqlite.SQLiteDatabase;

public class maindb extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maindb);
SQLiteDatabase db;
db = openOrCreateDatabase("DataBase.db",
SQLiteDatabase.CREATE_IF_NECESSARY, null);
//do the task you want here
db.close();
}
}


do i need to do anything else. It would be great help for me if some one helps on this

Thanks in Advance

Reply
Eric McBride
  • Forum posts: 1,790

Aug 15, 2012, 5:56:58 PM via Website

Jeremiah, you around to help on this?

Reply