1 Reply Latest reply on Apr 18, 2013 7:09 AM by PhHein

    How to retrieve date from oracle database with java in dd.MM.yyyy format.


      I been able to get date from oracle database in the format like 2013-04-18 with the following code

      String formatIn = "dd.MM.yyyy";
      SimpleDateFormat sdfi = new SimpleDateFormat(formatIn);
      java.util.Date utilDate = sdfi.parse(date.getText());
      java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());

      final String dt[] = new String[1000];
      stm = db.con.createStatement();
      rs = stm.executeQuery("select v_date from voucher_main order by v_id desc");
      int a = 0;
      while(rs.next()) {
      dt[a] = rs.getDate("v_date").toString();
      a++; }
      }catch(SQLException sqlException){         

      Now how can I get date in the format like 18.04.2013

      Pls help.