4 Replies Latest reply on Dec 5, 2001 10:33 AM by Bill Bruyn

    java.sql.SQLException: ORA-01008: not all variables bound

    Bill Bruyn Newbie

      Is it illegal to use prepared statements in custom finders coded in a bean? I can't imagine why the following should throw this SQLException. Unless I don't know what I'm doing. Which is entirely possible, I suppose. Can anyone enlighten me?

      Connection con = datasource.getConnection();
      String sql = "SELECT user_id FROM principal WHERE last_name = ?";
      PreparedStatement stmt = con.prepareStatement(sql);
      stmt.setString(1, "Grossman");
      ResultSet rs = stmt.executeQuery();