@Test
public void testPreparedStatementsAreReadOnlyModeAware() throws SQLException {

    final ReadOnlyModeAwareConnection cnx = new ReadOnlyModeAwareConnection(mockedConnection, readOnlyModeStatus);
    final String sql = "select * from whatever";
    assertIsReadOnlyModeAware(cnx.prepareStatement(sql));
    assertIsReadOnlyModeAware(cnx.prepareStatement(sql, 0));
    assertIsReadOnlyModeAware(cnx.prepareStatement(sql, 0, 0));
    assertIsReadOnlyModeAware(cnx.prepareStatement(sql, 0, 0, 0));
    assertIsReadOnlyModeAware(cnx.prepareStatement(sql, new int[0]));
    assertIsReadOnlyModeAware(cnx.prepareStatement(sql, new String[0]));
}