Here is the code for jdbc(java database connectivity) :-
Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql:///test","root","icui4scu");
String sql="insert into details values('"+jTextField1.getText()+"','"+jTextField2.getText()+"','"+jTextField3.getText()+"','"+jTextField4.getText()+"','"+jTextField5.getText()+"');";
ps=con.prepareStatement(sql);
int i=ps.executeUpdate();
if(i!=0)
JOptionPane.showMessageDialog(null, "Data Added into Table");
} catch (Exception e) {
JOptionPane.showMessageDialog(null,e);
}
On this page of the site you can watch the video online How to insert data into sql using java NetBeans with a duration of hours minute second in good quality, which was uploaded by the user Lavish Aggarwal 23 November 2020, share the link with friends and acquaintances, this video has already been watched 116 times on youtube and it was liked by like viewers. Enjoy your viewing!