Add prepare variant taking a Statement

JAVA-143 #fixes