Oracle/hibernate query Clob field value anyway null____oracle

Source: Internet
Author: User

The background: My new entry company less than two months, our project using the Tomcat Profile link Project WebApp, while the Tomcat management data source (that is, in the Tomcat directory Conf\catalina\localhost configuration project path and data source), eg


<?xml version= ' 1.0 ' encoding= ' utf-8 '?> <context the docbase= ' E:\Workspaces\MyEclipse 9\sinopeccoalv1\
WebApp "reloadable=" false "Path=" \domain "privileged=" true "antiresourcelocking=" false "antijarlocking=" false ">
<resource name= "Standardworkdatasource" driverclassname= oracle.jdbc.driver.OracleDriver "
    url=" jdbc : ORACLE:THIN:@192.168.1.109:1521:ORCL "
    username=" xxxx "    password=" xxxx "
    type=" Javax.sql.DataSource "
    maxactive= "maxidle="
    maxwait= "5000"/>
</Context>

When I first came to my colleagues to configure this, the original ignorant, slowly know this with the effect of directly put to WebApp is the same.

So developed for one months, has nothing unusual, today suddenly found the same project version of a page, put on my machine to run the error, copy to the same machine running, completely no problem.

The cause of the error is: On my machine hibernate cannot find the property value of the Type CLOB field (no exception thrown, Debug View object's property value is always null), copy to colleagues on the machine after deployment can be found out.

Therefore, the main problem is logically become: why the same project on a different machine deployment, some machines on the project can query out the Clob field, and some will not find out.

After my day's investigation, the reason finally found: because my data source is Tomcat management, and I do not have the Oracle Jar package (Oracle14.jar) in the Tomcat directory in the Lib, This results in some Oracle-specific field types that cannot find data values, but never throws any exceptions (this is a bit tangled).

Solution: Place the Oracle14.jar in the Lib directory under the Tomcat directory. Because I didn't find anything on the internet, it was a day's work that I had to share. )


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.