1 package jdbcapplication; 2 3 import java.sql.*; 4 public class insert1 5 { 6 Connection conn; 7 Statement st; 8 String qr; 9 String driver,url; 10 public insert1() 11 { 12 driver="com.mysql.jdbc.Driver"; 13 url="jdbc:mysql://localhost/bhupesh"; 14 qr="insert into emp(eid,ename,esal,ejob) values(101,'mohan',5000,'sprt')"; 15 System.out.println(qr); 16 try 17 { 18 conn=DriverManager.getConnection (url,"root","ashok"); 19 st=conn.createStatement(); 20 st.execute(qr); 21 System.out.println("INSERTION DONE..!!"); 22 conn.close(); 23 } 24 catch(Exception e) 25 { 26 System.out.println("Error : "+e.getMessage()); 27 } 28 29 } 30 public static void main(String args[]) 31 { 32 insert1 obj=new insert1(); 33 } 34 } |
Computer Science :: 11th/12th, Computer Engineering :: Degree/Diploma, Coding Concept ( C, C++ & JAVA Programming, JDBC Concept, DBMS - SQL Concept, Data Structure, Communication & Network Concept.
INSERT STATEMENTS
Subscribe to:
Posts (Atom)
-
1) Workbook - A workbook is like a book and consists worksheets. 2) Worksheet - A worksheet is working area consists rows and columns. By...
-
Programmingway: SSC ICT PAPER PATTERN : INFORMATION COMMUNICATION TECHNOLOGY (41) (E) (NEW COURSE) NOTE: - (i) All questions are compu...
-
Choose Eklavya, for Computer Education वाह रे जिंदगी, एक साल में बहुत कुछ दिखाया है तूने..!!
No comments:
Post a Comment