DB9 male or female Connector in Board
The original plan when the D-sub connector family was introduced was that equipment would always have female connectors and cables would always have male connectors. The idea was that pins are easily damaged, and it's usually easier to replace a cable than to replace a connector on a piece of equipment. Designations such as "DCE" (data communications equipment) and "DTE" (data terminal equipment) would indicate whether signals such as TXD and RXD were inputs or outputs on the equipment.

However, when the IBM PC came along, they decided to use D-sub connectors for a number of different purposes, so in order to reduce confusion for users, they used a female connector for the printer port and a male connector for the COM (UART) port.

As a result, it has become common to use a male connector on DTE and a female connector on DCE. If you want to connect your device to a PC, you should put a female connector on it so that you can use a straight-through male-to-female cable to plug it in.

And just to be pedantic, the correct designation is "DE-9". "DB" refers to the larger shell used for the 25-pin connector.