aspose file tools*
The moose likes JDBC and the fly likes how to update a record in msaccess data base using jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to update a record in msaccess data base using jdbc" Watch "how to update a record in msaccess data base using jdbc" New topic
Author

how to update a record in msaccess data base using jdbc

k kousalya
Greenhorn

Joined: Jun 09, 2009
Posts: 12
hai all,
I am developing small application. My database is msaccess databse. I am using jdbc connection by creating DSN. In that application i could get the data from the data base. But I am unable to modify the data using UPDATE query.

My databse is (Contacts):

EmployeeNumber EmployeeName ProjectName Age
(int) (string) (string) (int)

my code is

I am getting the following error


java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
at UpdatedServlet.doPost(UpdatedServlet.java:57)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

Could you please anyone help me

Thanks in advance

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Something is wrong with your update query ?

MS-Access error


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
k kousalya
Greenhorn

Joined: Jun 09, 2009
Posts: 12
Deepak Bala wrote:Something is wrong with your update query ?
thanks Deepak.
Now i came to know my mistake.
MS-Access error
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to update a record in msaccess data base using jdbc