This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 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

how to update a record in msaccess data base using jdbc

k kousalya

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(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)

Could you please anyone help me

Thanks in advance

Deepak Bala

Joined: Feb 24, 2006
Posts: 6657

Something is wrong with your update query ?

MS-Access error

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

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

Joined: Jan 10, 2002
Posts: 60072

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:
subject: how to update a record in msaccess data base using jdbc
Similar Threads
error saving string fields larger than 2000 chars
Unsupported data conversion
javax.naming.NameNotFoundException:Name comp is not bound in this Context
Tomcat and jdbc/odbc
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing.