Hello! 

I'm using OJB!!! 

The problem is:

I want to make a test on insert.

 

Here is my sample-function:

 

public void doInsertTest() {

                Dept[] depts = null;

                for (int i = 0; i < 5; i++) {

                               depts[i].setDeptno(i);

                               depts[i].setDname("Hello");  

                }

                Object deptObj = depts;

                for (int i = 0; i < depts.length; i++) {

            Dept dept = (Dept) deptObj;

            broker.store(dept);

        }

        long time = System.currentTimeMillis();

                sendPage("screens/test-template", new VarMap().add("test",
time));

    }

 

But I've got java.lang.NullPointerException:

 

Depts are staying null!

 

 

What should I do?

How to pass an array to this function?

 

 

Reply via email to