Thread: Update Problems

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    0
    Rep Power
    0

    Update Problems


    Hi - I am trying to update a field in my table where a certain condition is met eg I want to update my address field where name = the name given in a html form. When i try run the jsp page it never finishes so I am not gettin any errors but it doesnt stop. Does anyone have any idea what is wrong with my code:


    String NAME;
    String ADDRESS;

    NAME=request.getParameter("NAME");
    ADDRESS=request.getParameter("ADDRESS");


    String sql="UPDATE Table SET ADDRESS='" + ADDRESS + "' WHERE NAME='" + NAME + "'";

    Class.forName("interbase.interclient.Driver");
    Connection con=DriverManager.getConnection("jdbc:interbase://localhost/c:/Table1.gdb","SYSDBA","masterkey");

    Statement stmt = con.createStatement();
    stmt.executeUpdate(sql);

    response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
    String newLocn = "choose.html";
    response.setHeader("Location",newLocn);


    Thank you in advance, loneill!
  2. #2
  3. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    This is a complete guess, but I can't see where else this would just stop. But I think you are defining your connection wrong.

    I don't think the // is gonna be picked up at all, cos I think that bit is treated like a domain, or ip. So maybe use the ip loop back of "127.0.0.1" or setting a server name in your hosts file to point at that ip, then use that (call it localhost - as you have - which means it's likely this is set already). You'll probably also want to set up the odbc settings to add an interbase db so that you can asccess it (unless this is a direct access driver rather than an odbc one - which I can't really tell from this). Also you might find that the driver listens on a specific port (I think oracle is 1526 by default, but it'll probably be different for interbase), so maybe something along the following lines would work

    Connection con=DriverManager.getConnection("jdbc:interbase:@localhost:1526:Table","SYSDBA","masterkey");

    Hope this helped

    Oscagne
  4. #3
  5. No Profile Picture
    Java Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    5
    Rep Power
    0
    ok, I've just looked at some interbase documentation and it appears it's nothing like the oracle driver.

    In which case there are only a 3 things I can think it might be
    1) you haven't got "InterServer" running
    2) localhost isn't defined in your host file to loop back to your local ip, or the loopback ip
    3) (a silly one), use upper case "C:" instead of lowercase

    Oscagne
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    0
    Rep Power
    0
    Thanks for your help. I have managed to sort the problem now , I don't know why this is but when I came back the next date it worked fine, weird!!

IMN logo majestic logo threadwatch logo seochat tools logo