no se q ostias me pasa si hago la clase java con un main me funciona perfecta xo si lo ejecuto desde un jsp me da error y el codigo de insercion es este
Código:
public void insertarHistorial (Historial his)
{
try{
com.mysql.jdbc.Driver driver = (com.mysql.jdbc.Driver)Class.forName ("com.mysql.jdbc.Driver").newInstance ();
java.sql.Connection connection = DriverManager.getConnection ("jdbc:mysql://localhost/Hospital", "user", "user");
java.sql.Statement stmt = connection.createStatement();
java.util.Date fech = new java.util.Date();
String codigo = Long.toString(fech.getTime());
codigo = codigo + Integer.toString((int)(Math.random() * 1000));
stmt.executeUpdate("insert into historial(codigo,cod_medico,cod_paciente,fecha,hora,concepto,descripcion) values('"+codigo+"','"+his.getMedico()+"','"+his.getPaciente()+"','"+his.getFecha()+"','"+his.getHora()+"','"+his.getConcepto()+"','"+his.getDescripcion()+"')");
stmt.close();
connection.close();
}catch(Exception e){
System.out.println("error al insertar en la BD de Historial al insertar historial"+e.getMessage());
}
}
y el error q me da ese ste
Column count doesn't match value count at row 1