You write how to do it with oracle. can you help me to do it with an ms sql
server 7.0.

Thx

Dimitrij Kisselev
[EMAIL PROTECTED]
-----Ursprüngliche Nachricht-----
Von: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]Im Auftrag von TA Flores
Gesendet: Sonntag, 15. Oktober 2000 02:26
An: [EMAIL PROTECTED]
Betreff: Re: BLOB Uploads


Try the following, you will need to add but this will point you in the right
direction. (Oracle specific)...Good luck.

File file = null;
Blob bloc = null;


BufferedInputStream bstream = new BufferedInputStream(new
FileInputStream(file) );

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection ( );
PreparedStatement ps = con.prepareStatement("Insert into Table values ( ? )
");

ps.setBinaryStream(1, bstream,bstream.available( ) );
ps.execute( );
}catch (Exception e){
For your doGet()

try{
   Class.forName( yada yada ...)
   Connection . . .

   Statement s = con.createStatement( );
   response.setContentType("audio/x-mpegurl");
   rs = s.executeQuery ("Select * from Table");
   rs.next( );

   byte[ ]  b = new byte[1000*100]
   int length = -1;
   InputStream is = rs.getBinaryStream(1);
   BufferedOutputStream bout = new BufferedOutputStream
                        (response.getOutputStream  ) );
   while ( (length = is.read(b ) )!= -1)
      bout.write(b, 0, length);

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to