I"m trying to do a simple table update but I cant get the syntax right. The book I have JSP in 24 hours isnt that good. only has a bad example...
 
 
Anyway All i want to do i update a field of a record which has a number equeal to a variable
 
Can someone update the following code and send it to me? I know that the syntax of the SQK is wrong.. The table is called Rooms and the Field status...but i ony want to update the staus of the record of a partiular number (roomnum)
 
I would appreciate a response...
 
 
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );Connection con = DriverManager.getConnection("jdbc:odbc:Bluerooms");
Statement stmt= con.createStatement();

String sql = "INSERT INTO Rooms Status VALUES 'Closed' WHERE Room_number="+roomnum ;              // this is the dodgy stament
 

      stmt.executeQuery(sql);
            con.close( );

Reply via email to