ozzyfanta
asked on
combine insert and update sql statement in JSP
I would like to insert data in a table a table called Reservations and Update the Books table to change the reserved row from "N" to "Y". It is a website that let the user reserve a book...if the book is reserved, the username is inserted in the reservations table and the status of the books will change to (REserved=='Y')...
it is seems like the way i combine the two is wrong...could you pls help with to discover the mistake...
Thanks folks
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("Jdbc:Odbc:dBase","","");
stmt=con.createStatement( );
stmt.executeUpdate("INSERT INTO Reservations(ISBN,ReservedDate)"
+ "VALUES('"+isbn_n+"','"+date_d+"')" AND "UPDATE Books SET Reserved='Y' WHERE BookTitle='"+Book_Title+"'");
out.println("You have reserved the book successfully");
}
it is seems like the way i combine the two is wrong...could you pls help with to discover the mistake...
Thanks folks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.