Article View: borland.public.jbuilder.java.api
Article #123Re: How to use Java I/O to upload data to DB's blob field ?
From: Shankar Unni
Date: Wed, 21 Apr 2004 18:48
Date: Wed, 21 Apr 2004 18:48
20 lines
2012 bytes
2012 bytes
Chris wrote: > I want to use java 's I/O to upload some Strings to DB's blob > field and again download the blob to a XML file. It's not so much "Java's I/O" as what JDBC calls you make. Unfortunately, the answer depends on what database you're using. For Oracle, the code sequence is completely different from that for, say, MySQL. For general JDBC API information and examples, start with Sun's site at http://developer.java.sun.com and look around for JDBC examples there. I'll just jump ahead and say that for reading and writing CLOBs (not BLOBs - if you have all printable characters, e.g. XML data, you want to use CLOBs; BLOBs are for binary data) in MySQL, you simply use PreparedStatement.setAsciiStream() and PreparedStatement.getClob(). For Oracle, the code sequences are much more complex and totally non-standard. Go to http://techweb.oracle.com, visit the Documentation links, and look for the Oracle JDBC manual.
Technical Details
Message-ID:
<4086c1f1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<408672db@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,57b42066aaffe7f8 X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2004-04-21 12:10:29 PST Date: Wed, 21 Apr 2004 11:48:18 -0700 From: Shankar Unni <shankarunni@netscape.net> User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: How to use Java I/O to upload data to DB's blob field ? References: <408672db@newsgroups.borland.com> In-Reply-To: <408672db@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 64.165.207.59 Message-ID: <4086c1f1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082573297 64.165.207.59 (21 Apr 2004 11:48:17 -0700) Lines: 20 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail