How to extract  Blob using java

hai
have a peace day.
i want to extract the data from BLOB thro java
i using getblob, but i don,t know properly
please tell any ideas r give some sample codes
thank u
raja

i want to extract the data from BLOB thro javaYou can use getBytes or getBinaryStream to extract the expected data stream to do more.

Similar Messages

  • How to send attachments using java application and outlook

    Hi ,
    I created an application in java which is as
    on the Conference Tab i can schedule a conference and with the send command on page it map all the scheduled data to outlook(with all conference details) and using outlook send option the mails are send to appropriate user.
    but now i want to modify this application such as when i use the send command from my jsp page it should attach the file that is in .vcs or .ics format for auto updation of user calender.
    can any one know how to send attachment using java application .

    Last time I checked, SMS was a service between carriers and doing SMS yourself was really tricky. Some services existed to let you do it but as I recall they wanted non-trivial money.
    However, most phone carriers provide an email-to-SMS bridge of some kind.
    So the easiest thing is just to send an email.
    That's sending from a non-phone to a phone. There's a J2ME library to send/receive SMS from/to a phone.
    However, this is from memory, and a little out of date, so I could be entirely wrong. Hope it helps anyway.

  • How to resize image using java imageio

    Hello ,
    I want to know how to resize image using java imageio.
    I dont want to use java awt because i am writing a web application.
    help is very much needed
    thank you.

    Just use an AffineTransform !
    Its much easier

  • How to read OVD using java

    Hi all,
    how to access OVD using Java?
    Thanks,
    Kumar.P

    Hi,
    You can just normal LDAP API codes to connect to OVD the same way you connect to other LDAP servers.
    PFB sample code for connecting to OVD.
    Properties props = new Properties();
    try {
    props.load(new FileInputStream("LdapCredentials.Properties"));
    } catch (IOException e) {
    // TODO
    ldapurl = "ldap://hostname:390";
    ldapUser = "cn=orcladmin,ou=Org12,dc=ovid,dc=com";
    userPassword = "welcome1"; //"Killtheking123456";
    userContext = "ou=Join1,dc=ovid,dc=com";
    Now, you have to get Directory Context as shown below.
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, ldapurl);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    //Initialize the Directory context
    DirContext dCtx = new InitialDirContext(env);
    Then you can perform search operations or new user creation etc., as you wish.
    Does this help?
    -Mahendra.

  • How to create Webservice using java

    Hi Experts,
          I am very new to Visual composer, can any one of you suggest how to create a webservice using java so that i can use that webservice in Visual Composer application.If it is possible please give me detailed description about it.
    Regards,
    Prasanna.

    Hi Prasanna,
    See if my article is of any use to you:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10">How to Create a Web Service using an Enterprise JavaBean</a>
    For creating Web Services, you won't need to do the MS SQL Part explained in my doc. You can just concentrate on the part where i explain how to create a Web Service using an EJB.
    Bye
    Ankur

  • How to send SMS using java

    Dear All
    How we can send SMS(Short Message Service) to mobile phones using java.
    By Registering in some sites and using that user name and password we can send SMS.
    But after some limited SMS we have to pay for further use.
    I need some thing which we can use as free.
    Can any one help me
    Thanks in Advance

    The easiest way would be to send a regular email to a Email to SMS gateway.
    Check out the list of Email to SMS gateways at http://en.wikipedia.org/wiki/SMS_gateways

  • How to send fax using java programming

    i need to send files in my hard disk through fax using java programming.
    i have found on the internet that it is possible to be implemented by using java.comm API and JTAPI. however, i don't know how...does anyone can tell me the details? also, as i know it will be a big project to send fax using such API. is that any other simple way to implement the fax function in java? thx a lot!

    To cse.mahbub:
    Are you aware that you replied to a 5 1/2 year old question?
    Please don't do that. Reply only to current questions.

  • How to create database connection and how to call it using Java

    Hi,
    Good day! I'd like to know how I can create a db connection in JDev, then use this connection to retrieve data using a Java Class? I've seen using New Gallery > Database Connection. But I'm not sure how I can access this connection using Java and display some output from the retrieved records.
    Any steps/tutorial link is appreciated.
    Thanks in advance,
    Rian

    Hi,
    If you need to access the connection in the entity object then refer http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvgen.htm#BABEIFAI i.e in MODEL.
    But if you want to access connection in ViewController part of application then you need to do it manually.For this i am giving you my code for reference.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.faces.context.FacesContext;
    import oracle.jdbc.pool.OracleDataSource;
    public class DataHandler {
    String jdbcUrl = null;
    String userid = null;
    String password = null;
    Connection conn;
    public static final String CONNECTION_STRING =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("connectionString");
    public static final String USER_NAME =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("userName");
    public static final String PASSWORD =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("password");
    public DataHandler(String jdbcUrl, String userid, String password,
    boolean shouldConnect) throws SQLException {
    this.jdbcUrl = jdbcUrl;
    this.userid = userid;
    this.password = password;
    if (shouldConnect) {
    connect();
    public void connect() throws SQLException {
    OracleDataSource ds;
    ds = new OracleDataSource();
    ds.setURL(jdbcUrl);
    conn = ds.getConnection(userid, password);
    public Connection getConnection() {
    return conn;
    public ResultSet executeQuery(String sql) throws SQLException {
    Statement s = conn.createStatement();
    return s.executeQuery(sql);
    public void closeConnection() throws SQLException {
    if (!conn.isClosed()) {
    conn.close();
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • How can zip file using java ?

    I would like to ask is that any package or example code allowing zipping serveral file using java ?

    Here's a test program I wrote, which may help. As far as I know the jip/zar classes are interchangeable.
    import java.io.*;
    import java.util.jar.*;
    public class ZipTest
        public static void main(String[] args) throws Exception
            /* create a file stream for the new zip file */
            FileOutputStream fileOutputStream=new FileOutputStream("test.zip");
            JarOutputStream zipOutputStream=new JarOutputStream(fileOutputStream);
            /* open file to add to zip file */
            File file=new File("test.dat");
            FileInputStream fileInputStream=new FileInputStream(file);
            /* create a buffer and read file into buffer */
            int length=(int)file.length();
            byte[] buffer=new byte[length];
            fileInputStream.read(buffer,0,length);
            /* create entry in zip file */
            JarEntry jarEntry=new JarEntry("test.dat");
            /* add it */
            zipOutputStream.putNextEntry(jarEntry);
            zipOutputStream.write(buffer,0,length);
            /* clean up and exit */
            fileInputStream.close();
            zipOutputStream.close();
    }

  • How to open MSWORD using JAVA/JNI and write the database entries into WORD

    Hi..
    I am searching for java codes that uses JAVA NATIVE INTERFACE (JNI) for opening MSWORD 2003.
    To be brief.
    I created HTML form called Employee_data.
    if i click on Submit button a word document should be opened.This should be using JNI.
    I have also created a servlet in jsp to process the form data and store it into database(mysql).;
    Please help me to find the codes to open MSWORD on submit click and to write the database entries into word file.Can i get the full code for that.This is so urgent.
    Thanks in advance.

    Hi Suresh,
    The easest solution I can think of is to copy the math equation from the PowerPoint then paste in the Word document directly, there's actually no way to convert it to plain text, some equation is very complext, String variable is not suitable in this case.
    For example, this code works fine:
    var powerPoint = new Application { WindowState = PpWindowState.ppWindowMinimized };
    var oPresSet = powerPoint.Presentations;
    Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"C:\test.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
    var strObj = oPres.Slides[1].NotesPage.Shapes[2].TextFrame2.TextRange.MathZones.get_MathZones();
    strObj.Copy();
    Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
    wordApp.Visible = true;
    Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add();
    doc.Range(0, 0).Paste();
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to send FAX using java. (JTAPI)

    Can anybody suggest how to send FAX in Java. I've heard bout JTAPI's. but never tried it. and the sample code given is good for nothing. I want to send (not receive) FAX from my java application (Ive already tried javax.comm package, for that u need third party FAX server)
    Or is ther any other way of sending FAX except JTAPI?
    Pls comment on this.
    thanx in advance
    Ketan Malekar
    [email protected]

    To cse.mahbub:
    Are you aware that you replied to a 5 1/2 year old question?
    Please don't do that. Reply only to current questions.

  • How to send emails using java code

    Hi,
    can any give me some sample code for sending emails using java language

    JavaMail quick start
    jGuru: Fundamentals of the JavaMail API

  • How to load file using Java

    Hello,
    I am trying to load file into the TimesTen (csv or txt) using Java language. I tried using query "LOAD DATA INFILE ..." but I received error that there is something wrong in word "DATA", later I tried to copy solution from sample programs written in Java but I get a lot of error which i couldn't solve. I also tried to use ttBulkCp in Java like this: query = {CALL ttBulkCp ... } but it wasn't working as well. There must be a way to load data from file to the TimesTen table using script written in Java, right?
    Thank you for any ideas.

    If you take a look at the quickstart guide you get when you install the product you'll see a java code example called 'level3.java' which does what you want:
    This program uses the TimesTen JDBC driver to perform order processing operations:
    a) Connect to the database using the TimesTenDataSource interface
    b) Process all orders in the input3.dat file by inserting into the ORDERS and ORDER_ITEM tables.....
    Regards
    Tim

  • Oracle Blob using Java help (Error: JVM_recv in socket input stream read )

    I am trying to insert a record with Blob column (size of image 'mg.jpg' about 15KB) and I get the runtime error:
    [java] java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
    [java]      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    [java]      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    [java]      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    [java]      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
    [java]      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    [java]      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    [java]      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    [java]      at test.ProvisioningParser.TestBlob.main(Unknown Source)
    This is what code looks like: I am not sure what's wrong, any help appreciated. Thanks!
         try{
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("jdbc:oracle:thin:@VALUED-20606295:1521:dbbook","jvending","jvending");
                   java.util.zip.ZipInputStream zip = new java.util.zip.ZipInputStream(new java.io.FileInputStream(new java.io.File("D:\\work\\mywork\\source\\test\\ProvisioningParser\\test.par"))) ;
                   int len = 0 ;
                   java.util.zip.ZipEntry entry = null;
                   do{
                        entry = zip.getNextEntry();
                        if (entry != null){
                             if (entry.getName().equalsIgnoreCase("mg.jpg")){
                                  len = (int)entry.getSize();
                                  break;
                   }while(entry!=null) ;
                   stmt = con.prepareStatement( "Insert into icon (parid, clientbundleid, id, iconfile ) values ( ?,?,?,?)"
                         stmt.setString(1,"101");
                         stmt.setString(2,"101");
                         stmt.setInt(3,1);                    
                         stmt.setBinaryStream( 4, zip, len);
                   stmt.setQueryTimeout(0);
                   stmt.executeUpdate();
                   con.close();               
              catch(Exception e){
                   e.printStackTrace();
              }Thanks,
    Rashmi

    As a guess what you are doing with that zip stuff is very odd.
    You do realize that it is just going to put some binary data into the blob right? And the methods that is going to use will not necessarily create a 'complete' zip file?
    If you want a zip file then just load the file, dont use the zip classes.
    And if you want part of a zip file, (and want to store the parts as a zip) then extract it from the file and create another zip entity using a byte stream rather than a file.
    Finally I suspect your error with the blob occurs because you do not close the statement. But at any rate you should figure out how to do the blob code independent of the zip stuff.
    And what oracle driver version are you using? Some of the older ones need oracle specific handling for blobs.

  • How to extract blob from a table and save it as  a file?

    Dear All
    i have table employee (emp_id number , emp_name varchar2(60) emp_image blob)
    1 - i want to extract the emp_image of every employee into a operating system folder c:\images
    2 - the file name should be emp_id.gif or emp_id.jpg
    How can i do that?
    Thanks a lot in advance for your co-operation
    Regards
    Mohamed Hammed

    I want to put an XML in a table's column using BLOBs.
    I tried the following ways:
    Created a table:
    CREATE TABLE lob_table (id NUMBER, doc BLOB);
    Created a directory:
    create or replace directory XML_DIR as '\app\granite\rnd';
    Created a PL/SQL procedure:
    CREATE OR REPLACE
    PROCEDURE BLOB_PROCEDURE AS
    src_lob BFILE := BFILENAME('XML_DIR', '1.xml');
    dest_lob BLOB;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('1');
    INSERT INTO lob_table VALUES(1, EMPTY_BLOB())
    RETURNING doc INTO dest_lob;
    DBMS_OUTPUT.PUT_LINE('2');
    DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
    DBMS_OUTPUT.PUT_LINE('3');
    DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob,
    SRC_LOB => src_lob,
    AMOUNT => DBMS_LOB.GETLENGTH(src_lob) );
    DBMS_OUTPUT.PUT_LINE('Done');
    DBMS_LOB.CLOSE(src_lob);
    Exception
    when others then
    DBMS_OUTPUT.PUT_LINE('Exception');
    COMMIT;
    END BLOB_PROCEDURE;
    I am using Oracle SQL Developer.
    When I try to run the above procedure, it says:
    "Source does not have a runnable target."
    When I use Toad, the procedure executes properly, but there is no blob data in the table.
    Kindly help me in this regard.

Maybe you are looking for

  • Error : in  placement of Macro with ABAP code

    Hi, I have to replace the Macro rp-provide-from-last for 0105 infotype with subtype 05 and pn-begda ,pn-endda.please send me the code. thanks in advance. bye raj.

  • OS X for training to create a VM

    I have two new MAC computers with Mountain Lion 10.8 (iMAC and MacBook pro). I am looking to go install aParallel seesion and an Oracle VM session for MAC OS 10.8. Can achieve this by purchasing a copy of Mac OSX from the MAC store and if so how much

  • Deploying EJBs on multiple nodes

    Hi, Our Application works when we deploy it on a single node. But the moment we deploy it with multiple nodes,we are getting a exception: java.lang.NoClassDefFoundError: javax/xml/bind/UnmarshalException at java.lang.Class.forName0(Native Method) at

  • Incorrect value: Namespace prefix q1 of QName q1:RequestArray is undeclared

    Can someone please help me understand this error message? Incorrect value: Namespace prefix q1 of QName q1:RequestArray is undeclared Exception of class CX_SLIB I get this error when generating the Proxy Class. The URL of the Web Service WSDL is: htt

  • Slow-Start Up and "can not find the server" dialog box

    hi there - 2 year old Ibook G4. When I try to open either Safari or Netscape the "can not find the server" box pops up.. I have a solid connection wi-fi for the wireless signal is on full strength. I have cleared my cache. Also I am experiencing star