I was given intravenous antibiotics for my infection. Is this better than oral antibiotics?

Sometimes. There are some antibiotics that are only available in IV form. However, many antibiotics are available as an oral tablet that are also very strong and are well tolerated. The IV form is generally used in hospitalized patients or in patients who cannot tolerate oral feedings.
Antibiotics. The route of administration depends on the antibiotic. Some must be given intravenously, whereas others may be given orally. Some antibiotics may be given either way. Usually, however, IV antibiotics reach higher peak serum levels and may be more effective at this higher killing dose. So, in your case, the higher serum levels may have been more desirable to control your infection.