java.sql.SQLException: Column count does not match value count

0

I have a problem with my program for an assignment in the university, It is a hotel system that makes reservations, but it throws me an error,

  

java.sql.SQLException: Column count does not match value count at row 1 at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:965)

and I do not know where I have the problem. If someone can help me, I'd appreciate it.

package reservadehotel;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;


public class conexion {

 private static Connection cnx = null;
   public static Connection obtener()  {
      if (cnx == null) {
         try {
            Class.forName("com.mysql.jdbc.Driver");
            cnx = DriverManager.getConnection("jdbc:mysql://localhost:3306/granhotelvyd", "root", "");
         } catch (SQLException ex) {

         } catch (ClassNotFoundException ex) {
            throw new ClassCastException(ex.getMessage());
         }
      }
      return cnx;
   }
   public static void cerrar() throws SQLException {
      if (cnx != null) {
         cnx.close();
      }
   }

    public Connection getConnection() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
    
asked by Valeria Silva 10.11.2018 в 00:39
source

0 answers