JDBC/ODBC connection failed in applet
843854Jan 11 2004 — edited Jan 12 2004Hi everybody,
i've created a JDBC/ODBC connection by creating a class test in which the connection is done.
When I run it as an application, it runs perfectly giving me my records in my database but when i include in in my Applet, it gives me the following
-----------------------------------------------------------------------------------------------------------------------------
Failed to load JDBC/ODBC driver.
java.lang.NullPointerException
at display.paint(display.java:115)
at sun.awt.RepaintArea.paint(RepaintArea.java:177)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
at java.awt.Component.dispatchEventImpl(Component.java:3678)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
------------------------------------------------------------------------------------------------------------------------
this a part of the code in the function :
public void paint(Graphics g){
test j =new test();
String[] k=j.retrieve_LecId();
if (k[0].equals("1")){
Font font = new Font("TimesRoman", Font.BOLD,20);
g.setFont(font);
g.drawString("LOGICAL TOPOLOGY",400,20);
g.drawImage(ImgHub, xHub,yHub, this);
g.drawImage(ImgPatchpanel, xPatch, yPatch,this);
}
}
Can somebody help me solve this problem?
Thanks avi