Access to problems with the Oracle database long Type field!

Source: Internet
Author: User
The problem with a long field I have encountered, if you want to take the value of a long field, you must see the processing.
To add a new method:
/**
* Insert the method´s description here.
* Creation Date: (2002-6-4-17:37:55)
*/
public static String getlargerstring (Java.io.Reader Reader) throws Exception {

char[] content = new char[1024000];
char[] buffer = new char[1024];
int len = 0;
int off = 0;
int contentlen = 1024000;

while (true)
{
Len = reader.read (buffer);
if (len = = 1)
Break
if (off + len > Contentlen)
{
char[] tmp = new Char[contentlen + 1024000];
System.arraycopy (content, 0, tmp, 0, off);
content = tmp;
Contentlen = Contentlen + 1024000;
}
System.arraycopy (buffer, 0, content, off, Len);
Off = off + len;
}

return new String (content, 0, off);

}
You need to include these statements in your program:
if (Rs.next ()) {
Java.io.Reader Reader = (java.io.Reader) rs.getcharacterstream ("N_total_point");
String strtmp = (string) getlargerstring (reader);
}

This is the way to take a long field, and if you want to insert a long field in the database, you need to work with
Related Article

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.