Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- class InsertTable
- {
- public static void main(String args[])throws Exception
- {
- class.forName("com.mysql.jdbc.Driver");
- Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/VCE","root","eswecha");
- Statement st=con.create Statement();
- int Result=st.execute Update("insert into student("vaagdevi,101"));
- if(result>0)
- System.out.println("values are inserted");
- else
- System.out.println("values are not inserted");
- con.close();
- st.close();
- }
- }
Add Comment
Please, Sign In to add comment