Error while running pgm to save the data in the DB
<p>I have written code where in I am trying to save some data in the DB. When I run the code I get these exceptions:</p>

<pre><code>02-03 15:14:47.194: ERROR/AndroidRuntime(594): FATAL EXCEPTION: main
02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)
02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.main(ActivityThread.java:3647)
02-03 15:14:47.194: ERROR/AndroidRuntime(594):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)
</code></pre>

<p>Can anyone help me on this?</p>

<p>1.MyOpenHelper.java</p>

<pre><code>public class MyOpenHelper extends SQLiteOpenHelper {
    public MyOpenHelper(Context context, String name, CursorFactory factory,int version) {
        super(context, name, factory, version);

    }

    /** Called when the activity is first created. */
    public void onCreate(SQLiteDatabase POIDetailsDB){
        POIDetailsDB.beginTransaction();

        POIDetailsDB.execSQL("CREATE TABLE POIDetails(Lat TEXT,Lon TEXT,POIName TEXT,Radius TEXT,Message TEXT)");

        POIDetailsDB.setTransactionSuccessful();
        POIDetailsDB.endTransaction();
        Log.d("TAG","Table created succesfully");

    }
</code></pre>

<p>2.SQLDemo.java</p>

<pre><code>public class SqlDemo extends Activity{

    @Override

     public void onCreate(Bundle savedInstanceState) {
     .........................//

     MyOpenHelper openHelper = new MyOpenHelper(getApplicationContext(),"POI", null, 1);

     SQLiteDatabase POIDetailsDB = openHelper.getWritableDatabase();

     ContentValues values = new ContentValues();

    // POIDetailsDB.insert("POIDetails", null, values);
     values.put("Lat","18.535");
     values.put("Lon","73.767");
     values.put("POIName","Pune");
     values.put("Radius","5");
     values.put("Message","PUNE");

     String[] columns = new String[]{"Lat","Lon","POIName","Radius","Message"};
     Cursor cur = POIDetailsDB.query("POIDetails", columns, null, null, null, null, null);

     cur.moveToFirst();
</code></pre>
