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


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 (

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 {
            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) {

    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

0 answers