I started with Town a few days ago but couldn't get any record beeing
saved to my database until now. If you have a look at the following
code, everithing works fine until the r.save()-command. This causes a
NullPointerException. Is there any special thing to take care of when
saving records?

Note, that the connection to the database and to the tables are all
right, the permissions are, too.

 Table t = csdb.AreaTable();
 Table et = csdb.EmployeesTable();

Area r = (Area)t.addRecord();

Employees e = (Employees)et.selectOne("name = 'Richter'");

r.setFachgebiet("POM"); // Fachgebiet
int dummy = csdb.nextID("Area");
r.setId(new Integer(dummy)); // neue ID
r.setEmployees(e); // neue Referenz auf Sachbearbeiter

 r.save();  // -> causes NullPointerException !!

Thanks
Bernd

--
------------------------------------------------

Mit freundlichen Gr��en

Bernd Adamowicz
Softwareentwicklung

------------------------------------------------
CAD Praxis GmbH
Rudolfstra�e 27a
88214 Ravensburg
Tel.: +49-751-366 16-0
Fax.: +49-751-366 16-51
Hotline: 01803 223772 oder [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
http://www.cad-praxis.de
------------------------------------------------





------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to