i'm not sure is you can modify the code or not, thus a general method first.
The class JCo contains a set of methods that returns library wide informations, such a the version :
com.sap.conn.jco.JCo.getVersion()
you can use if eiter to add a debug info in the application, or to create a small program that link to the used JCo.jar, and display the information.
Otherwise if you simply need to check the marjor version (2 ou 3), JCO version 3 is called "sapjco3.jar" while version 2 is simply "sapjco.jar"