Solve problems when Java needs to pass CLOB fields in calling stored procedures

Source: Internet
Author: User

A mysterious problem arises when migrating the system to another server:

When deploying the system on the local development and other servers, using the same JDK, Oracle driver, TOMCAT, and yet another operation is to call the Oracle database stored procedure, need to pass a CLOB type of the parameter, in the local test no problem, When uploading to the server, it is impossible to execute the following code snippet, and no exception is thrown:

String wkt = "..."; Clob clobwkt = Conn.createclob () clobwkt.setstring (1, wkt); Cs.setclob (1, clobwkt);

After the final modification to the following way, the problem is resolved, but never found the code has been the cause of the problem, leave this problem here, waiting for someone to answer.

String wkt = "..."; Cs.setcharacterstream (1, New StringReader (wkt), wkt.length ());


Solve problems when Java needs to pass CLOB fields in calling stored procedures

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.