Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

retrieve XML from database
I have inserted an xml to the mySQL database as a BLOB type using JDBC
and java, with the code,

Statement stat=con.createStatement();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamResult result = new StreamResult(baos);
DOMSource source = new DOMSource(doc);
trans.transform(source, result);

String query = "insert into policy(id,type,xml) values
(?,?,?)";
PreparedStatement pstmt = con.prepareStatement(query);
byte[] bytes = baos.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
pstmt.setInt(1,0);
pstmt.setString(2,"Description");
pstmt.setBinaryStream(3, bais, bytes.length);
pstmt.executeUpdate();

how can i retrieve the same from the database, so that i can display it
or output to a file..

please help..thanks in advance

sarath


Report this thread to moderator Post Follow-up to this message
Old Post
sarath
06-02-05 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:42 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.