09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

this.empNo = empNo;<br />

}<br />

////// implements SQLData //////<br />

public String getSQLTypeName() throws SQLException<br />

{ return sql_type;<br />

}<br />

public void readSQL(SQLInput stream, String typeName)<br />

throws SQLException<br />

{<br />

sql_type = typeName;<br />

empName = stream.readString();<br />

empNo = stream.readInt();<br />

}<br />

public void writeSQL(SQLOutput stream)<br />

throws SQLException<br />

{<br />

stream.writeString(empName);<br />

stream.writeInt(empNo);<br />

}<br />

public String toString()<br />

{<br />

String ret_str = ““;<br />

ret_str += “[Employee]\n”;<br />

ret_str += “Name: “ + empName + “\n”;<br />

ret_str += “Number: “ + empNo + “\n”;<br />

return ret_str;<br />

}<br />

}<br />

c. Create the queue table and queue with ADT payload<br />

public static void createEmployeeObjQueue(AQSession aq_sess)<br />

throws AQException<br />

{<br />

AQQueueTableProperty qt_prop = null;<br />

AQQueueProperty q_prop = null;<br />

AQQueueTable q_table = null;<br />

AQQueue queue = null;<br />

/* Message payload type is aquser.EMPLOYEE */<br />

qt_prop = new AQQueueTableProperty(“AQUSER.EMPLOYEE”);<br />

Enqueuing and Dequeuing Of Messages<br />

<strong>Oracle</strong> <strong>Advanced</strong> <strong>Queuing</strong> by Example A-19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!