Class Cast Exception when getting BCP from ConnectionJDBC3
Status: Beta
Brought to you by:
mwillett
There is a class cast exception when trying to retrieve an instance of the BCP class from DriverManager getconnection
Class.forName(jdbc_driver);
conn = (BCP)DriverManager.getConnection(jdbc_url, jdbc_login, jdbc_pw);
java.lang.ClassCastException: net.sourceforge.jtds.jdbc.ConnectionJDBC3
at service.BCPServiceImpl.bcpEvents(BCPServiceImpl.java:30)
at PosAdjPersist.main(AdjPersist.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Logged In: YES
user_id=1454750
Originator: NO
Hi Can you post your whole code and some info about what server you're connecting to.