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

Updating/Inserting Multiple Tables

Bob Thorton
Greenhorn

Joined: Apr 25, 2011
Posts: 12

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

Joined: Apr 25, 2011
Posts: 12

Anyone have an idea of some sort of test I can run to see if I am doing something wrong somewhere
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

Start using PreparedStatement instead of Statement. It will perform the escaping for you, and you will prevent SQL injection.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Bob Thorton
Greenhorn

Joined: Apr 25, 2011
Posts: 12

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

Joined: Oct 27, 2005
Posts: 19693
    
  20

Using Prepared Statements. Which is the first hit if you google on preparedstatement tutorial.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating/Inserting Multiple Tables