开发者

Why am I getting these runtime errors? Cannot connect to database (Netbeans with sql db)

Ok,

  1. The database is present. I have successfully run the sql query file开发者_高级运维.

  2. I have included the bin.jar reference library to connect to the db.

When I run the program i get:

Cannot connect to database server

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at DBControl.getAllIndredients(DBControl.java:29)
        at Main.initFromDB(Main.java:207)
        at Main.<init>(Main.java:184)
        at Main$4.run(Main.java:171)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Can someone construe from this or have any ideas why I can't connect to the db server?


A NULL Pointer exception means that a reference has not been initialized. Did you forget to call "New" on something? You probably need a db connection object instance of some sort.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜