How data is insert into Database (Mysql) by console application
Source Code import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; import java.sql.ResultSet; public class Database{ public static void main (String [] args) throws SQLException { // object to ge input from user Scanner ip = new Scanner (System.in); // read values from user System.out.println("Please enter the ID"); int Id=ip.nextInt(); System.out.println("Please enter the Name"); String name= ip.next(); // url (path and port) of database in the computer String url="jdbc:mysql://localhost:3306/hu"; // establish the connection with the database by giving user name "root"and passphrase (password) "1122" Connection con= DriverManager.getConnection(url,"root","1122"); // create a statement Statement st= con.createStatement(); // insert a query t...