I would like to pass a Javascritp array to a Java applet.
here is what I have so far.
Can someone tell me what I am doing wrong.
I get this error:
Thanks in advance!!!java.lang.NullPointerException
at LoadNew.updateTable(LoadNew.java:99)
Javscript:
HTML calling the appletCode:<script> var blah = new Array(); blah[0] = "value one"; blah[1] = "value two"; </script>
Java codeCode:<INPUT TYPE="button" WIDTH=20 VALUE="Insert" onClick="document.theOnlyApplet.updateTable(blah);">
Code:public void updateTable(String name[]) { try//3 { Connection conn = myConnection(); Statement stmt = conn.createStatement(); ResultSet uprs = stmt.executeQuery("SELECT * FROM test"); uprs.moveToInsertRow(); uprs.updateString("name", name[0]); :confused: :confused: :confused: //ERROR is HERE!!! uprs.updateString("email", name[1]); uprs.insertRow(); uprs.afterLast(); uprs.close(); stmt.close(); conn.close(); } catch (SQLException E)//3 { System.out.println("SQLException: " + E.getMessage()); System.out.println("SQLState: " + E.getSQLState()); System.out.println("VendorError: " + E.getErrorCode()); } }![]()
![]()


Reply With Quote


Bookmarks