.ZIP files and the ZipFile object

Dove into java.util.zip this weekend and was most unhappy with the docs. Fortunately, searching these forums I was able to make some progress, but am still confused about the ZipFile class.
I was able to open a FileInputStream, hand it to a ZipInputStream and read a .ZIP file. I was not able to read the .ZIP opening it as a ZipFile (I got the ZipEntries and the header info, but couldn't unzip the data).
I was able to write a .ZIP with the reverse but was concerned that the ZipFile isn't even documented as supporting file writing. Is the ZipFile a useful thing in some way I haven't discovered, or should I just forget about it?

this is a simple test for copying a zip file
java ZipDemo c:\myZip.zip d:\testdir
import java.util.zip.*;
import java.io.*;
import java.util.*;
class ZipDemo
     public static void main(String [] arg) throws Exception
          ZipFile src = new ZipFile(arg[0]);
          File tgt = new File(arg[1]);     
          if(!tgt.isDirectory())
               System.out.println(tgt+" is not found, or not a directory");
          for(Enumeration e = src.entries(); e.hasMoreElements(); )
               ZipEntry ze = (ZipEntry) e.nextElement();
               File target = new File(tgt, ze.getName());
               try {
                    target.getParentFile().mkdirs();
               }catch(NullPointerException npe){} // ignore case where file has no parent
               if(!ze.isDirectory())
                    copy(src.getInputStream(ze), target);
     static byte [] buffer = new byte [16384];
     public static void copy(InputStream in, File target) throws IOException
          FileOutputStream out = new FileOutputStream(target);
          int bytesRead;
          while((bytesRead=in.read(buffer))>0)
               out.write(buffer,0,bytesRead);
          out.close();
          in.close();     
}

Similar Messages

  • Read Zip File and output it to the Stream

    Hi,
    I really need help with this topic. I need to write a function which as input read the zip file (inside: jpeg, mp3, xml)
    and as output provide the output Stream of this zip file.
    public OutputStream readZipToStream(String sourceZipFile) { ....}
    I've tried something....
    public static OutputStream    readZipToStream(String src, HttpServletResponse response) throws Exception {
            File fsrc = null;
            ZipOutputStream out = null;
            byte buffer [] = null;
            FileInputStream in = null;
            try {
                buffer = new byte[BUFFER_CREATE];
                fsrc = new File(src);
                out = new ZipOutputStream(response.getOutputStream());
                ZipEntry zipAdd = new ZipEntry(fsrc.getName());
                zipAdd.setTime(fsrc.lastModified());
                out.putNextEntry(zipAdd);
                // Read input & write to output
                in = new FileInputStream(fsrc);
                while (true) {
                    int nRead = in.read(buffer, 0, buffer.length);
                    if (nRead <= 0)
                        break;
                    out.write(buffer, 0, nRead);
                out.flush();
                in.close();
            } catch (IOException ioe) {
                logger.error("Zip Exception: " + ioe.getMessage());
                ioe.printStackTrace();
                throw ioe;
            return out;
        } But the problem with this code when it returns ( I called from servlet: bellow)
    it ask user to save the file as servlet.jsp file. So I would have to rename it to zip file later.
    What I want to achive is it would ask to save zip file from the stream as name of the original zip file (if that is possible)
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%
    OutputStream stream = null;
    response.setContentType("application/zip");
    target = mount_media + File.separator + "test_swf.zip";       
    try {
    stream = ZipUtil.readZipToStream(target, response);
    } catch (Exception ex) {
            System.out.println(ex.getMessage());
        } finally {
    if(stream != null) {
                stream.close();
    %>
    <%@page import="java.io.File" %>
    <%@page import="java.io.OutputStream" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    </body>
    </html>

    Hi oleg_s ,
    There's a contradiction of content in your JSP :
    response.setContentType("application/zip");
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">The html part of your JSP seems useless for what you mean to do. Therefore, instead of a JSP, you should use a simple servlet to send your zip file.

  • Converting html file into zip file and send email attaching zip file

    Hi Experts,
    I am trying to send email with attachment(html). Which contains more than 7MB. So, It is throwing an error like Size exceeded.
    So, Now i need to compress the data for less than 7MB.
    I decided to convert HTML File into ZIP File.
    Kindly suggest me to convert the HTML file into ZIP file and sending email with attached ZIP file.
    Correct answer rewarded,
    Thanks & Regards,
    N. HARISH KUMAR

    Hi Experts,
    *// HTML_TAB converting into ZIP File
       DATA  : zip_tool TYPE REF TO cl_abap_zip,
               filename TYPE string ,
               filename_zip TYPE string .
       DATA  : t_data_tab TYPE TABLE OF x255,
               bin_size TYPE i,
               buffer_x TYPE xstring,
               buffer_zip TYPE xstring.
    filename = text-007.                                                                          "'HTML_TAB
    *describe the attachment
       DESCRIBE TABLE html_tab LINES tab_lines.
       bin_size = tab_lines * 255.
       CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
         EXPORTING
           input_length = bin_size
         IMPORTING
           buffer       = buffer_x
         TABLES
           binary_tab   = html_tab.
       IF sy-subrc <> 0.
    *     message id sy-msgid type sy-msgty number sy-msgno
    *     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    *create zip tool
       CREATE OBJECT zip_tool.
    *add binary file
       CALL METHOD zip_tool->add
         EXPORTING
           name    = 'FSSAI_MAIL.HTML'
           content = buffer_x.
    *get binary ZIP file
       CALL METHOD zip_tool->save
         RECEIVING
           zip = buffer_zip.
       CLEAR: t_data_tab[],bin_size.
       CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
           buffer        = buffer_zip
         IMPORTING
           output_length = bin_size
         TABLES
           binary_tab    = html_tab.
    Thanks & Regards,
    N. HARISH KUMAR

  • Socket blocking on read operation while uploading zip file to the server

    I am trying to upload a zip file to the server
    Client thread creates the zip file ( of the modified files) and it even completes writing the data to the socket stream.
    Now if the server thread tries to read the same data from the stream, it blocks on read operation.
    While downloding the zip file from the server works fine.
    Thanks in advance

    You can use the URL object to upload it as multipart/form-data.
    http://forum.java.sun.com/thread.jspa?threadID=579720&messageID=3997264
    Or check out some of the file uploaders out there.
    http://www.google.nl/search?hl=nl&q=site%3Asun.com+upload+applet&btnG=Zoeken&meta=

  • Extension for creating a zip file and unzipping it

    Iam totally new to Dreamweaver and the extensions. So please
    help me with this.
    Assuming i have a .zip file and it contains some html pages
    along with css and gifs.
    The req is to have an Import option, which given this zip
    file, can unzip its contents. The user can work on these html
    pages. When the user finishes working on them, I need an export
    button so that we can package the entire stuff back into a zip
    file.
    How can i implement this ?
    Is there any extension that is available for this ?
    Eagerly looking forward to some useful answers...
    Thanks in advance,
    Ganesh

    There used to be one .. I'm not sure if that was in DMX time
    or DMX 2004
    time .. that, when installed, allowed you to select files
    from the site
    folder or the whole thing and create a zip from them. I don't
    remember what
    it was called or who created it .. but it might be on one of
    my archived
    disks or zips .. I'll try to check it out later today.
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: DMX 2004: The Complete Reference, DMX 2004:
    A Beginner''s
    Guide, Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "Ganesh Ram" <[email protected]> wrote in
    message
    news:engarc$d62$[email protected]..
    > Iam totally new to Dreamweaver and the extensions. So
    please help me with
    > this.
    >
    > Assuming i have a .zip file and it contains some html
    pages along with css
    > and
    > gifs.
    > The req is to have an Import option, which given this
    zip file, can unzip
    > its
    > contents. The user can work on these html pages. When
    the user finishes
    > working on them, I need an export button so that we can
    package the entire
    > stuff back into a zip file.
    >
    > How can i implement this ?
    > Is there any extension that is available for this ?
    >
    > Eagerly looking forward to some useful answers...
    >
    > Thanks in advance,
    > Ganesh
    >
    >

  • Name zip file and zipped file in File Receiver

    Dear experts,
    I have a "RFC to File"-scenario. So I have a File Receiver and the received XML needs to be zipped. I have a XSLT mapping that hands over a dynamic file name to the File Receiver. Now when I use the PayloadZipBean my resulting ZIP-file gets the dynamic name. But the zipped XML gets the name "untitled.xml". But I also want the zipped file to get the dynamic name!
    I had a look at Stefan Grube's blog /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    and also at the WIKI http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
    Do you know if there is any way I can avoid writing my own adapter module? I would like to stay with SAP standard modules!
    If not, will the module described in that WIKI also work with a File Receiver instead of a Mail Receiver? (I think it should)
    Thank you for any ideas and best regards,
    Peter

    Hello Amit, Hello Abhishek Salvi,
    Thank you again for your advice and the links to the NWDS. I downloaded it and everything went well until the deployment.
    I followed How-to-Guide: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?quicklink=index&overridelayout=true
    Then I got the error: The DOCTYPE declaration in the ejb-jar.xml deployment descriptor is missing.
    I looked at thread: The DOCTYPE declaration in the ejb-jar.xml deployment descriptor is missing
    I am using PI 7.0, JDK version 1.4.12.
    My local JDK Version 1.5.0_22, NWDS 7.1.
    Could the JDK version on the server be a problem? Or NWDS 7.1 and PI 7.0?
    I used all the libraries mentioned on this page under PI 7.0:
    http://wiki.sdn.sap.com/wiki/display/XI/Where%20to%20get%20the%20libraries%20for%20XI%20development
    When I create the Enterprise Bean I have to specify "Component and Local Interfaces", e.g. "com.sap.aii.af.lib.mp....."
    But in my PI system I cannot find JAR files with the name "aii.af.lib.mp..."
    Could that be the problem?
    Do I have to specify different "Component and Local Interfaces" when creating the Enterprise Bean?
    Thank you again for any help!
    Best regards,
    Peter
    Edited by: Peter Wallner on Apr 21, 2011 10:13 AM

  • How to set password for a zip file and should be checked when reading that

    Hi friends,
    how to set password for a zip file and should be checked when reading that file???
    thanks.
    Praveen Reddy.J

    Heyy man, i think, u did not get my problem.
    all i have to do is:
    i have to create a zip file, and we should secure it with password when creating. and whenever the user wants to open that zip file he should provide correct passowrd otherwise he could not read that file. So, we should check for that also.
    Tanks for reply.

  • Read encrpted zip file and ftp unzip file

    Hi,
    I have a situation,where i need to read 3 zip files, which are encrpted, and each zip file may have lot of images and text files. all i want to do is, read these 3 zip files and unzip + ftp to another directory. No mapping is involved. if the three files are not there, it should error out.
    I have some ideas, but thought if any of you have better ideas.
    Thanks
    Pandari

    Hi Pandari
    File adapter
    module to zip and unzip
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    <b>Check this weblog:</b>
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    Check this out !
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework%3Fpage%3Dlast%26x-order%3Ddate%26x-showcontent%3Doff
    also
    https://service.sap.com/sap/support/notes/965256
    Check this weblog on how to zip the file using XI:
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    PayloadZip Bean
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework%3Fpage%3Dlast%26x-order%3Ddate%26x-showcontent%3Doff
    Through command line
    Check case 2 in this blog
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    or ref plsz go tru it,
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    Check this weblog on this from stefan:
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    http://help.sap.com/saphelp_nw70/helpdata/en/84/2e3842cd38f83ae10000000a1550b0/frameset.htm
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Zip or Unzip your Payload with the new PayloadZipBean module of the XI Adapter
    /people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
    XI/PI: Command line sample functions -> go through case 2
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    Create encrypted ZIP files
    Thanks!!!

  • Compress/zip files from the command line in Windows 7?

    In Windows 7 is there a native way to compress or zip files from the command line?  I'd like to do it without installing any third-party utilities such as 7Zip.

    I fully agree that Compact is not the answer. There are additional concerns with the Compact command. It enables disk compression which is a total no-no. Very bad! It makes your computer very slow and is quite difficult to undo. The only time anyone should
    use this command is when they're removing disk compression because someone turned it on to save space.  Turning this off has to be done by booting into the recovery console, if my memory serves me correctly, and it's a real nuisance.  So
    definitely no to the Compact command.
    If you wanted to compress files before sending them to another drive, or over a network, or by email, then Compact wouldn't actually help at all because the files have to get uncompressed whenever they're accessed, especially before sending them anywhere. 
    When I say accessed, I mean that just looking at a file triggers the OS to decompress it in the background and present you with an uncompressed version of it then letting you change it and recompressing it again for storage every single time you access the
    file, which is why your machine gets slower.  If you have folders or files that have blue text instead of black, then you've probably already made this mistake.
    I would also like to know if there is a built-in command for zipping files/directories, or, if there isn't such a thing built into Windows, then I would like to know if this is feature is accessible through Visual Studio, which would be just as good as having
    a command-line program for those of us that do a bit of programming.
    If anyone knows if MS provides such a feature, either by command-line or through an API, then I'd love to hear about it.  Good luck to those of you that have disk compression turn on.

  • What is the max size of a zip file with the JDK1.5 ?

    Hello everybody,
    I'm a french student and for a project, I need to create a zip file, but I don't know in advance the number and the size of files to include in my zip.
    I wish to know if someone have the answer to my question : what is the max size of a zip file with the JDK1.5 ? I believe that with the JDK1.3, the limit size of a zip was about 2Go, wasn't ?
    Thank you for all answer !
    Good day !
    PS : sorry for my very poor english ;-)

    Here is all I have found for the moment :
    ...Okay, what about my suggestion of creating your own 10GB file?
    Try this:import java.io.File;
    import java.io.RandomAccessFile;
    import java.nio.ByteBuffer;
    import java.nio.channels.FileChannel;
    import java.util.Random;
    class Main {
        public static void main(String[] args) {
            long start = System.currentTimeMillis();
            int mbs = 1024;
            writeFile("E:/Temp/data/1GB.dat", mbs);
            long end = System.currentTimeMillis();
            System.out.println("Done writing "+mbs+" MB's to disk in "+
                    ((end-start)/1000)+" seconds.");
        private static void writeFile(String fileName, int numMegaBytes) {
            try {
                int numBytes = numMegaBytes*1024*1024;
                File file = new File(fileName);
                FileChannel rwChannel =
                        new RandomAccessFile(file, "rw").getChannel();
                ByteBuffer buffer = rwChannel.map(
                        FileChannel.MapMode.READ_WRITE, 0, numBytes);
                Random rand = new Random();
                for(int i = 1; i <= numMegaBytes; i++) {
                    for(int j = 1; j <= 1024; j++) {
                        byte[] bytes = new byte[1024];
                        rand.nextBytes(bytes);
                        buffer.put(bytes);
                rwChannel.close();
            } catch(Exception e) {
                e.printStackTrace();
    }On my machine it took me 43 seconds to create a 1GB file, so it shouldn't take too long to create your own 10GB. Then try zipping that file.
    Good luck.

  • Ive gotten a zip file and i have no idea how to open it and view images

    ive gotten a zip file and i have no idea how to open it and view images?

    Double-click it in the Finder.
    (107691)

  • Error on installation of BC4J-OC4J zip file and running BC4J.html

    Hi a little help please
    I'm trying to install and configure BC4J-OC4J from the zip file
    after trying run the BC4J/JSP apps on just about every webserver
    known, this is getting close to my last attempt before I admit
    defeat and go back to Microsoft and ASP which may not be pretty
    but does work and if it stopes me banging my head on the desk is
    well worth the expense anyway ....
    I've run the self installer for the runtime etc and all seems
    well until I run the BC4J.html file and the left pane of the
    website produces this error
    I don't really want to waste anymore time tring to deploy a
    BC4J/JSP app if the server setup is not set
    Malcolm
    JSP Error
    Exception:
    javax.servlet.jsp.JspException:
    oracle.jbo.common.ampool.ApplicationPoolException: JBO-30003:
    The application pool, OnlineOrdersModule, failed to checkout an
    application module instance.
         at
    oracle.jbo.html.jsp.JSPApplicationRegistry.internalGetAppModuleIn
    stance(JSPApplicationRegistry.java:468)
         at
    oracle.jbo.html.jsp.JSPApplicationRegistry.getAppModuleInstance
    (JSPApplicationRegistry.java:433)
         at
    oracle.jbo.html.jsp.datatags.ApplicationModuleTag.doEndTag
    (ApplicationModuleTag.java:123)
         at onlineorders.category._jspService(_category.java:73)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest
    (JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService
    (JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:336)
         at
    com.evermind.server.http.ServletRequestDispatcher.invoke
    (ServletRequestDispatcher.java:508)
         at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal
    (ServletRequestDispatcher.java:177)
         at
    com.evermind.server.http.HttpRequestHandler.processRequest
    (HttpRequestHandler.java:576)
         at com.evermind.server.http.HttpRequestHandler.run
    (HttpRequestHandler.java:189)
         at com.evermind.util.ThreadPoolThread.run
    (ThreadPoolThread.java:62)
    ## Detail 0 ##
    oracle.jbo.DMLException: JBO-26061: Error while opening JDBC
    connection.
         at oracle.jbo.server.ConnectionPool.createConnection
    (ConnectionPool.java:302)
         at oracle.jbo.server.ConnectionPool.getConnection
    (ConnectionPool.java:110)
         at
    oracle.jbo.server.ConnectionPoolManagerImpl.getConnection
    (ConnectionPoolManagerImpl.java:57)
         at
    oracle.jbo.server.DBTransactionImpl.establishNewConnection
    (DBTransactionImpl.java:532)
         at oracle.jbo.server.DBTransactionImpl.initTransaction
    (DBTransactionImpl.java:643)
         at oracle.jbo.server.DBTransactionImpl.
    (DBTransactionImpl.java:346)
         at oracle.jbo.server.DatabaseTransactionFactory.create
    (DatabaseTransactionFactory.java:172)
         at oracle.jbo.server.NullDBTransactionImpl.connect
    (NullDBTransactionImpl.java:352)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.connect
    (ApplicationPoolImpl.java:1237)
         at
    oracle.jbo.common.ampool.ApplicationPoolImpl.createNewInstance
    (ApplicationPoolImpl.java:514)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.checkout
    (ApplicationPoolImpl.java:634)
         at
    oracle.jbo.html.jsp.JSPApplicationRegistry.internalGetAppModuleIn
    stance(JSPApplicationRegistry.java:463)
         at
    oracle.jbo.html.jsp.JSPApplicationRegistry.getAppModuleInstance
    (JSPApplicationRegistry.java:433)
         at
    oracle.jbo.html.jsp.datatags.ApplicationModuleTag.doEndTag
    (ApplicationModuleTag.java:123)
         at onlineorders.category._jspService(_category.java:73)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest
    (JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService
    (JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:336)
         at
    com.evermind.server.http.ServletRequestDispatcher.invoke
    (ServletRequestDispatcher.java:508)
         at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal
    (ServletRequestDispatcher.java:177)
         at
    com.evermind.server.http.HttpRequestHandler.processRequest
    (HttpRequestHandler.java:576)
         at com.evermind.server.http.HttpRequestHandler.run
    (HttpRequestHandler.java:189)
         at com.evermind.util.ThreadPoolThread.run
    (ThreadPoolThread.java:62)
    ## Detail 0 ##
    java.sql.SQLException: Io exception: The Network Adapter could
    not establish the connection
         at oracle.jdbc.dbaccess.DBError.throwSqlException
    (DBError.java:180)
         at oracle.jdbc.dbaccess.DBError.throwSqlException
    (DBError.java:222)
         at oracle.jdbc.dbaccess.DBError.throwSqlException
    (DBError.java:335)
         at oracle.jdbc.driver.OracleConnection.
    (OracleConnection.java:319)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance
    (OracleDriver.java:415)
         at oracle.jdbc.driver.OracleDriver.connect
    (OracleDriver.java:302)
         at java.sql.DriverManager.getConnection
    (DriverManager.java:517)
         at java.sql.DriverManager.getConnection
    (DriverManager.java:146)
         at oracle.jbo.server.ConnectionPool.createConnection
    (ConnectionPool.java:277)
         at oracle.jbo.server.ConnectionPool.getConnection
    (ConnectionPool.java:110)
         at
    oracle.jbo.server.ConnectionPoolManagerImpl.getConnection
    (ConnectionPoolManagerImpl.java:57)
         at
    oracle.jbo.server.DBTransactionImpl.establishNewConnection
    (DBTransactionImpl.java:532)
         at oracle.jbo.server.DBTransactionImpl.initTransaction
    (DBTransactionImpl.java:643)
         at oracle.jbo.server.DBTransactionImpl.
    (DBTransactionImpl.java:346)
         at oracle.jbo.server.DatabaseTransactionFactory.create
    (DatabaseTransactionFactory.java:172)
         at oracle.jbo.server.NullDBTransactionImpl.connect
    (NullDBTransactionImpl.java:352)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.connect
    (ApplicationPoolImpl.java:1237)
         at
    oracle.jbo.common.ampool.ApplicationPoolImpl.createNewInstance
    (ApplicationPoolImpl.java:514)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.checkout
    (ApplicationPoolImpl.java:634)
         at
    oracle.jbo.html.jsp.JSPApplicationRegistry.internalGetAppModuleIn
    stance(JSPApplicationRegistry.java:463)
         at
    oracle.jbo.html.jsp.JSPApplicationRegistry.getAppModuleInstance
    (JSPApplicationRegistry.java:433)
         at
    oracle.jbo.html.jsp.datatags.ApplicationModuleTag.doEndTag
    (ApplicationModuleTag.java:123)
         at onlineorders.category._jspService(_category.java:73)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest
    (JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService
    (JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:336)
         at
    com.evermind.server.http.ServletRequestDispatcher.invoke
    (ServletRequestDispatcher.java:508)
         at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal
    (ServletRequestDispatcher.java:177)
         at
    com.evermind.server.http.HttpRequestHandler.processRequest
    (HttpRequestHandler.java:576)
         at com.evermind.server.http.HttpRequestHandler.run
    (HttpRequestHandler.java:189)
         at com.evermind.util.ThreadPoolThread.run
    (ThreadPoolThread.java:62)
         at
    oracle.jbo.html.jsp.datatags.ApplicationModuleTag.doEndTag
    (ApplicationModuleTag.java:147)
         at onlineorders.category._jspService(_category.java:73)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest
    (JspApplication.java:385)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259)
         at oracle.jsp.JspServlet.internalService
    (JspServlet.java:178)
         at oracle.jsp.JspServlet.service(JspServlet.java:148)
         at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:336)
         at
    com.evermind.server.http.ServletRequestDispatcher.invoke
    (ServletRequestDispatcher.java:508)
         at
    com.evermind.server.http.ServletRequestDispatcher.forwardInternal
    (ServletRequestDispatcher.java:177)
         at
    com.evermind.server.http.HttpRequestHandler.processRequest
    (HttpRequestHandler.java:576)
         at com.evermind.server.http.HttpRequestHandler.run
    (HttpRequestHandler.java:189)
         at com.evermind.util.ThreadPoolThread.run
    (ThreadPoolThread.java:62)

    Hi
    Was your network running fine during your test? Did you specify
    the correct connection properties in oc4j?
    Cheers!
    Amin

  • Storing a ZIP file to the database

    I have to store a zip file to the database. I used ZipOutputStream to compress the data into the Zip format and then insert into the Database.
    This is what i am doing:
    java.sql.PreparedStatement pst = null;
    GZIPOutputStream out_stream = null;
    try
    out_stream =
    new GZIPOutputStream( new ByteArrayOutputStream( reqdata.length() ) );
    FileOutputStream fstr = new FileOutputStream( "file1" );
    ObjectOutputStream obst = new ObjectOutputStream( fstr );
    obst.writeObject( out_stream );
    obst.close();
    FileInputStream in = new FileInputStream( "file1");
    ObjectInputStream in_stream = new ObjectInputStream(in);
    pst.setBinaryStream( 3, in_stream, reqdata.length() );
    in_stream.close();
    catch( Exception e )
    reqdata is the data that i want to store, which i m reading from a file at present.
    It fails at obst.writeObject( out_stream ); coz the GZIPOutputStream is not serializable.
    This data(ZIP file) has to be again read from the database.
    Can someone please help me with this or let me know if there is any other way to do the same
    Thanks in advance

    Just drop the business with the ObjectOutputStream and ObjectInputStream. They would be unnecessary and time-wasting even if they did work.

  • Have an i pad mini and have started an online course. Documents sent via Dropbox and need to know best app to buy to enable me to use documents offline. Documents include zip files and powerpoint. cheers

    i have an ipad mini and have started online course.documents sent to Dropbox. Mixture of word documents, zip files and powerpoint. Need to be able to use documents offline. any suggestions on suitable app that would enable me to transfer documents and work with them off line?

    Depends on what you mean by "work with them offline". If you mean store the documents so you can access them if not connected to the internet, you already have it: DropBox.you can download files from the cloud an use them offline. You will need an app to handle the zip files: I use File Manager, but there are others. File Manager also intergrates with dropbox, Google Drive, and iCloud. If you only need to read them, these apps will take care of that for you.
    As for editing, there are a few options. All have their limitations.
    Some possible apps to look at:
    Pages, Numbers (Apple)
    Document (by Savy soda)
    document 2 go
    Quickoffice
    CloudOn
    Smart Office
    Make sure to read botht he descriptions and the reveiws carefully

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

Maybe you are looking for