This commit is contained in:
2026-02-26 15:23:48 +05:30
parent 50f79f67b1
commit 3835bad178
7 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package in.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class deletedemo {
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");
Statement ps = con.createStatement();
int i = ps.executeUpdate("delete from student where Rollno=103");
if(i>0) {
System.out.println("success");
}
else {
System.out.println("fail");
}
con.close();
}
}