10 Replies Latest reply on Jan 18, 2007 8:29 PM by 807599

    PreparedStatement with today (now) problem?

      Please tell me what's wrong with the code. I have a sql statement below that part of a java function, which is getting a list where "sendby_date" is today. It works fine before the PreparedStatement (the first system.out.prinln prints the correct info. By the way, just running the sql in interbase, it works fine too). However, it stuck in line PreparedSatement ( print2 doesn't get printed).

      Thanks in advance.
      sql.append("SELECT order_id ");
      sql.append("FROM order a ");
      sql.append("where a.sendby_date >=('now'-1) ");
      sql.append("AND a.sendby_date <= 'now' ");
      System.out.println("print1: "+sql.toString());
      PreparedStatement st = conn.prepareStatement(sql.toString());
      System.out.println("print2 ");