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.

Execute Update from Java to Access database problem...

Thread view: 
lalalala - 26 May 2006 17:20 GMT
public boolean addItem(String barcode, String style, String colour,
String size, String qty, String store){
        boolean complete = false;
        String addItem = "INSERT INTO items (barcode, style, colour, size,
qty, store) VALUES
('"+barcode+"','"+style+"','"+colour+"','"+size+"','"+qty+"','"+store+"')";
        Statement stmnt = null;
        System.out.println(addItem);
        try {
            stmnt = conn01.createStatement();
            stmnt.executeUpdate(addItem);
            //stmnt.execute(addItem);
            complete = true;
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return complete;
    }

-----The statement works but the executeUpdate isnt updating the
database, when i use the same query directly in access it works and the
connection works for other queries, that modify the information of an
already existant row of information, but for this im not getting any
errors its just not updating my database.
Any ideas on what it could be?
Any help would be greatly appreciated.
Thank you, and ignore last message i fixed that problem
ducnbyu - 26 May 2006 17:35 GMT
Do you need a commit?
lalalala - 26 May 2006 17:41 GMT
Well for previous update statements it wasnt required (SQL commit), and
they updated succesfully. Although perhaps it is because in this case
i'm trying to insert a new row in the table.


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.