| 1 package jdbcapplication; 2 import java.sql.*; 3 public class Deleteinfo 4 { 5 Connection cnt; 6 PreparedStatement pstm; 7 String driver,url; 8 String qry="delete from emp where eid=101"; 9 Deleteinfo() 10 { 11 driver="com.mysql.jdbc.Driver"; 12 url="jdbc:mysql://localhost/bhupesh"; 13 try 14 { 15 cnt=DriverManager.getConnection (url,"root","ashok"); 16 pstm=cnt.prepareStatement(qry); 17 pstm.execute(); 18 System.out.println("Deletion Done"); 19 pstm.close(); 20 cnt.close(); 21 } 22 catch (SQLException ex) { 23 System.out.println("Error : "+ex.getMessage()); 24 } 25 } 26 public static void main(String args[]) 27 { 28 Deleteinfo demo=new Deleteinfo(); 29 } 30 } |
Computer Science :: 11th/12th, Computer Engineering :: Degree/Diploma, Coding Concept ( C, C++ & JAVA Programming, JDBC Concept, DBMS - SQL Concept, Data Structure, Communication & Network Concept.
PREPARED DELETE STATEMENTS
Subscribe to:
Posts (Atom)
Programmingway@Eklavya Technosys!: Class - 7 A or B | Computer | 100 Questions!
Programmingway@Eklavya Technosys!: Class - 7 A or B | Computer | 100 Questions! : 1) What is digital citizenship? 2) What is a digital citi...
-
COMPUTER TERMINOLOGY 1) TCP/IP - Transmission Control Protocol/ Internet Protocol. 2) HTTP...
-
https://makecode.com/_3VxaMo6c3YPp Code 1) What is Make Code Arcade? Answer: Make Code Arcade is a Block based coding. 2) Writ...
-
1) Choose correct one :- 1) The step by step plan of solution for solving a problem is called ____. a) Algorithm b) Internet c) URL d) M...
-
1) ___ is the response of the receiver after perceiving the message. a) Encoding b) Decoding c) Channel d) Feedback 2) Which of the fo...
-
Check whether the number is negative or positive after taking a number as input from the user. TextWindow . WriteLine ( "Ente...
No comments:
Post a Comment