Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating/Inserting Multiple Tables

 
Bob Thorton
Greenhorn
Posts: 12
Java Mac OS X Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My current program wont properly Insert or Update a users information. For each I am getting a INSERT and UPDATE syntax error.



Not sure where I am going wrong. Is it possible something in my Access DB could be restricting me from inserting and updating?
 
Bob Thorton
Greenhorn
Posts: 12
Java Mac OS X Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone have an idea of some sort of test I can run to see if I am doing something wrong somewhere
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start using PreparedStatement instead of Statement. It will perform the escaping for you, and you will prevent SQL injection.
 
Bob Thorton
Greenhorn
Posts: 12
Java Mac OS X Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Couldnt not figure out how to properly implement the preparedstatement . plus im not sure i can even do that, unless somehow in the code i represent one of the strings as a New Customer
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Prepared Statements. Which is the first hit if you google on preparedstatement tutorial.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic