This commit is contained in:
2026-03-05 15:26:55 +05:30
parent 3835bad178
commit 248e1fdd95
28 changed files with 300 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package in.test;
import java.sql.*;
public class updatedemo {
public static void main(String[] args) throws Exception{
Class.forName("com.mysql.cj.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jdbc_B2_38", "root", "12345");
PreparedStatement ps = con.prepareStatement("update student set Name='AAA' where Rollno=104");
int i = ps.executeUpdate();
if(i>0) {
System.out.println("success");
}
else {
System.out.println("fail");
}
con.close();
}
}