Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: problem in inserting record in ms access. Date: Thu, 4 Oct 2012 19:39:18 +0000 (UTC) Organization: UK Free Software Network Lines: 24 Message-ID: References: <110ed4b2-e29a-4c6d-81df-3eee8e532a7c@googlegroups.com> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1349379558 31968 84.45.235.129 (4 Oct 2012 19:39:18 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Thu, 4 Oct 2012 19:39:18 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com comp.lang.java.programmer:19106 On Wed, 03 Oct 2012 21:47:34 -0700, Navnath Gadakh wrote: Your problem is here: > st = con.createStatement(); > By default this statement causes executeQuery() to create a non- updateable ResultSet, so your second try/catch block will fail when you try to update it. The Javadocs entry for the ResultSet Interface makes this quite clear. It also explains how to create updateable ResultSets. As a minor point, why use two try/catch blocks when one will do? Be aware that a thrown SQLException frequently is the head of a chain on related SQLException, so your catch block should show the messages from every exception in the chain or you can miss seeing all the debugging information that JDBC makes available. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |