This content has been marked as final.
Show 2 replies
-
1. Re: prepareStatement to OraclePrepareStatement, classcastexc
manica Oct 29, 2004 12:24 AM (in response to bayuehua)Why do you need to do this? If you are trying to use the getCursor() method, it would be better to use the getObject() method on the standard prepared statement and cast the result to a ResultSet. But, if you must get access to the OraclePreparedStatement, try this:
WrappedConnection wcon = (WrappedConnection)con;
OracleConnection careful = (OracleConnection)wcon.getUnderlyingConnection();
OraclePreparedStatment pstmt = (OraclePreparedStatment)careful.prepareStatement(...);
The idea is to get to the OracleConnection object. Once you get that, you can use the custom Oracle API. Be careful with that underlying connection, Adrian has multiple cautions posted in these forums about that.
Darin -
2. Re: prepareStatement to OraclePrepareStatement, classcastexc
manica Oct 29, 2004 12:24 AM (in response to bayuehua)Why do you need to do this? If you are trying to use the getCursor() method, it would be better to use the getObject() method on the standard prepared statement and cast the result to a ResultSet. But, if you must get access to the OraclePreparedStatement, try this:
WrappedConnection wcon = (WrappedConnection)con;
OracleConnection careful = (OracleConnection)wcon.getUnderlyingConnection();
OraclePreparedStatment pstmt = (OraclePreparedStatment)careful.prepareStatement(...);
The idea is to get to the OracleConnection object. Once you get that, you can use the custom Oracle API. Be careful with that underlying connection, Adrian has multiple cautions posted in these forums about that.
Darin