Read exchange mailbox from oracle

Hello all,
Is there anyway i can read a mailbox in outlook from forms with pl/sql or anything else ?
thanks

Right now i can't find the link, but i've the content which was posted by Billy in this forum. So, i'm posting it exactly what he posted -
> Can you provide me some references for the same? (sample inplementation or study
material)
Well, here is a very basic example of a PL/SQL pipelined table function that wraps a POP3 mail account into a SQL table - allowing you to run SQLs directly against the e-mail account.
I did a few basic tests using a local POP3 server on my Linux box and it seems to work fine.
SQL> create or replace type TStrings is table of varchar2(4000);
  2  /
Type created.
SQL>  
SQL> create or replace function pop3( userName varchar2, password varchar2, msgNum number ) return TStrings pipelined is
  2          POP3_SERVER             constant varchar2(19) := '127.0.0.1';
  3          POP3_PORT               constant number := 110;
  4          POP3_TIMEOUT            constant number := 5;
  5          POP3_OK                 constant varchar2(10) := '+OK';
  6
  7          E_POP3_ERROR    exception;
  8          E_READ_TIMEOUT  exception;
  9          pragma exception_init( E_READ_TIMEOUT, -29276 );
10
11          socket  UTL_TCP.connection;
12          line    varchar2(4000);
13          bytes   integer;
14
15          -- send a POP3 command
16          -- (we expect each command to respond with a +OK)
17          function  WriteToPop( command varchar2 ) return varchar2 is
18                  len     integer;
19                  resp    varchar2(4000);
20          begin
21                  len := UTL_TCP.write_line( socket, command );
22                  UTL_TCP.Flush( socket );
23
24                  -- using a hack to check the popd response
25                  len := UTL_TCP.read_line( socket, resp );
26
27                  if SUBSTR(resp,1,3) != POP3_OK then
28                          raise E_POP3_ERROR;
29                  end if;
30
31                  return( resp );
32          end;
33
34
35
36  begin
37          PIPE ROW( 'pop3:'||POP3_SERVER||' port:'||POP3_PORT );
38          -- open a socket connection to the POP3 server
39          socket := UTL_TCP.open_connection(
40                          remote_host => POP3_SERVER,
41                          remote_port => POP3_PORT,
42                          tx_timeout => POP3_TIMEOUT,
43                          charset     => 'US7ASCII'
44          );
45
46          -- read the server banner/response from the pop3 daemon
47          PIPE ROW( UTL_TCP.get_line(socket) );
48
49          -- authenticate with the POP3 server using the USER and PASS commands
50          PIPE ROW( 'USER '||userName ); PIPE ROW( WriteToPop('USER '||userName) );
51          PIPE ROW( 'PASS '||password ); PIPE ROW( WriteToPop('PASS '||password) );
52
53          -- retrieve the specific message
54          PIPE ROW( 'RETR '||msgNum ); PIPE ROW( WriteToPop('RETR '||msgNum) );
55          PIPE ROW( '*** START OF INTERNET MESSAGE BODY ***' );
56          loop
57                  bytes := UTL_TCP.Available( socket );
58                  if bytes > 0 then
59                          bytes := UTL_TCP.read_line( socket, line );
60                          PIPE ROW( line );
61                  end if;
62
63                  exit when bytes = 0;
64          end loop;
65          PIPE ROW( '*** END OF INTERNET MESSAGE BODY ***' );
66
67          -- close connection
68          PIPE ROW( 'QUIT' );     PIPE ROW( WriteToPop('QUIT') );
69
70          UTL_TCP.close_connection( socket );
71  end;
72  /
Function created.
SQL> show errors
No errors.
SQL>
SQL> select * from TABLE( pop3('billy','my-secret-password-goes-here',1) );
COLUMN_VALUE
pop3:127.0.0.1 port:110
+OK You are connected to a test Dovecot POP3 server
USER billy
+OK
PASS my-secret-password-goes-here
+OK Logged in.
RETR 1
+OK 548 octets
*** START OF INTERNET MESSAGE BODY ***
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Mon, 20 Aug 2007 09:23:38 +0200
Received: from localhost ([127.0.0.1])
        by localhost.com with smtp (Exim 4.63)
        (envelope-from <[email protected]>)
        id 1IN1bC-0001BC-9A
        for [email protected]; Mon, 20 Aug 2007 09:23:38 +0200
Subject: Test E-Mail
X-Mailer: telnet
Message-Id: <[email protected]>
From: [email protected]
Date: Mon, 20 Aug 2007 09:23:21 +0200
This is a test message.
Blah blah blah...
*** END OF INTERNET MESSAGE BODY ***
QUIT
+OK Logging out.
31 rows selected.
SQL>Note that the trailing period is the end-of-message-body marker and not really part of the message body that the sender created.
PS. Oh yes - I defined a timeout exception and tried catching that to determine the eof for the message body, but ran into what seems to be an Oracle bug. However, simply checking whether there is data to read, using the UTL_TCP.Available() function, works great.
Regards.
Satyaki De
N.B.: Credit goes to Billy.

Similar Messages

  • Problem with Pro*C reading BLOB field from Oracle 10g

    Hello Experts,
    We have a Pro*c application which is reading the BLOB data fields (a PNG image file) from Oracle data base. It holds the BLOB fields returned from the SQL query into a Unsigned Char structure in Pro*C. The program used work fine on AIX 32 – bit 4.3 and Oracle 8.1 environment.
    Recently, we have upgraded the environment to AIX 64-bit 5.3 and Oracle 10g.Since after the Pro*c program has problem in reading the Blob filed.
    Below is the query we are trying to execute –
    EXEC SQL
    SELECT
    signtre_image, image_file_name_ext
    INTO
    :msipLocalImage INDICATOR :msipLocalImage_i,
    :file_name_ext INDICATOR :file_name_ext_i
    FROM
    dcs_sign
    WHERE
    signtre_nbr = :signtre_nbr;
    Here signtre_image is the BLOB fields and msipLocalImage is a Pro*C structure define as below –
    typedef struct tagSignImage
    long len; /* Image length */
    unsigned char img[1]; /* Pointer to first byte. */
    } MOTS_SIGN_IMAGE;
    The quesry does not give any error or exception message in the Pro*C , program just stops at the point of executing the quesry..When we run the query commenting the BLOB filed it works fine. Also, the query runs good when we run it in the Oracle editor.
    There seems to be problem with the way we are reading the BLOB field in the new Oracle 10g enviromet.
    Does any body have any idea what’s wrong with this query? We really need it to work.
    Any Help will be greatly appreciated.
    Thanks,
    - Rajan Yadav

    Thanks a ton for your response.
    We made the necessary changes as suggested by you.This time we got another flavour of error - SQL Error Code - Inconsistent error while reading BLOB.
    Another thing we noticed is that the data field which we are trying to read is defined as LONG RAW instead of a BLOB in data base.
    Are these two things related in any sense or is there anything else which is causing the error.
    Once again Thanks for your help.
    - Rajan Yadav

  • How to read Image data from oracle DB?

    How to read a oracle database object ORDSYS.ORDImage from oracle
    database?
    I can get a oracle.sql.STRUCT object from the database, but i can not
    find the way to convert data to a image object(like oracle.ord.im.OrdImage)
    I had used "OrdImage imgObjj1 =
    (OrdImage)rs.getCustomDatum(1, OrdImage.getFactory());"
    it's a example from oralce.
    But OracleResultSet.getCustomDatum() method is already deprecated,
    i can't find a new method to instead of it.
    Who can help me ? Thank you!
    [email protected]

    More than likely, this is the interface you will use:
    java.sql.Blob
    http://java.sun.com/j2se/1.4/docs/api/java/sql/Blob.html
    Once you get the blob, construct a Raster objects from the Bytes you receive from the blob. Then you can create an Image, ImageIcon, BufferedImage, whatever with the Raster object.
    Good luck!

  • Error when reading BLOB field from Oracle usin Toplink

    We experience a very annoying problem when trying to read a BLOB
    field from Oracle 8.1.6.2.0 using TOPLink 3.6.3. I have attached the
    exception stack trace that is reported to the console. As far as I can
    judge a fault at oracle.sql.LobPlsqlUtil.plsql_length() happens first and
    then at TOPLink.Private.DatabaseAccess.DatabasePlatform.convertObject().
    The exception is permanently repeating that is very critical for us.
    ServerSession(929808)--Connection(5625701)--SELECT LOBBODY, ID, LABEL, FK_OBJECT_ID, FK_OBJECTTYPE FROM NOTE WHERE (ID = 80020)
    INTERNAL EXCEPTION STACK:
    java.lang.NullPointerException
    at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil.java:936)
    at oracle.sql.LobPlsqlUtil.plsql_length(LobPlsqlUtil.java:102)
    at oracle.jdbc.dbaccess.DBAccess.lobLength(DBAccess.java:709)
    at oracle.sql.LobDBAccessImpl.length(LobDBAccessImpl.java:58)
    at oracle.sql.BLOB.length(BLOB.java:71)
    at TOPLink.Private.Helper.ConversionManager.convertObjectToByteArray(ConversionManager.java:309)
    at TOPLink.Private.Helper.ConversionManager.convertObject(ConversionManager.java:166)
    at TOPLink.Private.DatabaseAccess.DatabasePlatform.convertObject(DatabasePlatform.java:594)
    at TOPLink.Public.Mappings.SerializedObjectMapping.getAttributeValue(SerializedObjectMapping.java:43)
    at TOPLink.Public.Mappings.DirectToFieldMapping.valueFromRow(DirectToFieldMapping.java:490)
    at TOPLink.Public.Mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:808)
    at TOPLink.Private.Descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:173)
    at TOPLink.Private.Descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:325)
    at TOPLink.Private.Descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:373)
    at TOPLink.Public.QueryFramework.ReadAllQuery.execute(ReadAllQuery.java:366)
    at TOPLink.Public.QueryFramework.DatabaseQuery.execute(DatabaseQuery.java:406)
    I have started the application with Oracle JDBC logging on and found that the problem may originate in a possible lack of syncronization in the pooled connection implementation:
    DRVR FUNC OracleConnection.isClosed() returned false
    DRVR OPER OracleConnection.close()
    DRVR FUNC OracleConnection.prepareCall(sql)
    DRVR DBG1 SQL: "begin ? := dbms_lob.getLength (?); end;"
    DRVR FUNC DBError.throwSqlException(errNum=73, obj=null)
    DRVR FUNC DBError.findMessage(errNum=73, obj=null)
    DRVR FUNC DBError.throwSqlException(reason="Logical handle no longer valid",
    SQLState=null, vendorCode=17073)
    DRVR OPER OracleConnection.close()
    so the prepareCall() is issued against an already closed connection and the
    call fails.
    I assume we have been using a JDBC 2.0 compliant driver. We tried out
    drivers that Oracle supplies for 8.1.6, 8.1.7 versions. To be true I
    couldn't find any information about the JDBC specification they conform to. Does it
    mean that these drivers may not be 100%-compatible with JDBC 2.0 Spec?
    How can I find out if they are 2.0 compliant?
    Also I have downloaded Oracle 9.2.0.1 JDBC drivers. This seemed to work
    fine until we found another incompatibility which made us return back to
    8.1.7 driver:
    UnitOfWork(7818028)--Connection(4434104)--INSERT INTO STATUSHISTORY (CHANGEDATE, FK_SET_STATUS_ID) VALUES ({ts '2002-10-17 16:46:54.529'}, 2)
    INTERNAL EXCEPTION STACK:
    java.sql.SQLException: ORA-00904: invalid column name
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.jav
    a:2047)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java
    :1940)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatemen
    t.java:2709)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepare
    dStatement.java:589)
    at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeDirectNoSelect(
    DatabaseAccessor.java:906)
    at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeNoSelect(Databa
    seAccessor.java:960)
    at TOPLink.Private.DatabaseAccess.DatabaseAccessor.executeCall(DatabaseAc
    cessor.java:819)
    at TOPLink.Public.PublicInterface.UnitOfWork.executeCall(UnitOfWork.java:

    Hello Yury,
    I believe the problem is that TopLink's ServerSession by default executes read queries concurrently on the same connection. It does this to reduce the number of required connections for the read connection pool. Normally this is a good concurrency optimization, however some JDBC drivers have issues when this is done. I had thought that with Oracle JDBC 8.1.7 this issue no longer occurred, but perhaps it is only after version 9. I believe that the errors were only with the thin JDBC driver, not the OCI, so using the OCI driver should also resolve the problem. Using RAW instead of BLOB would also work.
    You can configure TopLink to resolve this problem through using exclusive read connection pooling.
    Example:
    serverSession.useExclusiveReadConnectionPool(int minNumerOfConnections, int maxNumerOfConnections);
    This will ensure that TopLink does not to try to concurrently execute read queries on the same connection.
    I'm not exactly sure what your second problem with the 9.x JDBC drivers is. From the SQL and stack trace it would seem that the driver does not like the JDBC timestamp syntax. You can have TopLink print timestamp in Oracle's native SQL format to resolve this problem.
    Example:
    serverSessoin.getLogin().useNativeSQL();
    Make sure you configure your server session before you login, or if using the TopLink Session Manager perform the customizations through a SessionEventListener-preLogin event.

  • How to remove on-premise Exchange mailbox from forwaring to hosted mailbox

    We moved an on-premise Exchange 2007 mailbox to Microsoft Office 365 hosted Exchange.  We have since removed the mailbox from the hosted Exchange but when we send emails to the address now, they get sent to the hosted Exchange mailbox.

    Hi,
    Since the issue is related to Office 365 hosted Exchange instead of the Office 365 ProPlus which is the version of Office that comes with many Office 365 plans. I recommend we can ask a question in Microsoft Exchange Online forum for more professional
    suggestion:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=onlineservicesexchange
    Thanks,
    Winnie Liang
    TechNet Community Support

  • Read IMAP server from Oracle PL/SQL

    Hi,
    Is it possible to read emails (either through IMAP) and save those email (with attachments) into oracle tables through pl/sql?
    I have a requirement of reading mailbox every 1 min and save new mails into database.
    My Environment: Database 10g.

    This may help you.
    Re: Retrieve emails from IMAP server
    http://plsqlmailclient.sourceforge.net/

  • Read japanese char from oracle

    I have a database column stores japanese char in Shift-JIS encoding. A
    perl script can read the database and display the result on browser.
    But If i try the get the japanese string in Java using JDBC. I got an
    exception:
    String text = resultset.getString(1);
    Exception in main(): java.sql.SQLException: Fail to convert between
    UTF8 and UCS2: failUTF8Conv
    I wonder why I getting this exception and how to fix this?
    thanks

    Hi
    We had faced the same problem.
    Problem was with oracle jdbc thin driver.
    We change the driver from THIN to OCI that works fine.
    Try this option and pls let me know.
    Regards,
    Aslam A.S

  • Reading XML Files from oracle 9i or in Oracle 10g

    Hi all,
    Can any body suggest how to write a stored procedure to read XML file content and insert into a table.
    Thanking you in Advance

    I know I am blasphemous, but ....
    We had a similar requirement: one file, each line was a "simple" xml doc corresponding to one db table record. The keyword here is "simple". We looked at the xml stuff, but decided that the easiest, best runtime performance, most extensible, easiest to maintain was:
    use (sed|awk|perl) to convert xml to a flat file of fields, and then load the file with SQL*Loader. After all, loading flat files with many records is a job for SQL*Loader.
    caveat: the xml in question was very simple and the same for all records:
    timestamp|<log><id>1</id><ns>ns1</ns><prod/><cmd>order</cmd><result>ok</result><time>1813></time></log>
    "your milage may vary"
    -tom

  • Error While reading CLOB from Oracle using WebLogic Connection Pool, Works fine with out using pool

    PROBLEM DESCRIPTION :
         When I try to read a clob from Oracle, I receive "ORA-03120: two-task
    conversion routine: integer overflow" Error.
         This error occurs only for CLOB Type and only if I try to connect to
    Oracle using WebLogic JDriver/Oracle POOL.
         IMPORTANT NOTE: I can read CLOB or any other data using direct JDBC
    connection to ORacle with out any problem.
         Below Please find the JAVA CODE for Both Working and NON Working .
    Created a Connection Pool as:
    Name: MyJDBCConnectionPool
    URL : jdbc:weblogic:oracle
    DIRVER:weblogic.jdbc.oci.Driver
    NON WORKING JAVA CODE (USES WEBLOGIC JDBC CONNECTION POOL TO ORACLE):
    Driver myDriver =
    (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    Connection mconn =
    myDriver.connect("jdbc:weblogic:pool:MyJDBCConnectionPool",null);
    mconn.setAutoCommit (false);
    CallableStatement cs = mconn.prepareCall("{call
    P_XMLTEST2(?)}"); //This returns a CLOB
    cs.registerOutParameter(1,java.sql.Types.CLOB);
    cs.execute();
    Clob clob = null;
    clob = cs.getClob(1);
    String data =new String();
    data = clob.getSubString(1, (int)clob.length());
    System.out.println(data); //print the data
    data = null;
    clob=null;
    cs.close();
    WORKING JAVA CODE (USES DIRECT THIN JDBC CONNECTION TO ORACLE):
    Driver myDriver =
    (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    Connection mconn =
    myDriver.connect("jdbc:oracle:thin:@server:1521:DB",null);
    mconn.setAutoCommit (false);
    CallableStatement cs = mconn.prepareCall("{call
    P_XMLTEST2(?)}"); //This returns a CLOB
    cs.registerOutParameter(1,java.sql.Types.CLOB);
    cs.execute();
    Clob clob = null;
    clob = cs.getClob(1);
    String data =new String();
    data = clob.getSubString(1, (int)clob.length());
    System.out.println(data); //print the data
    data = null;
    clob=null;
    cs.close();
    ERROR MESSAGE:
         ORA-03120: two-task conversion routine: integer overflow
    I appreciate your help on this problem.

    PROBLEM DESCRIPTION :
         When I try to read a clob from Oracle, I receive "ORA-03120: two-task
    conversion routine: integer overflow" Error.
         This error occurs only for CLOB Type and only if I try to connect to
    Oracle using WebLogic JDriver/Oracle POOL.
         IMPORTANT NOTE: I can read CLOB or any other data using direct JDBC
    connection to ORacle with out any problem.
         Below Please find the JAVA CODE for Both Working and NON Working .
    Created a Connection Pool as:
    Name: MyJDBCConnectionPool
    URL : jdbc:weblogic:oracle
    DIRVER:weblogic.jdbc.oci.Driver
    NON WORKING JAVA CODE (USES WEBLOGIC JDBC CONNECTION POOL TO ORACLE):
    Driver myDriver =
    (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    Connection mconn =
    myDriver.connect("jdbc:weblogic:pool:MyJDBCConnectionPool",null);
    mconn.setAutoCommit (false);
    CallableStatement cs = mconn.prepareCall("{call
    P_XMLTEST2(?)}"); //This returns a CLOB
    cs.registerOutParameter(1,java.sql.Types.CLOB);
    cs.execute();
    Clob clob = null;
    clob = cs.getClob(1);
    String data =new String();
    data = clob.getSubString(1, (int)clob.length());
    System.out.println(data); //print the data
    data = null;
    clob=null;
    cs.close();
    WORKING JAVA CODE (USES DIRECT THIN JDBC CONNECTION TO ORACLE):
    Driver myDriver =
    (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    Connection mconn =
    myDriver.connect("jdbc:oracle:thin:@server:1521:DB",null);
    mconn.setAutoCommit (false);
    CallableStatement cs = mconn.prepareCall("{call
    P_XMLTEST2(?)}"); //This returns a CLOB
    cs.registerOutParameter(1,java.sql.Types.CLOB);
    cs.execute();
    Clob clob = null;
    clob = cs.getClob(1);
    String data =new String();
    data = clob.getSubString(1, (int)clob.length());
    System.out.println(data); //print the data
    data = null;
    clob=null;
    cs.close();
    ERROR MESSAGE:
         ORA-03120: two-task conversion routine: integer overflow
    I appreciate your help on this problem.

  • Read from Oracle DB and Write to MySQL

    Hi All,
    I am fairly new to database administration, so please bear with me if this is something that is simple or not achievable at all -
    SetUp:
    I have an Oracle DB on one dedicated Server, to which I only have a read_only access.
    I have a MySQL database setup on a windows server 2008, both are on the company network and accessible to internal employees only.
    Problem Statement:
    I need to read certain tables from Oracle DB and push the records to MySQL database.
    I have a stored procedure which was doing this but from one Oracle Schema to another, which is running fine, now I need to use the same stored procedure but read from one database (Oracle) and write to another database (MySQL), is there a way to do this through the stored procedure, I know I can write a java program to do this, but need to do it through a stored procedure.
    Appreciate any help in this regards.

    c5b4a91d-d35a-43ba-ac96-6d1821541d33 wrote:
    Hi All,
    I am fairly new to database administration, so please bear with me if this is something that is simple or not achievable at all -
    SetUp:
    I have an Oracle DB on one dedicated Server, to which I only have a read_only access.
    I have a MySQL database setup on a windows server 2008, both are on the company network and accessible to internal employees only.
    Problem Statement:
    I need to read certain tables from Oracle DB and push the records to MySQL database.
    I have a stored procedure which was doing this but from one Oracle Schema to another, which is running fine, now I need to use the same stored procedure but read from one database (Oracle) and write to another database (MySQL), is there a way to do this through the stored procedure, I know I can write a java program to do this, but need to do it through a stored procedure.
    Appreciate any help in this regards.
    Start here:  http://docs.oracle.com/cd/E11882_01/server.112/e25494/ds_concepts.htm#i1007709

  • Disconnecting Exchange Mailbox Using AD Adapter

    Has anyone disconnected Exchange Mailbox from the user using the AD adapter? We would like to understand what Sun's official stance is in doing this.
    Could we disconnect by simply setting the following attributes to NULL or ""?
    1. homeMTA
    2. homeMDB
    3. msExchangeHomerServerName
    We do not wish to delete an Exchange Mailbox, simply disconnect (equivalent to disable of mailbox)
    Thank you

    If you have one group doing all mailbox creation, you won't get automatic creation to rely on user location.  We use a script for creating mailboxes on the next logical server.  You could do the same thing, but with logic that took into consideration
    the user location.

  • Read Tif Image from Database Display in Windows Fax Viewer

    Code for reading a BLOB from Oracle which is a TIF image and displaying it in Windows Picture and Fax Viewer. Gives the ability to display with perfect resolution, Zoom In & Out, Rotate and Print.
    I m storing the image on my C drive, you can store where ever you want.
    package com.test.examples;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import oracle.sql.BLOB;
    public class Test {
         * Main method for calling the View Tif Image method.
         * @param args
         public static void main(String[] args) {
              String id = "123";
              Test test = new Test();
              test.viewTifImage(id);
         * Method for viewing TIF Image
         public void viewTifImage(final String id) {
              BLOB blob = null;
              FileOutputStream outStream = null;
              InputStream inStream = null;
              final String filename = "C:\\Images\\image.tif";
              if (Helper.stringNotNullAndEmpty(id)) {
                   try {
                        imageDAO = new ImageDAO();
                        blob = imageDAO.getImageBLOB(id);
                        File blobFile = new File(filename);
                        outStream = new FileOutputStream(blobFile);
                        inStream = blob.getBinaryStream();
                        int length = -1;
                        int size = new Long(blob.length()).intValue();
                        byte[] buffer = new byte[size];
                        while ((length = inStream.read(buffer)) != -1) {
                             outStream.write(buffer, 0, length);
                             outStream.flush();
                        showTiff(filename);
                        inStream.close();
                        outStream.close();
                   } catch (IOException ioe) {
                        System.out.println("Exception in IO block.");
                        ioe.printStackTrace();
                        try {
                             inStream.close();
                             outStream.close();
                        } catch (IOException ioe1) {
                             ioe1.printStackTrace();
                   }catch (DAOException daoe) {
                        System.out.println("Exception while getting the BLOB");
                        daoe.printStackTrace();
                   } catch (Exception ex) {
                        System.out.println("ERROR(djv_exportBlob) Unable to export:"
                                  + filename);
                        ex.printStackTrace();
                   } finally {
                        try {
                             inStream.close();
                             outStream.close();
                        } catch (IOException e) {
                             System.out.println("Exception in IO block.");
                             e.printStackTrace();
         public static boolean showTiff(String fileName) throws IOException {
              String progDir = System.getenv().get("SystemRoot");
              System.out.println("SYSTEM ROOT DIRECTORY" + progDir);
              // turn the backslash around to a forward slash
              int x = progDir.indexOf('\\');
              String front = progDir.substring(0, x);
              String back = progDir.substring(x + 1);
              progDir = front + "/" + back;
              String osCmd = progDir + "/system32/rundll32.exe " + progDir
                        + "/system32/shimgvw.dll,ImageView_Fullscreen " + fileName;
              try {
                   System.out.println("command is " + osCmd);
                   Runtime rt = Runtime.getRuntime();
                   Process ps = rt.exec(osCmd);
              } catch (IOException ie) {
                   System.out.println("error running fax viewer");
                   return false;
              return true;
    Let me know if you find some thing wrong in here.
    Thanks
    raffu

    REad all the file paths from DB in e.g. List<String>. Define javax.swing.Timer.
    How to use timer read here
    http://leepoint.net/notes-java/other/10time/20timer.html
    or
    http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html
    When the timer's actionPerformed happens use next index in the array to get next filePath and show your image. When end of list is achieved just stop the timer (or startd from the beginning of the list again).

  • How to access environment variables from Oracle Forms

    Hi,
    Any idea how to use the Environment variables from Oracle Forms.
    My basic problem is that from Oracle form I am calling Batch file which calls excel file with a macro.
    So i want to check whether the macro was successful or not.
    So in my batch file i will set %errorlevel% which I should be able to read from Oracle Forms.
    I am able to read the registry from oracle forms, so is there anyway to read environment variable as well?
    Thanks!
    Avinash.

    Hello,
    Use the TOOL_ENV.Getvar() built-in
    Francois

  • Move Mailbox from Exchange 2007 to 2013 creates additional Contacts and Junk E-mail folders in Outlook Clients

    I have moved a handful of mailboxes from my Exchange 2007 server to my new Exchange 2013 server.  When the users logon to Outlook, usually Outlook 2007 Pro, they have a new default Contacts folder and Junk Email folder that are empty.  I
    have to copy all the user's contacts into the new default folder and delete the old one.  Not sure why this is happening.  Any information would be appreciated.  Thanks.

    Are you sure your Outlook 2007 is compatible with Exchange 2013?
    http://technet.microsoft.com/en-us/library/aa996719(v=exchg.150).aspx
    http://support.microsoft.com/default.aspx?kbid=2687404
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Cannot move more than 2 mailboxes from exchange 2007 to Exchange 2013

    I have been trying to move mailboxes from ex2007 to ex2013with the new-migrationbatch and the new-moverequest command.
    I have a DAG-cluster with two servers with all roles.
    What happens is that I cannot get more than two concurrent mailbox moves.  If I restart the MRS-service nothing happens. I have changed the config-file for the mailbox replication service and currently have these settings:
    MaxMoveHistoryLength="5"
    MaxActiveMovesPerSourceMDB="20"
    MaxActiveMovesPerTargetMDB="20"
    MaxActiveMovesPerSourceServer="100"
    MaxActiveMovesPerTargetServer="100"
    MaxTotalRequestsPerMRS="100"
    What is funny is that when I start a new batch with autocomplete off, only two mailboxes goes to 95% and the rest of them is not even started. 
    The command I use is  New-Migrationbatch -local -Name TestNew -csvdata ([System.IO.File]::ReadAllBytes("c:\temp\exchange\migration\testmigration.txt")) -targetdatabases mdb001,mdb002 -autostart
    Here is the output of Get-MigrationConfig | fl
    RunspaceId : d382f8a7-924a-4f0e-812e-f18970b632e2
    Identity :
    MaxNumberOfBatches : 100
    MaxConcurrentMigrations : Unlimited
    Features : MultiBatch
    CanSubmitNewBatch : True
    SupportsCutover : False
    I have off course restarted both servers and services.

    Just out of curiosity, on which server you made these changes? Mailbox or CAS? And on Target or Source Server? 
    Cheers,
    Gulab Prasad
    Technology Consultant
    Blog:
    http://www.exchangeranger.com    Twitter:
      LinkedIn:
       Check out CodeTwo’s tools for Exchange admins
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Maybe you are looking for

  • Issue connecting HP Laserjet.

    I have an iMac with OS X 10.7.5 and am trying to reinstall an HP printer driver I have been using for years.  I am at a complete loss, as the computer does not seem to be able to recognize the printer.  I am connected wirelessly.  Please help!!

  • The same file with the same name need to call two RFC's with the sequence

    i have to pick up the same file with the same name  and call the two RFC in sequence scenario.i have xxx.txt file.file should be proces first calling the first rfc . I created two different communication channels for the first sender file communicati

  • Listening to music on the iPad

    I get that this will seem like an utterly ridiculous question but how the heck do I listen to the music on my iPad? From my iTunes app on my computer, it appears that I have all my music sync's with the iPad but I guess I have a low IQ because I can'

  • Notification Mailer - Restricting emails

    We are building a custom workflow to report project budgets vs actuals. Whenever we start the Notification Mailer program it is sending out mail to all the PO users also. These relate to PO related notifications which are currently handled by the use

  • Small problem

    I am very new to java, and having a small problem: When i click on a button, i want the buttons name to be displayed in a text field, saying "You have pressed" then the name of the button. but i want to do this with multiple buttons and not just one