Results 1 to 2 of 2

Thread: [SOLVED] Java PreparedStatement

  1. #1
    Join Date
    Oct 2008
    Location
    White House
    Beans
    361

    [SOLVED] Java PreparedStatement

    Hi folks,
    I'm getting an error about invalid SQL when doing an update using a java.sql.PreparedStatement.update(str):
    Code:
    UPDATE banners_table SET filename = ? , time_added = ? , time_start = ? WHERE id=1
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? , time_added = ? , time_start = ?
    ...
    Am I doing something wrong here or I can't update multiple fields using a prepared statement?

  2. #2
    Join Date
    Oct 2008
    Location
    White House
    Beans
    361

    Re: Java PreparedStatement

    My bad, I was misusing the prepStat.executeUpdate() method. It must be without arguments.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •