<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[JavaRanch: Latest posts for the topic "how to update a record in msaccess data base using jdbc"]]></title>
		<link>http://www.coderanch.com/forums/t/3/JDBC/update-record-msaccess-data-base</link>
		<description><![CDATA[Latest messages posted in the topic "how to update a record in msaccess data base using jdbc"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>how to update a record in msaccess data base using jdbc</title>
				<description><![CDATA[hai all,<br />   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.<br /> <br /> My databse is (Contacts):<br /> <br /> EmployeeNumber	EmployeeName	ProjectName	Age<br /> (int)                           (string)                       (string)                   (int) <br /> <br /> my code is<br /> <pre>   
Class.forName(&quot;sun.jdbc.odbc.JdbcOdbcDriver&quot;);
Connection con = DriverManager.getConnection(&quot;jdbc:odbc:access&quot;,&quot;&quot;, &quot;&quot;);
Statement st = con.createStatement();
String sql = &quot; UPDATE Contacts SET EmployeeName='&quot; + empName
	  + &quot;',ProjectName='&quot; + projectName + &quot;',Age=&quot;
	  +age + &quot; WHERE EmployeeNumber=&quot; + empNumber;
int result=st.executeUpdate(sql);
 </pre><br /> I am getting the following error<br /> <br /> <br /> <a href="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html" class="api" title="Java API" target="_new" rel="nofollow">java.sql.SQLException</a>: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.<br /> 	at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)<br /> 	at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)<br /> 	at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)<br /> 	at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)<br /> 	at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)<br /> 	at UpdatedServlet.doPost(UpdatedServlet.java:57)<br /> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)<br /> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br /> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br /> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br /> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br /> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br /> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)<br /> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br /> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br /> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)<br /> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)<br /> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)<br /> 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)<br /> 	at java.lang.Thread.run(Unknown Source)<br /> <br /> Could you please anyone help me<br /> <br /> Thanks in advance<br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/451378/2009967</guid>
				<link>http://www.coderanch.com/forums/posts/preList/451378/2009967</link>
				<pubDate><![CDATA[Fri, Jun 26 2009 00:53:05 MDT]]></pubDate>
				<author><![CDATA[k kousalya]]></author>
			</item>
			<item>
				<title>how to update a record in msaccess data base using jdbc</title>
				<description><![CDATA[Something is wrong with your update query ?<br /> <br /> <a class="snap_shots" href="http://support.microsoft.com/kb/216425" target="_new" rel="nofollow">MS-Access error</a>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/451378/2009981</guid>
				<link>http://www.coderanch.com/forums/posts/preList/451378/2009981</link>
				<pubDate><![CDATA[Fri, Jun 26 2009 01:19:10 MDT]]></pubDate>
				<author><![CDATA[Deepak Bala]]></author>
			</item>
			<item>
				<title>how to update a record in msaccess data base using jdbc</title>
				<description><![CDATA[<blockquote>
			<div>
				<cite>Deepak Bala wrote:</cite>Something is wrong with your update query ?<br /> thanks Deepak.<br /> Now i came to know my mistake. <br /> <a class="snap_shots" href="http://support.microsoft.com/kb/216425" target="_new" rel="nofollow">MS-Access error</a></div>
		</blockquote>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/451378/2009984</guid>
				<link>http://www.coderanch.com/forums/posts/preList/451378/2009984</link>
				<pubDate><![CDATA[Fri, Jun 26 2009 01:26:25 MDT]]></pubDate>
				<author><![CDATA[k kousalya]]></author>
			</item>
			<item>
				<title>how to update a record in msaccess data base using jdbc</title>
				<description><![CDATA[Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.<br /> <br /> For more information, please <a class="snap_shots" href="http://faq.javaranch.com/view?CarefullyChooseOneForum" target="_new" rel="nofollow">read this</a>.<br /> <br /> This post has been moved to a more appropriate forum.<br /> <br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/451378/2010292</guid>
				<link>http://www.coderanch.com/forums/posts/preList/451378/2010292</link>
				<pubDate><![CDATA[Fri, Jun 26 2009 07:48:55 MDT]]></pubDate>
				<author><![CDATA[Bear Bibeault]]></author>
			</item>
	</channel>
</rss>
