The Underwater Cannon Gallery.>
The notion of firing cannon underwater preceded the self-propelled torpedo. The logic behind this remarkable idea was to hit the rival iron-clad below the water-line, and hence below her armour belt, with destructive consequences to her water-tight integrity.
Left: Cutaway view of an underwater cannon installation.
The fatal snag with this scheme- or rather the most obvious one, as one can imagine all sorts of lethal disasters overwhelming the gun crews if they pulled the wrong lever at the wrong time- is that hydrodynamic drag is hugely greater than atmospheric friction, and the shell would not get far before it stopped and sank gently to the sea bed.
An impact fuse for the shell would also be an interesting challenge, as it would have to ignore being fired into a solid mass of water, but activate when it hit the enemy ship.
Bibliography: "Discoveries & Inventions of The Nineteenth Century" 11th Edition. Robert Routledge