aspose file tools*
The moose likes JDBC and the fly likes Update Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Update Database " Watch "Update Database " New topic
Author

Update Database

Sander Silva
Greenhorn

Joined: May 15, 2011
Posts: 28
Hi All!

I'm trying to create an Update Gui for my Access database.
I create a insert GUi successfull, but I failed to convert it for Updating.
my updating code is full of errors, so i decided to post my Select
code, it is properly working. Please help me to create and Updating GUI.
in UPDATE statement WHERE clause should be equal to SVID

should be something like this

UPDATE Main
SET Family=(Family)
SET Genus=(Genus)
SET Species=(Species)
WHERE SVID=(SVID);

Updated values should pass from UpdateGui.java file.

UpdateGui.java


UpdateCode.java (Here is my Select query, please help to use it for Updating)



Please kindly help me, I'm new to Java and SQL.
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Here is what you need.

JDBC Tutorial
Sander Silva
Greenhorn

Joined: May 15, 2011
Posts: 28
Thank you very much!

Please can you give me a little help on the Query statement
What's wrong with this one,
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2495
    
    8


two single quotes?

While you are reading the tutorial, have a look at PreparedStatement. It would resolve errors like this.


OCUP UML fundamental and ITIL foundation
youtube channel
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Your update query has to be in this format.

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

...if you are using a PreparedStatement.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2495
    
    8

And you have 4 columns, but provide values to only the last three.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Update Database