tags:

views:

91

answers:

2

My code is

         J2MESDLIB.generateDB(true);
        J2MEColumn c1 = new J2MEColumn("desc", true, J2MEColumn.ColumnType.VARCHAR, 20);
        J2MEColumn c2=new J2MEColumn("date", false, J2MEColumn.ColumnType.VARCHAR, 20);
        J2MEColumn c3=new J2MEColumn("type", false, J2MEColumn.ColumnType.VARCHAR, 20);
        J2MEColumn c4=new J2MEColumn("assigned", false, J2MEColumn.ColumnType.VARCHAR, 100);

        Vector vector=new Vector(4);
        vector.addElement(c1);
        vector.addElement(c2);
        vector.addElement(c3);
        vector.addElement(c4);

       J2METable table1=J2MESDLIB.createTable("todo", vector, 1);

it gives exception at the last line i.e java.lang.NullPointerException java.lang.NullPointerException at edu.upc.J2MESDLIB.J2MEDBException.(J2MEDBException.java:82) at edu.upc.J2MESDLIB.J2MESDLIB.createTable(J2MESDLIB.java:193) at hello.TodoRecordStore.openRecord(TodoRecordStore.java:52)

A: 

When I downloaded J2MEMicroDB from the first result of a google search, it only supported one default language for J2MEDBException messages.

I assume the version you have would have been localised.

The NullPointerException could be caused by a bad language-specific set of error messages.

Unfortunately, that only means the NullPointerException is only masking the J2MEDBException that J2MEMicroDB was trying to throw.

Given the code you posted, my only guess as to the original J2MEDBException would be that the "todo" table already exists.

QuickRecipesOnSymbianOS
A: 

J2ME MicroDb is works with the test jar, look for J2ME MicroDBTests.jar file from the MicroDB website, add the jar to your project & start working. Works great on the emulator, but facing problems when you run it on the device. Problem is the app runs good i.e saves data, retrieves data, deletes data etc. the first time it is run on the device, Once you close the application & open it again, the app does not work, nor it is able to retrieve the previously saved data. IF anyone has faced similar issues & resolved it, please post the solution for that problem here.

Deepak