How to dequeue Oracle queue(enqueue in Ora) in java using JMS text message

I'm trying below java code but its giving me error:
public class testq {
public static void main(String[] args) throws Exception {
testq q = new testq();
AQSession aq_sess = createSession();
q.runTest(aq_sess);
public static AQSession createSession() {
Connection db_conn;
AQSession aq_sess = null;
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
/* Load the Oracle8i AQ driver: */
Class.forName("oracle.AQ.AQOracleDriver");
db_conn = DriverManager.getConnection("jdbc:oracle:thin:@10.10.10.10:1521:demo", "demo_app", "demo");
System.out.println("JDBC Connection opened ");
db_conn.setAutoCommit(false);
/* Creating an AQ Session: */
aq_sess = AQDriverManager.createAQSession(db_conn);
System.out.println("Successfully created AQSession ");
catch (Exception ex) {
System.out.println("Exception: " + ex);
ex.printStackTrace();
return aq_sess;
public void runTest(AQSession aq_sess) {
//AQQueueTable q_table;
AQQueue queue;
AQMessage message;
AQRawPayload raw_payload;
AQDequeueOption deq_option;
byte[] b_array;
Connection db_conn;
try {
db_conn = ((AQOracleSession)aq_sess).getDBConnection();
/* Get a handle to a queue - aq_queue4 in aquser schema: */
queue = aq_sess.getQueue ("myadmin", "STREAM_QUEUE_DEMO");
System.out.println("Successful getQueue");
/* Creating a AQDequeueOption object with default options: */
deq_option = new AQDequeueOption();
deq_option.setDequeueMode(AQDequeueOption.DEQUEUE_REMOVE);
/* Set wait time to 10 seconds: */
deq_option.setWaitTime(10);
/* Dequeue a message: */
message = queue.dequeue(deq_option);
System.out.println("Successful dequeue");
/* Retrieve raw data from the message: */
raw_payload = message.getRawPayload();
b_array = raw_payload.getBytes();
db_conn.commit();
String value = new String(b_array);
System.out.println("queue="+value);
} catch(Exception e) {
e.printStackTrace();
The error says "oracle.AQ.AQException: JMS-174: Class must be specified for queues with object payloads
Use dequeue(deq_option, payload_fact) or dequeue(deq_option, sql_data_cl)"
Can any one tell me how to fix this error & how to get bulk dequeue messages?
And i am using sys.AQ$_JMS_TEXT_MESSAGE payload type during enqueue.
Can any one tell me how to fix this Java program to dequeue it?
Thanks in advance...Please its urgent
Thanks!

the code is as bellow
File fBlob = new File ("test.pdf");
FileInputStream fIS = new FileInputStream(fBlob);
pstUpdate= con.prepareStatement("UPDATE table set file = ? where id = ?");
pstUpdate.setBinaryStream(1, fIS, (int) fBlob.length());
pstUpdate.setString(2, rs.getString("id"));
pstUpdate.execute();
con.commit();

Similar Messages

  • How to run oracle forms in ipdad or smart mobile using OS android

    please help me
    how to run oracle forms in ipad or smart mobile using OS( android )and connect to application server 10g?????
    Thanks

    If you had looked at data dashboard and some of the other links on Android, you would see that you cannot run a LabVIEW app on Android. Nor can you use a serial port. With Data Dashboard, you have a pc running LabVIEW and it publishes to network shared variables. Data Dashboard on the Android allows you to view those variables.

  • How can i get copied to my 14 year-old daughter's text messages without her knowledge?

    how can i get copied to my 14 year-old daughter's text messages without her knowledge?

    Unless the cell carrier would provide such a service, which if they do would only be available to you if you are the owner of her cell account, then it's not possible without hacking the iPhone, something we cannot discuss here. And if she has the account in her name, then as SeaBeast suggested such hacking may well be illegal. Even 14-year-olds have privacy rights. You would have to discuss that with a lawyer, though.
    Regards.

  • Oracle Queue - Enqueuing Error

    When I try to enqueue the 5000 rows of data through C++ object to Oracle Queue, Im getting the following error message after enqueuing around 3000 data.
    "Enqueue error in AQ object, OIP-04997: Error creating AQMsg object"
    The Failure error level is not exactly 3000 data, some time 1789th data or 4560th data....
    null

    As far as I understand, "oracle.install.db.DBA_GROUP" should be set to "dba". You actually do not need to use the "oinstall" group and can set it to "dba" too, unless you have a different support staff, one doing the Oracle installation, and another administration.

  • How do i save a picture to the camera roll from a text message in ios 7

    I am attempting to save a picture from a text message to my camera roll. However when i hold the picture the options are "copy/More" More gives the options to delete or forward via text message. And if i press copy it only copies it to be pasted. In the past i was given several options to send the pic via email/text/save to camera roll/drop box etc.
    Please advise as to how i can save pictures from my text to the camera roll.
    Thank you!

    If you receive a picture via email or text message in ios 7 and when you press the action icon to save the picture and you do not get the option to save to your camera roll. Press and hold on the the image and you will get an overlay pop up to save the image. I have no idea why some attachments don't have option in action menu to save in the camera roll but by experimentation and earned frustration I found the above to work in certain situations.
    Be well and have fun and feel rewarded in your frustrations. For without challenges, life would be an utter bore.

  • How do I disable my Apple ID as my display name for text messages?

    I recently purchased the Macbook Pro with retina display and now when I send text messages from my phone or computer it displays my Apple ID instead of my name to the recipient. I have tried changing the settings with iMessage on my macbook but it won't go away. How can I disable this feature?

    you will need to login to
    https://supportprofile.apple.com/
    and deregister yourself from imessage

  • How do I save a single pic to my gallery from a text message

    I am able to save pics from a text message if there are multi pics; However, if there is only a single pic sent to me, I can't figure out how to save it to my gallery. Please help.

    Have you tried to long press the photo attachment to get a menu option to save the attachment?

  • How do you add downloaded smileys to the emoticon page in the text message

    Hi:
    I just got a Blackberry Q5 and am still figuring out how to use it. I get how to access the smileys in the emoticon menu of the text message, but I downloaded some new smileys and was wondering if there's an easy way to load them up, instead of existing the text message, loading the downloaded smileys, copying and pasting them, and then returning to the menu. It seems like a lot of effort. Like, what's the point of downloading smiley's if it's this hard to use them.
    Does anyone know how? Thanks.
    Moogle87

    You can set the destination of downloads in your browser's preferences.  For example, in Safari, on the menubar,  Safari > General tab > Save downloaded files to:
    Direct them to a folder (like the downloads folder) and then put a shortcut on the dock.
    Regards,
    Captfred

  • How do I save all mp3 files as an attachable file in text messaging on a G'z One Commando? Some mp3 save as these types of files but I don't how or what I do differently.

    How do I save all mp3 files as an attachable audio file in text messaging on a G'z One Commando? Some mp3 save as these types of files but I don't how or what I do differently.

    In summary, it sounds to me as though the Mac concept of "hidden extension per file" isn't embraced at all by Photoshop.
    So assuming the extension is always visible, what is the easiest way do each of the following (ignoring issues with integration with other apps):
    1.  Save a JPEG as:  abc.jpg
    2.  Save a JPEG as:  abc
    3.  Save a JPEG as:  abc.
    4.  Save a JPEG as:  abc.xxx
    Since it seems to me we still haven't nailed down whether there's a disparity between how this works on Photoshop for Mac vs. PC, I'll answer the above questions for PC:
    1.  File - Save As, choose Format: JPEG, type (replace filename with):  abc
    2.  No difference than 3 on a PC.
    3.  File - Save As, choose Format: JPEG, type:  abc.
    4.  File - Save As, choose Format: JPEG, type:  abc.xxx
    How is it different from the above on a Mac?
    Is there something more complex, such as the sequence of operations, or another system setting, that I didn't cover here?  I normally always keep Explorer set so that file extensions are visible (it's global on a PC).
    -Noel

  • How can I save a video locally on my phone from a text message or email with ios7

    Having some trouble figuring out how to save a video to my camera roll with new operating system. I've tried from both an email and text message. Please help

    Touch video in message to show the play screen.  Select the send icon (square with arrow) at bottom left. Select "Save Video"

  • How do you get siri to display ? mark when sending a text message?

    When I send a text message using Siri how do I get it to put in the correct punctuation? If I want to ask a question it bugs me there is no question mark.

    You actually have to say "question mark" at the end (you can also say period, comma, etc)

  • How can someone else with a different computer retrieve all my past text messages?

    How can someone retrieve my text messages whitha different computer, as far back as 6 months ago. Someone is reading all my past text

    Yeah no kidding.
    I have a big paid up MobileMe account with tons of gallery stuff - this will all go away for me in July, and I'll miss it - it took no learning to use, and it was built into everything - just intuitive to post to a gallery password protect it, and send a link to a friend.  Click click done!
    It bothers me a lot when features I really enjoy and use are pulled in these half baked new apps and services.
    iMovie used to be quite good, but the new one is very restrictive - it's a step backwards in some ways.
    MobileMe was fine, but iCloud takes away the Gallery???? - another step backward.
    We use some iPhones at work for shooting some videos and technical engineering photo's, and while it's pretty cool that the iPhone photo's get put on the photostream of "Jason's iMac", I don't have instant access, and I would really like to be able to do that. If it could be done, then I can stay at home and work sometimes and I can get the photo's automagically.  
    Apple - please fix this.

  • How to plugin oracle 10g express edition in Eclipse Java EE

    Hi guys,
    I have downloaded Eclipse Java EE and also downloaded Oracle 10g express edition. Please some one guide me how do I plugin the database in Eclipse and use DTP in Eclipse. I am new to Oracle and Java, Please help me.
    Thanks

    Hi,
    I have installed OEPE through Eclipse Update Manager for Eclipse Galileo 3.5. I have already installed oracle10g express edition and Appache tomcat 6.0 for web development.
    Now I have unlocked the hr user and following instruction from white paper to use OEPE
    http://www.oracle.com/technology/pub/articles/cioroianu-eclipse-jpa.html
    Now you can configure the database connection in Eclipse. Click Window > Show View > Other..., select Data Management > Data Source Explorer, and click OK. Right click Database Connections, click New, select Oracle Database Connection, enter the hr name for the connection, and click Next.
    Select Oracle Database 10g Driver Default, change the server name in the jdbc:oracle:thin:@localhost:1521:xe URL if necessary, enter the hr user name and its password, click Test Connection to verify that everything is correct, and click Finish
    But here when I tried to connect to the database, it give me error - Creating connection to New oracle database connection has encountered a problem
    Couldn't connect to New Oracle Database Connection.
    Error creating SQL Model Connection connection to New Oracle Database Connection.(Error: IO exception: The Network Adapter could not establish the connection)
    Io exception: The Network Adapter could not establish the connection
    Error creating SQL Model Connection connection to New Oracle Database Connection.(Error: IO exception: The Network Adapter could not establish the connection)
    Io exception: The Network Adapter could not establish the connection
    I know i am wrong some where, Please tell me where I am going wrong? Do I need to download and configure weblogic 10g first? Is this don't work with Apache tomcat server instead?
    Thanks
    Edited by: Jay Virk on 02-Oct-2009 04:36

  • How to Install Oracle 11i/E-Business Suite in Windows using cygwin

    Hi,
    if
    You are going to use oracle EBS for learning oracle provide the free of license
    you must install Oracle Apps with Vision Database
    its absolutely free for learners
    for further details read this blog
    http://gpganapathy.blogspot.com
    Find article related with Oracle 11i installation in windows XP
    All rights reserved by only oracle corporation if you have any doubts related to license issues Contact oracle Corporation Directly

    Hi;
    Please check Hussein Sawwan greatest previous post about same topic
    Oracle EBS 11.5.10.2 Installation Steps
    Oracle EBS 11.5.10.2 Installation Steps
    Regard
    Helios

  • How to Test, Inbound idoc ,with out the Sender System, using a Text File

    Hi Guru's .
    we wanted to test BLAORD03 inbound idoc (Message Type BLAORD).with out the SENDER SYSTEM.
    on the same client.
    we wanted to test this idoc with text file from our local machine.
    Can anyone give us detail steps.like how to create  File layout
    with Segment name,and values for the fields.how to pass this file to the system.
    Thanks in advance.

    Hi Aparna.
    My requirement is to test the idoc with Inbound File.
    Generate a file with the data entered through segments through we19 ,and use the same file for processing through we16.
    when i am trying to do this syst complaing about
    Partner Profile not available, and some times
    port not available. and some  times with
    'No further processing defined'.
    but i maintained part profiles and port perfectly.
    Can you help me in testing with test 'File' port.

Maybe you are looking for

  • Spending hours trying to turn on an Arpeggio?

    Ok seriously. What gives here? I have been trying for a few hours to get the arpeggiators in Logic's environment window to work and am about to gouge my eyes out with a usb dongle. The Logic manual entry on using the arpeggio is a joke. It only says

  • When I connect my shuffle to ITunes, the SOURCE category doesn't show up!

    HELP! My shuffle (bought it off of ebay two weeks ago) has been working fine. But today I ran into a problem. I plug it into Itunes, and no SOURCE category shows up. I can't even get the computer to recognize the device. Please make your response as

  • I HAVE IMAC 27 INCH MY MOUSE RIGHT CLICK IS NOT WORKING PROPERLY .ANY ONE HAVE HIS PROBLEM

    I HAVE IMAC 27 INCH MY MOUSE RIGHT CLICK IS NOT WORKING PROPERLY .ANY ONE HAVE THIS PROBLEM

  • ADDRESS BOOK PROBLEMS

    CAN YOU HELP?? i have recently tried to set up my new device, using the contacts from my old sim card from my old Nokia. i think i succeeded in transferring all of my contacts over as they appear nicely in my address book, but when i receive a call f

  • Blank DVDs not recognized

    I am having issues after attempting to build a regular dvd. It keeps saying Please insert DVD media, close the tray, and click OK. I know this has been discussed in previous threads, but I have had no luck trying those solutions. The other DVD applic