<%@page import="java.sql.*"%>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
Statement st = con.createStatement();
int c = st.executeUpdate("update data set name='John',address='Delhi' where id=1");
out.println("Data is updated successfully");
st.close();
con.close();
}
catch(Exception e){
System.out.println(e);
}
%>
|