Could someone explain to me what exactly is a driver and what would be using it with mysql?
It's been a while since I started watching JBDC videos and the word "Drivers" is constantly being used, and with Google's response, it's not enough for me to understand how it links to mysql.
This is a sample code that is what I learned so far with mysql in java.
try {
//1. Conectarse a la base de datos.
Connection coneccion = DriverManager.getConnection("jdbc:mysql://localhost:8889/Java", "root", "root");
//2.Crear el statement.
Statement statement = coneccion.createStatement();
//3.Generar una consulta.
ResultSet resultado = statement.executeQuery("SELECT * FROM Productos");
//4.Leer el resulset.
while ( resultado.next() ) {
String idArt = resultado.getString(1);
String seccionArt = resultado.getString(2);
String nombreArt = resultado.getString(3);
System.out.println("ID: " + idArt + ". Seccion: " + seccionArt + ". Nombre: " + nombreArt );
}