On 12/5/2013 2:30 AM, ravi1984 wrote:
> I'm using DB2 9.x and I have a column named DTL_XML of type XML. Following
> are the snippets of data-config.xml & schema.xml within my SOLR instance.
> 
> data-config.xml:
>     <dataSource driver="com.ibm.db2.jcc.DB2Driver"
> url="jdbc:db2://myIP:myPort/DBName" user="testUsr" password="testPwd" />
>     <document>
>     <entity name="cust_data" query="select DTL_XML from testSch.SUMMRY_DTL
> FETCH FIRST 50 ROWS ONLY">
>         <field column="DTL_XML" name="cust_data" />
>         </entity>
>     </document>
> 
> Snippets from schema.xml:
> <field name="cust_data" type="text" indexed="true" stored="true"/>
> <uniqueKey>cust_data</uniqueKey>
> <copyField source="cust_data" dest="text"/>
> 
> When I query the SOLR, my requirement is to retrieve the cust_data as XML
> string, but instead I was getting the data as following:
> "cust_data": "com.ibm.db2.jcc.c.fc@628f628f"

That value tells me that IBM's JDBC driver does not have a proper
toString() method for the XML object, so you get the typical Java object
identifier.  Research indicates that in order to use the XML column type
in a JDBC application, special code is required.

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z10.doc.java%2Fsrc%2Ftpc%2Fimjcc_c0021817.htm
http://stackoverflow.com/questions/4451156/how-to-read-xml-column-from-db2-using-jdbc

If I were you I'd call IBM.  Since you are using their database,
hopefully you also have a support contract.  Perhaps they can give you a
JDBC option for your dataimport config that changes the XML object to
one with a proper toString() method.  If not, you'll need to write your
own indexing application or modify the dataimport handler source code to
handle the XML object and recompile it.

Thanks,
Shawn

Reply via email to