Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/12/2014, 13:56
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 9 meses
Puntos: 182
Respuesta: ! MYSQL Exception: Column count doesn't match value count at row 1

Buenas,

Creas la tabla PEDIDO:
Código SQL:
Ver original
  1. st.executeUpdate("create table PEDIDO(pedido_id int(10) NOT NULL AUTO_INCREMENT, usuario_id int(10), date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,preicio int(11) NOT NULL,PRIMARY KEY (pedido_id))");

Y justo después le haces un select?
Código SQL:
Ver original
  1. ResultSet rs = st.executeQuery("select * from PEDIDO");

Eso no tiene sentido porque nunca va a tener filas.
Tambíen intentas aceder luego a columnas que no existen:

Código SQL:
Ver original
  1. String sdate=rs.getString("");
  2. String spreis=rs.getString("Preis");

Ese error que posteas se produce al realizar un Insert, por lo que lo más posible es que se produzca en esta linea

Código SQL:
Ver original
  1. st.executeUpdate("insert into Person values ('"+telprecio+"')");

¿La tabla Person solo tiene un campo?


Un saludo
__________________
If to err is human, then programmers are the most human of us