I wrote a Java object which feeds a DB and is called from ColdFusion. I uploaded my Java object and tested it on the server that it will run on (java - classpath ... Recievable). I created an ODBC source in Win 2008 for the DB at the system level. I ran the object and got my test data into the DB, no problem. So I call my ColdFusion programmer and tell him that it's good to go and write a little CF to show him how to instantiate the object.
He runs it and gets [Microsoft][ODBC Driver Manager] Invalid string or buffer length. You can try it yourself here: https://www.cpawins.com/_cpapubs/test1.cfm. I have the full stack trace being returned as a string in my catch clause so that it can be dumped by CF. The CF server sits on the same server that I tested my java code on and is calling the same DB (and again, I've set a Windows system level ODBC source). Why does it work when I run it through java at the command prompt but does not when I run it through CF?
The Connection is:
According to the StackTraceElements that you see on screen when you follow the link, the code is failing at line 55 which is the Connection invocation.
Thanks Jan. And, I probably am just missing something somewhere. But, the confusion I have is this:
I ran this exact same code on the server using java -classpath and each time I do, I pass those values into the DB and get a successful return. When CF invokes the code, I get an error. How can this be? At first, I though that perhaps the CF code was sending in variables incorrectly which is why I output the variables I received in the <cfdump>. They are correct.
How can I have a query problem when everything is the same? It's not making sense to me.
java -classpath ...Recievable.getMoney(int,int,int) works fine
<cfobject component="...Recievable.getMoney(sameInt,sameInt,sameInt)> does not work fine
I was just wondering if you have a user dztzsource with the same name as the system source.
In that case, maybe the code you run from the command prompt would use the user datasource, and the coldfusion code could pick up the system datasource ?