Results 1 to 2 of 2
  1. #1
    hungleon88 is offline Member
    Join Date
    Aug 2008
    Posts
    41
    Rep Power
    0

    Default Need help PrepareStatement

    i already read somebook, search on google, and almost the code i get are:

    String str = " UPDATE Demo_table SET ? = ? WHERE Name like ? ";
    PrepareStatement preStm = cn.prepareStatement(str);

    preStm.setString (1,"Mark");
    preStm.setDouble(2,100);
    preStm.setString(3,"DBSJ");

    preStm.executeUpdate();

    When i exactly type that code and run, it's appear 1 record updated.
    But when i use query (Select * from Demo_table) in SQLServer 2005 , the record which name is "DBSJ" not updated.
    Same trouble with Delete.
    Only Insert work good.

    please help !!! :(

  2. #2
    hungleon88 is offline Member
    Join Date
    Aug 2008
    Posts
    41
    Rep Power
    0

    Default

    Ax, Sorry for double post , please del 1 post for me , thanks!!!

Similar Threads

  1. Need help PrepareStatement
    By hungleon88 in forum JDBC
    Replies: 6
    Last Post: 09-21-2008, 10:34 AM
  2. problems with prepareStatement
    By Freddie in forum JDBC
    Replies: 0
    Last Post: 05-31-2007, 06:37 PM

Posting Permissions

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