Hi guys,
I have run into a problem and went looking for answers on the google and bea websites. What I can gather Weblogic as from version 6 does not support, or has been able to eradicate the use of oracle extensions, such as oracle objects and so on. Now does anybody have a workaround to this.
Here is the problem:
Using Weblogic ver 7 and Oracle 8.1.7, I am trying to call a stored procedure, which accepts an oracl objcect. I am getting the connection from a a connection pool.
The following code does the call to the stored proc
public void updRow(GmGscliIo inputRec)
throws SQLException
{
// Prepare the appropriate stored procedure
CallableStatement call = conn.prepareCall("{call GM_GSCLI_MNT.UPD_ROW(?,?,?)}");
// Register all "OUT" and "IN/OUT" parameters
call.registerOutParameter(1, Types.STRUCT, "GRPLIFE.GM_GSCLI_IO");
call.registerOutParameter(2, Types.DECIMAL);
call.registerOutParameter(3, Types.VARCHAR);
// Set all "IN" and "IN/OUT" parameters to their passed values
///////////THIS IS WHERE THE ERROR OCCURS
call.setObject(1, inputRec != null ? new STRUCT(StructDescriptor.createDescriptor("GRPLIFE.GM_GSCLI_IO", conn), conn, inputRec.getValue()) : null);
// Execute the stored procedure
call.execute();
// Do standard Group Life Systems error checking - Test the error code:
// if it is nonzero then an error occurred and an exception must be thrown
BigDecimal returnCode = call.getBigDecimal(2);
if (returnCode != null && !returnCode.toString().equals("0"))
{
String returnDescr = call.getString(3);
throw new DatabaseException(returnCode, returnDescr);
}
// Populate all "OUT" and "IN/OUT" parameters with the values received
if (inputRec != null) inputRec.setValue(((java.sql.Struct) call.getObject(1)).getAttributes());
// Close resources for the call (ResultSets will still be open, though.)
call.close();
}
and this is the error
java.lang.ClassCastException: weblogic.jdbc.rmi.SerialConnection
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:87)
at za.co.discoverylife.memreg.db.proc.GmGscliMnt.updRow(GmGscliMnt.java:193)
at za.co.discoverylife.memreg.edit.EmployerUpdate.doPost(EmployerUpdate.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm
