Compiling sendhtml.java example

hi
i tried compiling sendhtml.java from the javamail example folder using eclipse, but it seems eclipse can't recognise ByteArrayDataSource. It says ByteArrayDataSource cannot be resolved or is not a type. The ByteArrayDataSource statement is located at the end of the program source code.
Do i need to import anything into eclipse before compiling the source code?
any help are greatly appreciated. thanks

thanks... but i have added both *.jar files but still the ByteArrayDataSource statement is still treated as "cannot be resolved or is not a type"

Similar Messages

  • Error while executing Java examples

    Hello every 1,
    Whenever I try to compile the java code using commandline, i am getting the same kind of error. Can some one please help me if there is a trick on executing these examples. For instance I compiled this java example given here . compilation is successful. When I try to execute the program, I get the error message, could not find or load mainclass ArrayDemo.
    Appreciate your help.
    Thanks,
    FJ

    Hi -
    When I compile the program using command prompt, I am in C:\Users\Farooq\MyPrograms directory. MyPrograms is where all my programs are.
    Below is the actual program, it does not have package statement.
    class ArrayDemo {
    public static void main(String[] args) {
         int[] anArray; // declares an array of integers
    anArray = new int[10]; // allocates memory for 10 integers
    anArray[0] = 100; // initialize first element
    anArray[1] = 200; // initialize second element
    anArray[2] = 300; // etc.
    anArray[3] = 400;
    anArray[4] = 500;
    anArray[5] = 600;
    anArray[6] = 700;
    anArray[7] = 800;
    anArray[8] = 900;
    anArray[9] = 1000;
    System.out.println("Element at index 0: " + anArray[0]);
    System.out.println("Element at index 1: " + anArray[1]);
    System.out.println("Element at index 2: " + anArray[2]);
    System.out.println("Element at index 3: " + anArray[3]);
    System.out.println("Element at index 4: " + anArray[4]);
    System.out.println("Element at index 5: " + anArray[5]);
    System.out.println("Element at index 6: " + anArray[6]);
    System.out.println("Element at index 7: " + anArray[7]);
    System.out.println("Element at index 8: " + anArray[8]);
    System.out.println("Element at index 9: " + anArray[9]);
    }

  • Urgent! Pls help me! Can't compile any *.java files

    I am a new user to Java2SDK. I am using Win2K sever and I have installed Java2SDK1.4.0 in D drive. When I compile any *.java files, a message " 'javac' is not recognized as an internal or external command, operable program or batch file" appears. How can I solve this problem?
    Please help me. I am busy with my homework. Thank you very much.

    In your PATH variable include %JAVA_HOME%\bin;
    For example:
    C:\jdk1.4\bin;

  • How to compile Oracle java strored procedure in Putty

    I have created a java strored procedure , which would be invoked by oracle function.
    This java stored procedure is get compiled via SQL plus. While compiling by the use of putty , it shows lots of compilation error .
    How to compile Oracle java strored procedure in Putty??

    You'll need to add the j2ee.jar to your classpath. Usually you'll have to add some jars from your app server to your classpath as well.
    For example (using weblogic):
    javac -classpath c:\java\j2ee\j2ee1.3.1\lib\j2ee.jar;c:\tools\appserver\weblogic\wl7.1\lib\weblogic.jar
    HelloServlet.java

  • Compiling multiple java

    Hi. I have a question on how to compile many .java files, which are stored in various dirrectories (packages). There are literally hunderds of files. All are stored in a dirrectory tree that takes orign in .. let's say .. "Src" and branches down from it.
    I specifically want to use 'javac' compiler.
    When I am the 'src' folder I want to say
    prompt> javac [option] *.java
    Now I'm not sure what that option is. It basically have to tell the OS to compile all files in all the subdirectories of src and their corresponding subdirectories. A recursive compilation that is.
    Would appreciate any help.
    Thanks

    prompt> javac [option] *.java
    Now I'm not sure what that option is.There is no option to "recursively" compile .java source files.
    Unlike some languages the source file name and the name of the
    directories it is in are intimately related to the type of the class being
    compiled. You specify a .java source file (or multiple source files) and
    using what it knows about the source file names, and what you set
    the classpath to be, the compiler will determine what needs to be
    compiled and where the source files are located.
    Have you read the documentation for javac?
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javac.html
    The command (or commands) you use will almost certainly involve
    the -d option to set the destination directory, the -classpath option to
    set the classpath and possibly the -sourcepath option. There are
    examples given for both compiling multiple files, and compiling where
    source and class files are in separate directories.
    If you obtained these files from somewhere it might be a good idea to
    consult whatever documentation is available. In particular you are
    looking for some description of the "build" process. Building a large,
    related, set of files could involve installing and using a tool like Ant.

  • How to compile a java file(Servlet) in J2EE v1.3.1

    This is my first time using J2EE instead of J2SE!!HOw to compile a java file in J2ee\bin because there is no javac in j2ee and when i compile in J2se i got
    G:\j2sdk1.4.1_01\bin>javac HelloServlet.java
    HelloServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    This mean it doen;t support servlet in J2se!!so how can /what command to compile a servlet java file in j2ee.Thanks

    You'll need to add the j2ee.jar to your classpath. Usually you'll have to add some jars from your app server to your classpath as well.
    For example (using weblogic):
    javac -classpath c:\java\j2ee\j2ee1.3.1\lib\j2ee.jar;c:\tools\appserver\weblogic\wl7.1\lib\weblogic.jar
    HelloServlet.java

  • Error while compiling hellowbigdataworld.java

    kvlite started successfully ; i tested by pinging from different command prompt.
    while try to compile the example program hellowbigdataworld.java getting error.
    package oracle.kv does not exist

    I created custom VO and files in my local JDev and it is working properly.
    I wanna migrate it to actual instance.So my question is is it mandatory to compile custom java file in application server or i can use same which i used in my local machine(windows)?
    -- Manoj

  • Why i am unable to compile this .java

    Hi
    I get the Error messages
    C:\kk>javac BICDownloader.java
    BICDownloader.java:61: cannot find symbol
    symbol : method openConnection()
    location: class java.lang.String
    URLConnection urlc = url.openConnection();
    ^
    BICDownloader.java:64: cannot find symbol
    symbol : class SSLTunnelSocketFactory
    location: class BICDownloader
    (new SSLTunnelSocketFactory(proxyHost,proxyPort));
    ^
    Note: BICDownloader.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    When trying to compile
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.FileOutputStream;
    import java.io.FileInputStream;
    import java.util.StringTokenizer;
    import java.util.Properties;
    import java.net.*;
    import java.io.*;
    import java.security.*;
    import javax.net.*;
    import javax.net.ssl.*;
    import javax.net.SocketFactory;
    import javax.net.ssl.SSLSocketFactory;
    import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.Header;
    import org.apache.commons.httpclient.HttpException;
    import org.apache.commons.httpclient.HttpStatus;
    import org.apache.commons.httpclient.methods.GetMethod;
    import org.apache.commons.httpclient.params.HttpMethodParams;
    import org.apache.commons.httpclient.UsernamePasswordCredentials;
    import org.apache.commons.httpclient.auth.AuthScope;
    * Created on Mar 2, 2007
    * S.W.I.F.T. s.c.r.l.
    public class BICDownloader {
    private final static String proxyHost = "isln616";
    private final static String proxyPort = "9090";
         public static void main(String[] args) throws Exception {
              int exitcode = 0;
              int statusCode;
       String url = "https://www2.swift.com/bicdownload/bicdownloader?"
                              + "action=getfile&productline=bicdir&product=bicdb&content=delta&format=txt";
    HttpClient client = new HttpClient();
             GetMethod method = new GetMethod(url);
             // Provide custom retry handler if required
             method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                                              new DefaultHttpMethodRetryHandler(3, false));
         System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
          //System.setProperty("https.proxyHost",proxyHost);
          //System.setProperty("https.proxyPort",proxyPort);
                   URLConnection urlc = url.openConnection();
          if(urlc instanceof com.sun.net.ssl.HttpsURLConnection){
                        ((com.sun.net.ssl.HttpsURLConnection)urlc).setSSLSocketFactory
                             (new SSLTunnelSocketFactory(proxyHost,proxyPort));
             try {
                  // We strongly recommend obfuscation of password  and restricted access to its storage
                  Properties prop = new Properties();
                  InputStream fis = (InputStream)new FileInputStream("c:/KK/bicdownload.prop");
                  prop.load(fis);
                  // Set Credentials
                  UsernamePasswordCredentials credentials;
                  credentials = new UsernamePasswordCredentials(prop.getProperty("username"),
                                                                  prop.getProperty("password"));
                  client.getState().setCredentials(new AuthScope("www2.swift.com", 443), credentials);
                  // Executing the method.
                  statusCode = client.executeMethod(method);
                  if (statusCode != HttpStatus.SC_OK) {
                       // Handling HTTP error 404 and 500 not covered in this example
                       // All http error cause in this example exit with status 1.
                       System.err.println("Method failed: " + method.getStatusLine()+ "\n" +
                                         method.getResponseBodyAsString());
                       System.out.println(method.getRequestCharSet() + "\n" + method.getRequestHeader("").toString());
                       exitcode = 1;
                  else {
                       //Get the file size from the response body and do something with it
                       Header[] contlen = method.getResponseHeaders("Content-Length");
                       if (contlen.length != 0) {
                            StringTokenizer stone = new StringTokenizer(contlen[0].getValue(), "=");
                            int size = new Integer(stone.nextToken()).intValue();
                            // Do something with the file size
                            System.out.println("File size is: " + size);
                       // Get the filename from the response body.
                       InputStream is = method.getResponseBodyAsStream();
                       Header[] contdisp = method.getResponseHeaders("Content-Disposition");
                       String filename = null;
                       StringTokenizer sttwo = new StringTokenizer(contdisp[0].getValue(), "=");
                       while (sttwo.hasMoreTokens()) filename = sttwo.nextToken();
                       // Hardcoded disk and directory path are indicative
                       FileOutputStream fos = new FileOutputStream("c:/kk/" + filename);
                       byte[] buffer = new byte[4096];
                       int count = is.read(buffer);
                       while (count != -1) {
                            fos.write(buffer, 0, count);
                            count = is.read(buffer);
                       fos.flush();
                       fos.close();
                       is.close();
             } catch (HttpException e) {
                  exitcode = 2;
                  System.err.println("Fatal HTTP Error: " + e.getMessage());
                  e.printStackTrace();
             } catch (IOException e) {
                  exitcode = 3;
                  System.err.println("Fatal I/O error: " + e.getMessage());
                  e.printStackTrace();
             } finally {
                  // Release the connection.
                  method.releaseConnection();
                  System.exit(exitcode);
             System.out.println("Dowload done");
    }

    Look at the Classnames it's complaining about, then look at your import list.
    That is the reason, of course.
    Edit: The second error has to do with the Classes. The first one, is as pointed out below,
    is because how you declared and defined your "url" variable, which should be URL and not String.

  • My class only compiles in Java 1.6 and not in Java 1.5

    Hi, my java class wont compile in java 1.5, it only compiles in Java 1.6. How can i compile the following?
    import java.util.*;
    public class ShoppingBasket
         Vector products;
         public ShoppingBasket() { products = new Vector(); }
         public void addProduct(Product product)
         boolean flag = false;
         for(Enumeration e = getProducts(); e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(product.id))
                   {flag = true; item.quantity++; break; }
              if(!flag){ products.addElement(product);}
         public void deleteProduct(String str)
              for(Enumeration e=getProducts();
              e.hasMoreElements();)
              { Product item = (Product)e.nextElement();
                   if(item.getId().equals(str))
                   {products.removeElement(item); break; }
         public void emptyBasket(){products = new Vector();}
         public int getProductNumber(){ return products.size();}
         public Enumeration getProducts() { return products.elements(); }
         public double getTotal()
         Enumeration e = getProducts();
         double total; Product item;
         for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
         {item = (Product)e.nextElement(); }
         return total;
    }It should link with a class called Product which compiles fine... the errors i get are below:
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:6: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            public void addProduct(Product product)
                                   ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:10: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:20: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
                    { Product item = (Product)e.nextElement();
                                      ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:35: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            double total; Product item;
                          ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:36: inconvertible types
    found   : <nulltype>
    required: double
            for(total=0.0D;e.hasMoreElements();     total+= item.getTotal())
                                                                         ^
    K:\jakarta-tomcat-5.0.18\webapps\ROOT\WEB-INF\classes\ShoppingBasket\ShoppingBas
    ket.java:37: cannot find symbol
    symbol  : class Product
    location: class ShoppingBasket
            {item = (Product)e.nextElement(); }
                     ^
    8 errors

    fahafiz wrote:
    ah, so should i put the classes into the folder which the classpath is assigned to?More likely you should assign your classpath to whatever folder your classes are in.
    Put your files where they make sense, and then fill in classpath accordingly:
    javac -classpath classpath MyFile.java(I think, it's been a while since I compiled from the command-line, see http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html)

  • How to compile a java file which is in memory?

    how to compile a java file which is in memory?
    such as:
    String s="class MyClass {....}";
    how to compile the string?
    thx

    come on ...That was a perfectly valid solution.
    Do you know how to call the sun.* compiler? If not then search the forums for it. If that interface still exists (which it might not in newer versions) you then will create a string stream from your class and pass it to that.

  • Problem in compiling this java need help

    package test;
    public class simpleTest{
         public simpleTest(){
              int a =0;
    import test.*;
    public class testPackage{
         public static void main(String [] args){
              simpleTest sT=new simpleTest();
              System.out.println("Package from Test A value = "+a);
    }error got when compile this codes.
    --------------------Configuration: <Default>--------------------
    C:\Notes\testPackage.java:4: cannot access simpleTest
    bad class file: C:\Notes\simpleTest.java
    file does not contain class simpleTest
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    simpleTest sT=new simpleTest();
    ^
    1 error
    Process completed.

    package test;
    public class simpleTest{
    private int a;
         public simpleTest(int a){
              // int a =0;
    this.a = a;
    public int getA() {
    return a;
    =============== 2 diff files===================
    import test.*;
    public class testPackage{
         public static void main(String [] args){
              simpleTest sT=new simpleTest();
    System.out.println("Package from Test A value =
    = "+st.getA());
    }- Saishu can compile the java package?

  • How to compile a java file in J9 for windows mobile 5.0

    I have downloaded J9 for windows mobile 5.0 and need help on how to compile a java file.

    You can compile your source code using J2SE ;)
    may be this is important for you:
    http://awareness.ics.uci.edu/~rsilvafi/pocketPC/index.
    html
    Regards!!!Actually i am using some eSWT related classes also.. so is there any way to compile from the J9 environment using J9 console..

  • How to compile a java file in a java program

    Hi,
    I don't know to compile a java file in a java class.
    Could somebody help me?
    Thanks.

    if ur using windows...
    goto ur directory and then type
    javac FILENAME.java
    and ur done!

  • How to compile my java application for Personal Java??

    i write a simple program and want to run it in PJEE.
    program is:
    import java.awt.*;
    public class TestApp {
    public static void main(String[] args) {
    Frame f = new Frame();
    f.pack();
    f.setSize(300,300);
    f.show();
    and i compiled it using JDK1.4
    javac TestApp.javathen i want to test it by using pjava
    pjava TestAppbut i got a error message:
    Error loading class TestApp: Bad major version numberplease tell me what it is mean and how i can debug it, thanks.

    hi, all
    i have resolved my question by myself.
    because:
    |-> personal java
    |
    jdk1.1 -> jdk1.2 -> jdk1.4
    so, i must compile the java file by using jdk1.1.x
    :)

  • Unable to compile the java class in the SQL PLUS

    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;

    860411 wrote:
    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    I believe the error message is clear and self-explanatory.
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;
    The last two lines above should be
    /Srini

Maybe you are looking for