I recently worked with a code that connects to a database in mysql. Its functionality is to insert data to the previously created table and then with a button to give functionality to empty TxtField in Jframe to refill.
The error is shown to me only in the ResultSet with the option to create class and it is also worth mentioning that I have created the Statement previously.
I appreciate help. GREETINGS!
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
Connection conectar = null;
try{
Class.forName("com.mysql.jdbc.Driver");
conectar = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/name","root","");
}catch (ClassNotFoundException ex) {
Logger.getLogger(datos.class.getName()).log(Level.SEVERE, null, ex);
}catch (SQLException ex) {
Logger.getLogger(datos.class.getName()).log(Level.SEVERE, null, ex);
}
String idContribuyente=this.jTextField4.getText();
try{
Statement s=(Statement) conectar.createStatement();
ResultSet rs=s.executeQuery("query");