Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/08/2014, 13:40
Japrendo
 
Fecha de Ingreso: noviembre-2013
Mensajes: 147
Antigüedad: 10 años, 5 meses
Puntos: 1
Problema al convertir String a Date

Debo ejecutar un procedimiento almacenado en PL, y uno de los parametros que pide son las fechas de inicio y de fin del proceso.

entonces hago esto :
Código Java:
Ver original
  1. ...
  2. ...
  3. CallableStatement callableStatement2=  cn.prepareCall("{    lfv_pk_ind_c.prc_calcula_indicador(?,?,?,?,?) }");                  
  4.         //Parametros de entrada                
  5.  
  6.         SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
  7.     String FI = "01-08-2014";
  8.     String FF = "31-08-2014";
  9.  
  10.     try {
  11.         Date FIX = formatter.parse(FI);
  12.         Date FFX = formatter.parse(FF);
  13.     } catch (ParseException e) {
  14.         e.printStackTrace();
  15.     }
  16.         callableStatement2.setString("p_fvt_id","FI");  
  17.         callableStatement2.setInt("p_din_id",103);  
  18.         callableStatement2.setDate("p_fecha_ini", FIX);  
  19.         callableStatement2.setDate("p_fecha_fin", formatter.format(FFx));  
  20. ...
  21. ...

Bueno el problema es que la variable Date FIx y FFx no me funcionan, que esta mal?

Gracias por sus aportes.