Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / July 2003

Tip: Looking for answers? Try searching our database.

Modified Rows

Thread view: 
rajkin - 07 Jul 2003 09:22 GMT
Hi,

I tried going thru the jdbc connection,statement, resultset API
documentation but i still cannot get a way to know if after a UPDATE
etc , how to find out
how many 'rows' were affected due to the executequery()?
BTW, I have been using preparedStatement.

can anyone advise?

thanking in advance,

rajkin
Thomas Kellerer - 07 Jul 2003 10:01 GMT
rajkin schrieb:
> Hi,
>
[quoted text clipped - 9 lines]
>
> rajkin
You shouldn't use executeQuery() for DB updates, executeUpdate() is
intended for that purpose

Quote from
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#executeUpdate()

Returns:
    either (1) the row count for INSERT, UPDATE, or DELETE statements
or (2) 0 for SQL statements that return nothing


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.