| 1 package jdbcapplication; 2 import java.sql.*; 3 public class Updateinfo 4 { 5 Connection cnt; 6 PreparedStatement pstm; 7 String driver,url; 8 String qry="update emp set ename='Sumit', esal=21000,ejob='Manager' where eid=103"; 9 Updateinfo() 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.executeUpdate(); 18 System.out.println("Updation Sucessfull Done"); 19 cnt.close(); 20 } 21 catch (SQLException ex) { 22 System.out.println("Error : "+ex.getMessage()); 23 } 24 } 25 public static void main(String args[]) 26 { Updateinfo demo=new Updateinfo(); 27 } 28 } |
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 UPDATE STATEMENTS
Subscribe to:
Comments (Atom)
Computer Solutions || Class 7 ||
1) Write full forms of the following:- a) OL - Order List b) LSD - Least Significant Digit c) JPEG - Joint Photographic Expert Group d) DB...
-
COMPUTER TERMINOLOGY 1) TCP/IP - Transmission Control Protocol/ Internet Protocol. 2) HTTP...
-
Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...
-
https://makecode.com/_3VxaMo6c3YPp Code 1) What is Make Code Arcade? Answer: Make Code Arcade is a Block based coding. 2) Writ...
-
Check whether the number is negative or positive after taking a number as input from the user. TextWindow . WriteLine ( "Ente...
-
1) ___ is the response of the receiver after perceiving the message. a) Encoding b) Decoding c) Channel d) Feedback 2) Which of the fo...
No comments:
Post a Comment