Examples of use

Test Google Connection

-- Test connection
select dbms_xmpp.test_gtalk('YOUR_GOOGLE_LOGIN', -- Your Google Login
	'YOUR_GOOGLE_PASSWORD') -- Your Google password
as GOOGLE_RC -- The return code
from dual;
					

You should get this kind of output :

 GOOGLE_RC
----------
         0

Send a google message

--Send a google message
select dbms_xmpp.send_gtalk_plain_text_message('YOUR_GOOGLE_LOGIN',-- your google login
	'YOUR_GOOGLE_PASSWORD',-- your google password
	'Adrien.Sales@gmail.com', -- the recipient(s) of your message (for many recipients, put ; between contacts)
	'test',-- Message subjects
	'hello gtalk from Oracle !') as GOOGLE_RC-- the message itself
from dual;
					

You should get this kind of output :

 GOOGLE_RC
----------
         0

Send a google message to a list of recipients

--Send a google message
select dbms_xmpp.send_gtalk_plain_text_message('YOUR_GOOGLE_LOGIN',-- your google login
	'YOUR_GOOGLE_PASSWORD',-- your google password
	'Adrien.Sales@gmail.com;toto@gmail.com', -- the recipient(s) of your message (for many recipients, put ; between contacts)
	'test',-- Message subjects
	'hello gtalk from Oracle !') as GOOGLE_RC-- the message itself
from dual;
					

Get Google Rosters (ie. contacts) in xmltype

set pagesize 10000
set long 1000000
select dbms_xmpp.get_gtalk_rosters_xmltype('YOUR_GOOGLE_LOGIN', -- Your Google Login
	'YOUR_GOOGLE_PASSWORD') -- Your Google Password
	as xml_rosters
from dual;
					

You should get this kind of output :

<xmpp_rosters>
<xmpp_host>talk.google.com</xmpp_host>
<xmpp_port>5222</xmpp_port>
<xmpp_service>gmail.com</xmpp_service>
<xmpp_login>Adrien.Sales</xmpp_login>
<return_code>0</return_code>
<return_message>XMPP_SUCCESS</return_message>
<rosters>
<roster>
<name>John Doe</name>
<user>John.Doe@gmail.com</user>
both
<status>ITEM_STATUS_NULL</status>
</roster>
<nb_rosters>1</nb_rosters>
</rosters>
</xmpp_rosters>

Get Google Rosters : get contact list in table format

-- get GTalk rosters  : get contact list in table format
col  ID for 99
col ROSTER_NAME for a30
col ROSTER_USER for a30
col ROSTER_TYPE for a5
col ROSTER_STATUS for a30
set linesize 135
select ID as "Id",
	ROSTER_NAME as "Name",
	ROSTER_USER as "User", 
	ROSTER_TYPE as "Type",
	ROSTER_STATUS as "Status"
from table(dbms_xmpp.gtalk_rosters_table('YOUR_GOOGLE_LOGIN', 
	'YOUR_GOOGLE_PASSWORD'));
					

You should be able to get this kind of output :

 Id Name                           User                           Type
--- ------------------------------ ------------------------------ ----
  1 John@gmail                   John.Doe@gmail.com        			both

Test XMPP Connection

-- Test connection
select dbms_xmpp.test_connection('talk.google.com',
	5222,
	'gmail.com',
	'YOUR_GOOGLE_LOGIN',
	'YOUR_GOOGLE_PASSWORD') xmpp_return_code from dual;
					

Get XMPP Rosters in xml format

select dbms_xmpp.get_rosters_xmltype('talk.google.com',
	5222,
	'gmail.com',
	'YOUR_GOOGLE_LOGIN',
	'YOUR_GOOGLE_PASSWORD') from dual;
					

Send XMPP Message

-- send to xmpp to multiple recipients
select dbms_xmpp.send_plain_text_message('talk.google.com',
	5222,
	'gmail.com',
	'YOUR_GOOGLE_LOGIN',
	'YOUR_GOOGLE_PASSWORD',
	'Adrien.Sales@gmail.com',
	'Dummy subject',
	'Hello from Oracle') xmpp_return_code
from dual;
					

Get XMPP Rosters in table format

- get XMPP rosters
col  ID for 99
col ROSTER_NAME for a30
col ROSTER_USER for a30
col ROSTER_TYPE for a5
col ROSTER_STATUS for a30
set linesize 135
select ID as "Id",
	ROSTER_NAME as "Name",
	ROSTER_USER as "User", 
	ROSTER_TYPE as "Type",
	ROSTER_STATUS as "Status"
from table(dbms_xmpp.rosters_table('talk.google.com',
	5222,
	'gmail.com',
	'YOUR_GOOGLE_LOGIN',
	'YOUR_GOOGLE_PASSWORD'));