Results 1 to 2 of 2
Thread: What's wrong with my code?
- 10-30-2011, 11:31 AM #1
Senior Member
- Join Date
- Oct 2010
- Posts
- 139
- Rep Power
- 0
What's wrong with my code?
I can't figure out what's wrong with my code. It runs and everything, but it doesn't put in any values into the database.
here is the errors:Java Code:private String naam1; private String naam2; private String playup; private String rotate; SQLUserinfo (String nm1, String nm2, String plyp, String rtte)throws SQLException { naam1 = nm1; naam2 = nm2; playup = plyp; rotate = rtte; updateMthd("INSERT INTO Extra VALUES(naam1, naam2, playup, rotate)"); }
Java Code:Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4. at Userinfo.button1MouseClicked(Userinfo.java:40) at Userinfo.access$100(Userinfo.java:12) at Userinfo$2.mouseClicked(Userinfo.java:204) at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) at java.awt.Component.processEvent(Component.java:5803) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916) at java.awt.Container.dispatchEventImpl(Container.java:2102) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) Caused by: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4. at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114) at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3110) at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338) at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288) at SQLUserinfo.updateMthd(SQLUserinfo.java:75) at SQLUserinfo.<init>(SQLUserinfo.java:24) at Userinfo.button1MouseClicked(Userinfo.java:34) ... 23 more
Last edited by Johanis; 10-30-2011 at 11:33 AM.
- 10-30-2011, 12:38 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
Re: What's wrong with my code?
You still have another tread running about the very same subject: SQL problems. I'm locking this one.
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
What is wrong with this code?
By Mythreadings in forum New To JavaReplies: 38Last Post: 11-19-2010, 12:43 AM -
Need help! something wrong in my code
By novak100 in forum New To JavaReplies: 2Last Post: 11-18-2009, 11:59 PM -
what's the wrong in this Code
By the swan in forum AWT / SwingReplies: 1Last Post: 04-04-2009, 04:27 AM -
pls tell wat wrong with my code???
By low224 in forum New To JavaReplies: 13Last Post: 01-11-2009, 07:40 AM


LinkBack URL
About LinkBacks

Bookmarks