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 / General / May 2006

Tip: Looking for answers? Try searching our database.

Excecuting Update Statements

Thread view: 
morc - 25 May 2006 15:52 GMT
hey im having a little bit of trouble excecuting my update statsments.
I chekd in access directly and am sure that there is no errors in my
SQL.

this is the code i used. The connection is fine its been tested before.

String remove = "UPDATE items SET  qty = qty - 1 WHERE store =
'"+from+"' and barcode ='"+barcode+"'";

Statement stmt = null;

try {
                       stmt = conn01.createStatement();
                       stmt.executeUpdate(remove);
               } catch (SQLException e) {
                       e.printStackTrace();
               }

If anyone knows what the error is it would be greatly appreciated.
thanks
-morc
Oliver Wong - 25 May 2006 16:39 GMT
> hey im having a little bit of trouble excecuting my update statsments.
> I chekd in access directly and am sure that there is no errors in my
[quoted text clipped - 16 lines]
> If anyone knows what the error is it would be greatly appreciated.
> thanks

   See
http://riters.com/JINX/index.cgi/Suggestions_20for_20Asking_20Questions_20on_20N
ewsgroups#RepeatErrorsExactly


   Also, you're leaving yourself vulnerable to SQL injection attacks. See
http://nebupookins.net/entry.php?id=334 You'll probably want to google for
"Prepared Statements".

   - Oliver


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



©2008 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.