Hi there!
 
I am working on this project on ND5 with Oracle 8i as database. As a part of work, I am required to insert user-input values into the database. These values are to be inserted into different tables.
I am using semi-automatic mode of ND transaction for this purpose. As far as my knowledge of ND API goes, it requires a CSpValue variable for the value. However, the work requires calculation of a field value (a alphanumeric string). I am not been able to convert this String value into CSpValue.
e.g.
We are asking the user user-name and password. Thus, we can have these in CSpValue. However, while inserting into the table, we are giving it a unique alphanumeric code, which we calculate while inserting.
We are using the code similar to following :
 
CSpInsert mnInsert = (CSpInsert)CSpider.getDataObject("doMNInsert");
  
mnInsert.setValue(0,NameFieldValue);
mnInsert.setValue(1,PasswordValue);
mnInsert.setValue(2,"CalculatedValue");    //Problem probably lies here
 
CSpTransaction tr = new CSpTransaction();
tr.addDataObject(mnInsert);
  
int command = tr.execute();
  
if(tr.succeeded() && (command != STOP_PROCESSING))
{
   CSpHtml.write("Operation Successful...");
}
 
Upon compilation and running of project, when button is clicked, it throws exception, saying :
 
  • Unexpected exception from an event (java.lang.NullPointerException). This is when invoking method btInsert2_onWebEvent for event spider.event.CSpWebEvent[ON_WEB_EVENT, Method=Project.pgTest.btInsert2_onWebEvent (btInsert2)] on spider.visual.CSpButton:
  • spider.event.adapters.CSpPageEventAdapter.relayGenericEventProcessing: Unexpected Exception (java.lang.NullPointerException) caught. Top of stack: |java.lang.NullPointerException
 
 
 Please help me out.
Is my approach right?
 
Thanx.
Rajneesh

Reply via email to