The Oracle JDBC Thin driver is not spec complaint!

They expect you to use the OCI driver, which is a PITA because of the Oracle Client 
installation you must do, and horrible TNS configuration headaches. I've had some 
problems with hot redeployment when using the OCI driver.... For me the OCI driver is 
not an option.

Since their driver is broken, you can't use JBoss' CMP to map a CLOB or a BLOB in an 
Entity Bean to an Oracle database.

Reading from a CLOB using CMP works, I haven't tried reading from a BLOB. You need to 
explicitly declare the jdbc-type as CLOB in the jboss.xml deployment descriptor for 
the CLOB column, and declare the returning type as java.lang.String.

Inserting and updating a CLOB does NOT work with CMP, again I haven't tried with a 
BLOB.

What I suggest you to do is to code the insertion/update against the Oracle CLOB/BLOB 
interfaces directly. It works ok even using the Thin driver.

The only problem is that you need to import oracle.* packages into your project.

Hint: Do not use the select for update or empty_blob(), use the new CLOB/BLOB Java API.

Here are some examples of how you could do it:
http://forums.oracle.com/forums/thread.jsp?forum=99&thread=211460&message=584735

A complex sample from OTN:
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/9i_jdbc/NewLOBAPISample/NewLOBAPISample.java.html

As you can see, the second is an awful, smelly code, example. Use the first one as a 
basis instead.

If you don't want to import oracle.* packages into your project, you could use 
reflection to call Oracle propietary methods.

I have coded a workaround for JBoss CMP to work with CLOBs/BLOBs using an Oracle Thin 
driver (using reflextion). I will commit it after I figure out how to invoke the 
tempClob.freeTemporary() method AFTER executing the PreparedStatement inside the JBoss 
CMP engine! Alexey?

Ricardo Arguello

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3833797#3833797

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3833797


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to