Tomcat doesn't give you access to a JtdsDataSource
directly. It only uses that datasource to populate its internal DBCP datasource. When you use JNDI to ask for a datasource, you get the DBCP datasource.
BTW: There is (usually) no reason why you would cast to any other interface than javax.sql.DataSource
. The solution therefor is to cast to that interface (javax.sql.DataSource
).