Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages
Started by Chris
Wed, 21 Apr 2004 13:12
How to use Java I/O to upload data to DB's blob field ?
Author: Chris
Date: Wed, 21 Apr 2004 13:12
Date: Wed, 21 Apr 2004 13:12
14 lines
1282 bytes
1282 bytes
Howdy, 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. But my java I/O skill are not sufficient to implements this quickly, Could someone please point out a way for me? Which IO classes shall I use? TIA Best Regards. Chris.
Re: How to use Java I/O to upload data to DB's blob field ?
Author: 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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads