title: ResultSet not positioned properly, perhaps you need to call next
body: <p>Hi I have problem with this code as it seems to always return the SQL Exception. It was working for a few goes then stopped and came back with exception. so I'm not sure what's wrong.
  I have tried to change the vld.close() to different places before so yeah. Thanks</p>
  
  <pre><code>PreparedStatement vld = conn.prepareStatement("SELECT * FROM carsharing.available(?,?,?,?)");
          vld.setString(1, carName);
          vld.setString(2, memberUser);
          vld.setTimestamp(3, new java.sql.Timestamp(startTime.getTime()));
          vld.setTimestamp(4, new java.sql.Timestamp(endTime.getTime()));
          System.out.println("test1");
          ResultSet rset = vld.executeQuery();
          System.out.println("test2");
          rset.next();
          int num = rset.getInt("num");
          boolean valid = rset.getBoolean("aval");
          vld.close();
          System.out.println(num);
          System.out.println(valid);
  </code></pre>