Almost all optical drives are IDE or SATA or USB. Internal drive in 2009 is likely SATA. My q6600 based HPs from 2007 had SATA optical drives.
If the drive is IDE it has a wide flat ribbon signal cable and will use 4pin MOLEX for the power connection.
If the drive is SATA is will use the same SATA power connector that HDD's use.
NOTE: sata power connectors have a release tab. If you cannot get the power cable out of the optical drive then likely you have not found the release tab. It is either on the top or the bottom of the connector near the middle. Press down into/towards the connector. The tab is on the plug, not the optical drive. Look at this picture to see what a sata connector looks like and to see where the clip...