private void setDateTime(Object aParam, PreparedStatement aStatement, int aIdx) throws SQLException {
DateTime dateTime = (DateTime)aParam;
String formattedDateTime = "";
if (
dateTime.unitsAllPresent(Unit.YEAR, Unit.MONTH, Unit.DAY) &&
dateTime.unitsAllAbsent(Unit.HOUR, Unit.MINUTE, Unit.SECOND)
){
fLogger.finest("Treating DateTime as a date (year-month-day).");
formattedDateTime = dateTime.format(DbConfig.getDateFormat(fSqlId.getDatabaseName()));
}
else if (