// Create three physical prepares statements.
java.sql.PreparedStatement ps1 = prepareStatement(sql1);
java.sql.PreparedStatement ps2 = prepareStatement(sql2);
java.sql.PreparedStatement ps3 = prepareStatement(sql3);
// Insert the two first physical statements, the get logical wrappers.
StatementKey stmtKey1 = insertStatementIntoCache(cache, ps1, sql1);
StatementKey stmtKey2 = insertStatementIntoCache(cache, ps2, sql2);
LogicalStatementEntity logic1 =
createLogicalStatementEntity(sql1, false, cache);
LogicalStatementEntity logic2 =
createLogicalStatementEntity(sql2, false, cache);
// Insert the last physical statement and get the logical wrapper.
StatementKey stmtKey3 = insertStatementIntoCache(cache, ps3, sql3);
LogicalStatementEntity logic3 =
createLogicalStatementEntity(sql3, false, cache);
assertSame(ps1, logic1.getPhysPs());
assertSame(ps2, logic2.getPhysPs());
assertSame(ps3, logic3.getPhysPs());