I am recently encountering an issue with using Java ResultSets in Coldfusion. I
have a Java class with a method GetAllDepartments() which connects to an oracle
database, runs a query and returns a ResultSet. when i call this function in CF
it throws an error
'The system has attempted to use an undefined value, which usually indicates a
programming error, either in your code or some system code.
Null Pointers are another name for undefined values.'
i am providing the code sample below.
java method(i hid the DB operations to keep it short and simple), it returns a
resultset.
public ResultSet GetAllDepartments()
{ //create oracle connection object
OracleConnection con = new OracleConnection();
Connection conobj = con.getOracleConnection();
//call Department DAO to get a ResultSet
DEPARTMENTSDao departmentobj = new DEPARTMENTSDao();
ResultSet rDepartments = null;
try {
rDepartments = departmentobj.loadAll(conobj);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return rDepartments;
}
coldfusion code which throws the error. the error occurs while calling the
method GetAllDepartments();
<cfscript>
obj = CreateObject("java","DepartmentsObject");
rDepartments = obj.GetAllDepartments();
qDepartments =
CreateObject("java","coldfusion.sql.QueryTable").init(rDepartments);
</cfscript>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325323
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4