VJDK - null pointer exception
Ruslan Zasukhin
sunshine at public.kherson.ua
Mon Aug 18 14:09:03 CDT 2003
on 8/14/03 20:23, Rodrigo Hjort at rodrigo.hjort at actumplus.com.br wrote:
Hi Rodrigo,
Hi Jochen,
I wonder if this issue was resolved ?
> In the code below (using VJDK's latest release):
>
> import java.awt.*;
> import java.awt.event.*;
> import com.paradigmasoft.valentina.vjdk.*;
>
> class BaseVDB extends Frame {
>
> public static void main(String args[])
> {
> System.out.println("Starting BaseVDB...");
>
> try
> {
> VJDK.init(4 * 1024 * 1024, "", "");
> VJDK.setDebugLevel(2);
>
> VDataBase db = new VDataBase();
> db.create("MeuBanco.vdb");
>
> VBaseObject boCliente = db.getBaseObject("Cliente");
> if (boCliente == null)
> {
> System.out.println("Creating table Cliente...");
> boCliente = db.makeNewBaseObject("Cliente");
>
> /* below happens the exception */
> VField fldCodigo = boCliente.makeNewField("Codigo", VJDK.TypeShort);
> VField fldNome = boCliente.makeNewField("Nome", VJDK.TypeString, 40);
> VField fldDataNasc = boCliente.makeNewField("DataNasc", VJDK.TypeDate);
> fldCodigo.setFlags(VJDK.fIndexed);
> }
> else
> {
> System.out.println("Table Cliente already exists.");
> }
> db.dump("MeuBanco.xml");
>
> db.flush(); /*save to disk*/
> db.close();
> VJDK.shutdown();
>
> }
> catch (VException vx)
> {
> int errCode = vx.getErrorCode();
> String errStr = vx.getErrorString();
> System.out.println("Erro VJDK: " + errCode + " - " + errStr);
> }
> }
>
> private VDataBase db;
> }
>
> "Exception in thread "main" java.lang.NullPointerException
> at myprojects.basevdb.BaseVDB.main(BaseVDB.java:94)"
>
> It gets compiled, but when started the application the error ocurrs at that
> point. What could be wrong?! If those lines which contains .makeNewField() are
> excluded, the error ceases.
>
> By the way, the VJDK documentation in PDF has some syntax errors. i.g.:
> VJDK.init() -> VJDK.Init()
> VDataBase.create() -> VDataBase.CreateDataBase()
> VDataBase.getBaseObject() -> VDataBase.GetBaseObject()
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list