• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update Database

 
Sander Silva
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is what you need.

JDBC Tutorial
 
Sander Silva
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2584
11
C++ Linux Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

two single quotes?

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

 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your update query has to be in this format.

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...if you are using a PreparedStatement.

 
Jan Cumps
Bartender
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you have 4 columns, but provide values to only the last three.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic