JDBC: Working with XML type in Oracle

Today, I had a task to change a column’s data type in oracle from varchar2 to xmltype and reflect the same in JDBC code. The version of oracle was 9.2.0. I considered this task to be an easy one as Java 6 added the support for XML data type which is SQLXML type. I changed the data type in JDBC code accordingly.

To my surprize it did not work.

After googling for few minutes I came to know that java-6 uses JDBC-4 and which is not supported by the version of oracle I was using. So I had to resort to the solution used for this prior to Java-6. I found the following link very helpful for the using xml type data with the help of JDBC:

http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb09jav.htm#1656

Enjoy learning,

Kamlesh

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s