开发者

Nullpointer Exception in J2MEmicroDb createTable function

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);
      开发者_JS百科  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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜