Copying LOBs from Oracle to Oracle fails
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
When a table has data that includes a CLOB/BLOB column,
the copy operation fails (unknown column type). The
root problem is that the Oracle JDBC driver reports
CLOB/BLOB columns to have type 1111 (OTHER), when
it should report them as java.sql.Types.BLOB/CLOB
(2004/2005). There is already code to work-around
this problem, but it only addresses the scenario
where Oracle is the source database. If Oracle is
the destination database and the field type is
BLOB/CLOB the copy operation will fail.
Logged In: YES
user_id=1287991
Fixed in CVS. The algorthim is:
If destination column type is Types.OTHER (1111), try to get
the type name and map it to a valid java SQL type (such as
Types.BLOB or Types.CLOB). This only works when the
database column
type name as reported by the JDBC driver is a standard type
such as
BLOB, VARCHAR, CLOB, CHAR, etc... A mapping exception is thrown
otherwise.