Fill in the Server, User, and Password fields in the login form. The server field allows you to select from predefined options or enter a custom address.
// The View class retrieves these values:public String getUsuario() { return txtUsuario.getText().trim(); }public String getPassword() { return new String(txtPassword.getPassword()).trim(); }public String getServidor() { return (String) cmbServidores.getSelectedItem(); }
2
Fetch Available Databases
Click the Actualizar (Refresh) button to retrieve all available databases from the server. This calls Model.obtenerTodasLasBasesDatos().
// Controller.java - Line 115return modelo.obtenerTodasLasBasesDatos( loginView.getServidor(), loginView.getUsuario(), loginView.getPassword());
The application automatically filters out system databases (information_schema, mysql, performance_schema, sys) from the list.
3
Select a Database
Once the databases load successfully, choose your target database from the dropdown menu. The dropdown is populated with the fetched database names:
The validarCamposLogin() method in Controller.java checks:
User Validation
// Controller.java - Line 85if(loginView.getUsuario().isEmpty()) { loginView.mostrarError("El usuario es requerido"); return false;}
Ensures the username field is not empty.
Password Validation
// Controller.java - Line 90if(loginView.getPassword().isEmpty()) { loginView.mostrarError("La contraseña es requerida"); return false;}
Ensures the password field is not empty.
Database Selection Validation
// Controller.java - Line 95if(!soloCredenciales && loginView.getBaseDatosSeleccionada() == null) { loginView.mostrarError("Debe seleccionar una base de datos"); return false;}
When databases are successfully fetched, you’ll see a confirmation dialog:
// Controller.java - Line 132JOptionPane.showMessageDialog(loginView, "Bases de datos actualizadas correctamente", "Éxito", JOptionPane.INFORMATION_MESSAGE);
After a successful connection, the login window closes and the SQL Editor interface appears with: