Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[jira] Created: (DERBY-302) Takes over 3 minutes to insert a 500kb String i: msg#00829

apache.db.derby.devel

Subject: [jira] Created: (DERBY-302) Takes over 3 minutes to insert a 500kb String into CLOB

Takes over 3 minutes to insert a 500kb String into CLOB
-------------------------------------------------------

Key: DERBY-302
URL: http://issues.apache.org/jira/browse/DERBY-302
Project: Derby
Type: Bug
Components: SQL
Environment: Windows XP Professional, Dell Pentium IV
Reporter: Glenn Orbon


I downloaded a Cloudescape Version 10 from here
http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html.
Not sure exactly which version of 10 this is.

Would like to store up to a 10MB XML string in a CLOB. However, I noticed it
took over 3 minutes to insert a 500kb string. I am using the PreparedStatement
to get around the 37kb limitation encountered in a previous issue. It takes
less than 2 seconds to insert a 500kb string into a CLOB in mySQl.

Here the snippet:

FileReader fr = new FileReader ("sample.txt");
BufferedReader br = new BufferedReader(fr);
String record = null;
try {

while ( (record=br.readLine()) != null ) {

bufferStr.append( record );

}

} catch (IOException e) {
//
// put your error-handling code here
//
System.out.println("Error reading file");
}


System.out.println("Size of inputStr: "+bufferStr.length() );

PreparedStatement ps = mm.connection.prepareStatement("INSERT into
documents VALUES (?,?)" );
ps.setInt(1, 13 );
StringReader reader1 = new StringReader(bufferStr.toString());
ps.setCharacterStream(2, reader1, bufferStr.length());
System.out.println("Uploading string....");
ps.execute();
System.out.println("Done uploading string...");
mm.connection.commit();


Thanks for your the help,

Glenn O.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
ide.eclipse.wtp...    bug-tracking.ro...    xfree86.cvs/200...    lisp.wxcl.devel...    file-systems.ar...    kde.devel.kwrit...    jakarta.jetspee...    qnx.openqnx.dev...    drivers.openib/...    ports.xbox.deve...    gis.gdal.devel/...    netbsd.ports.ma...    ubuntu.marketin...    systemtap/2005-...    web.omniweb/200...    mail.qmail.ldap...    hardware.soekri...    os.netbsd.devel...    audio.madman.ge...    tv.freeguide-tv...    cluster.openmos...    education.ezpro...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation